Hi there,
I'm experiencing several crashes on JavaScriptCore pas_panic_on_out_of_memory_error
, only on devices with tvOS 15.4 and 15.4.1. This happens with users using the app for several hours as well as 5 seconds after launching the app.
Devices: AppleTV6,2 and AppleTV5,3
Thread 14 —
JavaScriptCore pas_panic_on_out_of_memory_error (JavaScriptCore)
JavaScriptCore bmalloc_try_iso_allocate_impl_impl_slow (JavaScriptCore)
JavaScriptCore bmalloc_heap_config_specialized_local_allocator_try_allocate_small_segregated_slow (JavaScriptCore)
JavaScriptCore bmalloc_allocate_impl_casual_case (JavaScriptCore)
JavaScriptCore ***::String::String(char16_t const*, unsigned int) (JavaScriptCore)
JavaScriptCore JSC::LiteralParser<char16_t>::parsePrimitiveValue(JSC::VM&) (JavaScriptCore)
JavaScriptCore JSC::LiteralParser<char16_t>::parse(JSC::ParserState) (JavaScriptCore)
JavaScriptCore JSC::jsonProtoFuncParse(JSC::JSGlobalObject*, JSC::CallFrame*) (JavaScriptCore)
JavaScriptCore llint_entry (JavaScriptCore)
JavaScriptCore llint_entry (JavaScriptCore)
JavaScriptCore llint_entry (JavaScriptCore)
JavaScriptCore llint_entry (JavaScriptCore)
JavaScriptCore vmEntryToJavaScript (JavaScriptCore)
JavaScriptCore JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) (JavaScriptCore)
JavaScriptCore JSC::boundThisNoArgsFunctionCall(JSC::JSGlobalObject*, JSC::CallFrame*) (JavaScriptCore)
JavaScriptCore vmEntryToNative (JavaScriptCore)
JavaScriptCore JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) (JavaScriptCore)
JavaScriptCore JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) (JavaScriptCore)
JavaScriptCore JSObjectCallAsFunction (JavaScriptCore)
JavaScriptCore -[JSValue invokeMethod:withArguments:] (JavaScriptCore)
ITMLKit -[IKJSObject invokeMethod:withArguments:] (ITMLKit)
ITMLKit -[IKJSEventListenerObject invokeMethod:withArguments:thenDispatchEvent:extraInfo:] (ITMLKit)
ITMLKit __43-[IKJSXMLHTTPRequest setRequestReadyState:]_block_invoke (ITMLKit)
ITMLKit -[IKAppContext _doEvaluate:] (ITMLKit)
ITMLKit -[IKAppContext _evaluate:] (ITMLKit)
ITMLKit __41-[IKAppContext evaluate:completionBlock:]_block_invoke (ITMLKit)
ITMLKit -[IKAppContext _sourcePerform] (ITMLKit)
ITMLKit -[IKConcurrentEvaluator lockSchedulingForEvaluation:] (ITMLKit)
ITMLKit IKRunLoopSourcePerformCallBack (ITMLKit)
CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ (CoreFoundation)
CoreFoundation __CFRunLoopDoSource0 (CoreFoundation)
CoreFoundation __CFRunLoopDoSources0 (CoreFoundation)
CoreFoundation __CFRunLoopRun (CoreFoundation)
CoreFoundation CFRunLoopRunSpecific (CoreFoundation)
ITMLKit -[IKAppContext _jsThreadMain] (ITMLKit)
Foundation __NSThread__start__ (Foundation)
libsyste...ad.dylib _pthread_start (libsystem_pthread.dylib)
libsyste...ad.dylib thread_start (libsystem_pthread.dylib)
This issue seems very similar to this existing thread, although not sure its related
I can’t lock up the ips log files in Xcode Organizer.
Understood.
Honestly, I don’t think getting more crash reports is going to help you here, and you’d be better off investing that time in trying to reproduce the issue. Clearly it’s a common problem, and Apple TV has a pretty limited configuration space, so this is more feasible than it would be, say, if this were happening on a Mac.
First, survey your crash reports to see if they tell you anything about the device spread. The crash report you posted is from AppleTV6,2
, that is, Apple TV 4K (1st generation). Are they all from that? Or are you seeing crashes from more modern Apple TVs.
Similarly, do this analysis for the tvOS version spread.
Also look at the app lifespan. In your crash the app had been running for 20-ish minutes. Is that typical? A memory problem like this is more likely to show up the longer the app has been running.
Finally, debugging. JavaScriptCore is part of the WebKit open source project, so you can actually see the source code in your backtrace. For example, frame 0 of thread 2 is pas_panic_on_out_of_memory_error
, and its source code is here.
This source should give you some idea of the context of the error. Gosh, just the name is a useful hint: pas_panic_on_out_of_memory_error
clearly indicates that JavaScriptCore has trapped because it’s run out of memory.
I don’t know enough about how JavaScriptCore is implemented to tell you whether it’s hitting some arbitrary limit within the code, or whether it’s gone to the system memory allocator to get more memory and that’s refused. However, the code is there for you to investigate and learn those answers for yourself.
And those answer might help you reproduce the problem. For example:
-
If your process has run out of memory, you could create a build of your app that artificially uses extra memory and see if that triggers a crash like this.
-
Alternatively, if JavaScriptCore has run out of its own internal memory, you could investigate how your app causes it to use that memory.
I’m sorry I don’t have an easy answer for you here. Debugging problems that only show up in the field is hard.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"