I have a UIWebView based iOS application which has recently started crashing quite a lot. I strongly believe the crash is caused by something that has changed in the web content (worst-case, but maybe most likely, scenario is it's a 3rd party banner ad), since the crash reports started to come in for all version of my iOS app on the same day, suddenly going from 0 to several hundred crashes.
Here is the crash stack trace on iOS9:
Thread : Crashed: WebThread
0 libmetal_timestamp.dylib 0x18cf2df08 (Missing)
1 libmetal_timestamp.dylib 0x18cf2eec4 (Missing)
2 libmetal_timestamp.dylib 0x18cf335ac (Missing)
3 MobileCoreServices 0x185c941a8 (Missing)
4 MobileCoreServices 0x185bf3428 (Missing)
5 OpenGLES 0x185ccea9c glTexImage2D + 108
6 WebCore 0x1946e3da8 WebCore::GraphicsContext3D::texImage2D(unsigned int, int, unsigned int, int, int, int, unsigned int, unsigned int, void const*) + 60
7 WebCore 0x194ffb37c WebCore::WebGLRenderingContextBase::texImage2DBase(unsigned int, int, unsigned int, int, int, int, unsigned int, unsigned int, void const*, int&) + 160
8 WebCore 0x194ffbb84 WebCore::WebGLRenderingContextBase::texImage2D(unsigned int, int, unsigned int, int, int, int, unsigned int, unsigned int, JSC::ArrayBufferView*, int&) + 784
9 WebCore 0x194b80ba4 WebCore::jsWebGLRenderingContextBasePrototypeFunctionTexImage2D(JSC::ExecState*) + 2880
10 JavaScriptCore 0x1842422f0 llint_entry + 25056
11 JavaScriptCore 0x184241d10 llint_entry + 23552
12 JavaScriptCore 0x184241d10 llint_entry + 23552
13 JavaScriptCore 0x184241d10 llint_entry + 23552
14 JavaScriptCore 0x18423bef8 vmEntryToJavaScript + 312
15 JavaScriptCore 0x184168c48 JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*) + 180
16 JavaScriptCore 0x183e02108 JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 400
17 JavaScriptCore 0x183eb41bc JSC::boundFunctionCall(JSC::ExecState*) + 512
18 JavaScriptCore 0x18423c080 vmEntryToNative + 320
19 JavaScriptCore 0x183e0214c JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 468
20 JavaScriptCore 0x183f117dc JSC::call(JSC::ExecState*, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&, WTF::NakedPtr<JSC::Exception>&) + 80
21 WebCore 0x1943b8ecc WebCore::JSCallbackData::invokeCallback(JSC::JSValue, JSC::MarkedArgumentBuffer&, bool*) + 580
22 WebCore 0x194a60434 WebCore::JSRequestAnimationFrameCallback::handleEvent(double) + 196
23 WebCore 0x194dd634c WebCore::ScriptedAnimationController::serviceScriptedAnimations(double) + 424
24 WebCore 0x194575c48 WebCore::DisplayRefreshMonitor::displayDidRefresh() + 428
25 QuartzCore 0x187567840 CA::Display::DisplayLinkItem::dispatch() + 40
26 QuartzCore 0x1875676f4 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 424
27 IOKit 0x183a262f8 IODispatchCalloutFromCFMessage + 372
28 CoreFoundation 0x18272e840 __CFMachPortPerform + 180
29 CoreFoundation 0x182744c7c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
30 CoreFoundation 0x1827443b4 __CFRunLoopDoSource1 + 436
31 CoreFoundation 0x18274210c __CFRunLoopRun + 1800
32 CoreFoundation 0x182670ca0 CFRunLoopRunSpecific + 384
33 WebCore 0x19425a54c RunWebThread(void*) + 456
34 libsystem_pthread.dylib 0x197c83b28 _pthread_body + 156
35 libsystem_pthread.dylib 0x197c83a8c _pthread_body + 154
36 libsystem_pthread.dylib 0x197c81028 thread_start + 4
On iOS8 it crashes with a slightly different but very very similar stack trace. The iOS8 and iOS9 crashes started at the same time so it's undoubtedly the same thing.
Given the OpenGLES references in the crash report I suspect it has something to do with DOM rendering involving the hardware. Has anyone else developed a hybrid web app and seen these crashes? Any specific CSS transforms/transitions that caused the app to crash this way?
Also, there's a reference to WebGLRenderingContextBase, does that mean that it must be caused by actual WebGL on the web page or could it still originate just form non-3D CSS styles?
Related
I get a crash by firebase. Only a useful information:
Corrupt NSInvocation detected. Pointer authentication.
I didn't met this type of crash before. And I found this error is related to PAC, which means Pointer Authentication. And PAC is enabled from A12 clip. Thus all devices had this crash were from iPhone XR / 11 / 12 / 13 and so on.
Below is the crash file:
2022-02-07_16-44-57.4063_+0700-4c0b14a2bc46de636f18885059d3ef71e86671cd.crash
Incident Identifier: 3A24760C-2DD9-417C-AD49-DE29CD5DC9FF
Hardware Model: iPhone11,6
Process: ShopeeFood [27579]
Path: /private/var/containers/Bundle/Application/153DB199-A6C5-4237-A7C2-B2AB7F54D97B/ShopeeFood.app/ShopeeFood
Identifier: vn.foody.DeliveryNow
Version: 5.11.1 (24)
AppStoreTools: 13C90b
AppVariant: 1:iPhone11,6:15
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: vn.foody.DeliveryNow [3660]
Date/Time: 2022-02-07 16:44:57.4063 +0700
Launch Time: 2022-02-07 15:21:52.7331 +0700
OS Version: iPhone OS 15.2.1 (19C63)
Release Type: User
Baseband Version: 4.02.02
Report Version: 104
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x0000000180a17f64
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: SIGNAL 5 Trace/BPT trap: 5
Terminating Process: exc handler [27579]
Triggered by Thread: 0
Kernel Triage:
VM - pmap_enter failed with resource shortage
VM - pmap_enter failed with resource shortage
Thread 0 name:
Thread 0 Crashed:
0 CoreFoundation 0x0000000180a17f64 _NSIPoisoned + 16 (NSForwarding.m:3059)
1 CoreFoundation 0x000000018094a1e8 -[NSInvocation setArgument:atIndex:] + 596 (NSForwarding.m:3068)
2 CoreFoundation 0x000000018091e9c4 -[NSInvocation invokeWithTarget:] + 64 (NSForwarding.m:3474)
3 React 0x000000010744b8dc -[RCTModuleMethod invokeWithBridge:module:arguments:] + 460 (RCTModuleMethod.mm:584)
4 React 0x000000010744da2c facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&) + 244 (RCTNativeModule.mm:114)
5 React 0x000000010744d790 facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int)::$_0::operator()() const + 44 (RCTNativeModule.mm:75)
6 React 0x000000010744d790 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 88 (RCTNativeModule.mm:67)
7 React 0x000000010744d5f0 facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int) + 388 (RCTNativeModule.mm:80)
8 cxxreact 0x0000000108932e70 facebook::react::JsToNativeBridge::callNativeModules(facebook::react::JSExecutor&, folly::dynamic&&, bool) + 152 (NativeToJsBridge.cpp:62)
9 jsireact 0x0000000108acf1dc facebook::react::JSIExecutor::callNativeModules(facebook::jsi::Value const&, bool) + 92 (JSIExecutor.cpp:388)
10 jsireact 0x0000000108ad132c facebook::react::JSIExecutor::initializeRuntime()::$_1::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) const + 8 (JSIExecutor.cpp:104)
11 jsireact 0x0000000108ad132c decltype(std::__1::forward<facebook::react::JSIExecutor::initializeRuntime()::$_1&>(fp)(std::__1::forward<facebook::jsi::Runtime&>(fp0), std::__1::forward<facebook::jsi::Value const&>(fp0), std::__... + 28 (type_traits:3747)
12 jsireact 0x0000000108ad132c facebook::jsi::Value std::__1::__invoke_void_return_wrapper<facebook::jsi::Value>::__call<facebook::react::JSIExecutor::initializeRuntime()::$_1&, facebook::jsi::Runtime&, facebook::jsi::Value cons... + 28 (__functional_base:317)
13 jsireact 0x0000000108ad132c std::__1::__function::__alloc_func<facebook::react::JSIExecutor::initializeRuntime()::$_1, std::__1::allocator<facebook::react::JSIExecutor::initializeRuntime()::$_1>, facebook::jsi::Value (faceboo... + 28 (functional:1553)
14 jsireact 0x0000000108ad132c std::__1::__function::__func<facebook::react::JSIExecutor::initializeRuntime()::$_1, std::__1::allocator<facebook::react::JSIExecutor::initializeRuntime()::$_1>, facebook::jsi::Value (facebook::jsi... + 44 (functional:1727)
15 jsi 0x0000000108a7d804 std::__1::__function::__value_func<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()(facebook::jsi::Runtime&, face... + 28 (functional:1880)
16 jsi 0x0000000108a7d804 std::__1::function<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)>::operator()(facebook::jsi::Runtime&, facebook::jsi::Value... + 44 (functional:2555)
17 jsi 0x0000000108a7d548 facebook::jsc::JSCRuntime::createFunctionFromHostFunction(facebook::jsi::PropNameID const&, unsigned int, std::__1::function<facebook::jsi::Value (facebook::jsi::Runtime&, facebook::jsi::Value cons... + 384 (JSCRuntime.cpp:1151)
18 JavaScriptCore 0x000000018bc2352c JSC::JSCallbackObject<JSC::JSNonFinalObject>::callImpl(JSC::JSGlobalObject*, JSC::CallFrame*) + 468 (JSCallbackObjectFunctions.h:566)
19 JavaScriptCore 0x000000018c3f13c4 JSC::LLInt::setUpCall(JSC::CallFrame*, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*) + 1736 (NativeFunction.h:50)
20 JavaScriptCore 0x000000018bb7b7b0 llint_function_for_construct_arity_checkTagGateAfter + 144508
21 JavaScriptCore 0x000000018bb7b70c llint_function_for_construct_arity_checkTagGateAfter + 144344
22 JavaScriptCore 0x000000018bb7b7e0 llint_function_for_construct_arity_checkTagGateAfter + 144556
23 JavaScriptCore 0x000000018bb7b70c llint_function_for_construct_arity_checkTagGateAfter + 144344
24 JavaScriptCore 0x000000018bb7ba70 llint_function_for_construct_arity_checkTagGateAfter + 145212
25 JavaScriptCore 0x000000018bb52028 vmEntryToJavaScriptTrampoline + 8
26 JavaScriptCore 0x000000018c28c704 JSC::Interpreter::executeProgram(JSC::SourceCode const&, JSC::JSGlobalObject*, JSC::JSObject*) + 12632 (JITCodeInlines.h:42)
27 JavaScriptCore 0x000000018c568c28 JSC::evaluate(JSC::JSGlobalObject*, JSC::SourceCode const&, JSC::JSValue, ***::NakedPtr<JSC::Exception>&) + 272 (Completion.cpp:137)
28 JavaScriptCore 0x000000018bc19ae8 JSEvaluateScript + 724 (JSBase.cpp:53)
29 jsi 0x0000000108a78b08 facebook::jsc::JSCRuntime::evaluateJavaScript(std::__1::shared_ptr<facebook::jsi::Buffer const> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 292 (JSCRuntime.cpp:426)
30 jsireact 0x0000000108ace460 facebook::react::JSIExecutor::loadBundle(std::__1::unique_ptr<facebook::react::JSBigString const, std::__1::default_delete<facebook::react::JSBigString const> >, std::__1::basic_string<char, std::_... + 328 (JSIExecutor.cpp:158)
31 cxxreact 0x0000000108932310 facebook::react::NativeToJsBridge::loadBundleSync(std::__1::unique_ptr<facebook::react::RAMBundleRegistry, std::__1::default_delete<facebook::react::RAMBundleRegistry> >, std::__1::unique_ptr<faceb... + 152 (NativeToJsBridge.cpp:154)
32 cxxreact 0x0000000108925a4c facebook::react::Instance::loadBundleSync(std::__1::unique_ptr<facebook::react::RAMBundleRegistry, std::__1::default_delete<facebook::react::RAMBundleRegistry> >, std::__1::unique_ptr<facebook::rea... + 164 (Instance.cpp:88)
33 cxxreact 0x0000000108925c08 facebook::react::Instance::loadScriptFromString(std::__1::unique_ptr<facebook::react::JSBigString const, std::__1::default_delete<facebook::react::JSBigString const> >, std::__1::basic_string<char,... + 72 (Instance.cpp:105)
34 React 0x000000010742ff94 __51-[RCTCxxBridge executeApplicationScript:url:async:]_block_invoke + 684 (RCTCxxBridge.mm:1367)
35 React 0x00000001074348bc std::__1::__function::__value_func<void ()>::operator()() const + 20 (functional:1880)
36 React 0x00000001074348bc std::__1::function<void ()>::operator()() const + 20 (functional:2555)
37 React 0x00000001074348bc facebook::react::tryAndReturnError(std::__1::function<void ()> const&) + 40 (RCTCxxUtils.mm:74)
38 React 0x0000000107429c38 -[RCTCxxBridge _tryAndHandleError:] + 100 (RCTCxxBridge.mm:275)
39 React 0x000000010742fc80 -[RCTCxxBridge executeApplicationScript:url:async:] + 164 (RCTCxxBridge.mm:1346)
40 React 0x000000010742fbd4 -[RCTCxxBridge executeApplicationScriptSync:url:] + 24 (RCTCxxBridge.mm:1341)
41 React 0x000000010742d538 -[RCTCxxBridge executeSourceCode:sync:] + 164 (RCTCxxBridge.mm:941)
42 SHPReactNativeSDK 0x0000000107ec1d8c -[SHPRNContainer executePluginCode:] + 236 (SHPRNContainer.m:152)
43 SHPReactNativeSDK 0x0000000107ec15a4 -[SHPRNContainer loadPluginBundle:bundleLoadCompletion:] + 492 (SHPRNContainer.m:80)
44 SHPReactNativeSDK 0x0000000107ed5fd8 -[SHPRNModeReleaseStrategies loadPlugin:bundleName:pageName:bundleLoadCompletion:] + 188 (SHPRNModeStrategies.m:63)
45 SHPReactNativeSDK 0x0000000107ec3070 __72-[SHPRNContainerManager loadPluginBundle:pageName:bundleLoadCompletion:]_block_invoke + 364 (SHPRNContainerManager.m:163)
46 SHPReactNativeSDK 0x0000000107ec3544 __72-[SHPRNContainerManager loadPluginBundle:pageName:bundleLoadCompletion:]_block_invoke.119 + 144 (SHPRNContainerManager.m:203)
47 Foundation 0x00000001820ffc10 -[__NSObserver _doit:] + 348 (NSNotification.m:327)
48 CoreFoundation 0x00000001808d2f88 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 28 (CFNotificationCenter.c:652)
49 CoreFoundation 0x000000018096ec3c ___CFXRegistrationPost_block_invoke + 52 (CFNotificationCenter.c:173)
50 CoreFoundation 0x0000000180941ff4 _CFXRegistrationPost + 456 (CFNotificationCenter.c:199)
51 CoreFoundation 0x00000001808e8df4 _CFXNotificationPost + 716 (CFNotificationCenter.c:1147)
52 Foundation 0x00000001820e5f68 -[NSNotificationCenter postNotificationName:object:userInfo:] + 96 (NSNotification.m:560)
53 SHPReactNativeSDK 0x0000000107ec4394 __62-[SHPRNContainerManager createPreLoadContainerWithCompletion:]_block_invoke + 88 (SHPRNContainerManager.m:346)
54 SHPReactNativeSDK 0x0000000107ec1b50 -[SHPRNContainer pluginJSLoaded:] + 128 (SHPRNContainer.m:124)
55 CoreFoundation 0x00000001808d2f88 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 28 (CFNotificationCenter.c:652)
56 CoreFoundation 0x000000018096ec3c ___CFXRegistrationPost_block_invoke + 52 (CFNotificationCenter.c:173)
57 CoreFoundation 0x0000000180941ff4 _CFXRegistrationPost + 456 (CFNotificationCenter.c:199)
58 CoreFoundation 0x00000001808e8df4 _CFXNotificationPost + 716 (CFNotificationCenter.c:1147)
59 Foundation 0x00000001820e5f68 -[NSNotificationCenter postNotificationName:object:userInfo:] + 96 (NSNotification.m:560)
60 React 0x000000010742d7a4 __39-[RCTCxxBridge executeSourceCode:sync:]_block_invoke_2 + 200 (RCTCxxBridge.mm:928)
61 libdispatch.dylib 0x00000001805b1924 _dispatch_call_block_and_release + 32 (init.c:1517)
62 libdispatch.dylib 0x00000001805b3670 _dispatch_client_callout + 20 (object.m:560)
63 libdispatch.dylib 0x00000001805c1b70 _dispatch_main_queue_callback_4CF + 944 (inline_internal.h:2601)
64 CoreFoundation 0x00000001808f9d84 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 (CFRunLoop.c:1795)
65 CoreFoundation 0x00000001808b3f5c __CFRunLoopRun + 2540 (CFRunLoop.c:3144)
66 CoreFoundation 0x00000001808c7468 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
67 GraphicsServices 0x000000019c45238c GSEventRunModal + 164 (GSEvent.c:2200)
68 UIKitCore 0x0000000183269088 -[UIApplication _run] + 1100 (UIApplication.m:3493)
69 UIKitCore 0x0000000182fe7958 UIApplicationMain + 2092 (UIApplication.m:5046)
70 ShopeeFood 0x00000001043ed73c main + 152 (main.m:19)
71 dyld 0x000000010536daa4 start + 520 (dyldMain.cpp:879)
Hope anyone can help me how to solve this problem, or give me any information about this type of crash.
Thank you very much.
I am trying to figure out what is causing this crash and so far have been unable to determine what the problem is. Any help would be greatly appreciated. This is the log from Firebase on the crash, and its happened multiple times.
Crashed: WebThread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x00000000000048e8
0
AGXMetalA11
(Missing)
1
AppleMetalGLRenderer
GLDContextRec::setRenderTexturesAndSamplersInternal(unsigned int, unsigned int&, SetSamplerStateIMPCache*, SetTextureIMPCache*)
2
AppleMetalGLRenderer
GLDContextRec::setRenderTexturesAndSamplersInternal(unsigned int, unsigned int&, SetSamplerStateIMPCache*, SetTextureIMPCache*)
3
AppleMetalGLRenderer
GLDContextRec::setRenderSamplersAndTextures()
4
AppleMetalGLRenderer
GLDContextRec::setRenderState(unsigned int)
5
AppleMetalGLRenderer
gldRenderVertexArray(GLDContextRec*, unsigned int, unsigned int, int, int, unsigned int, void const*, int, void const*)
6
GLEngine
glDrawElements_ACC_ES2Exec
7
WebCore
WebCore::GraphicsContext3D::drawElements(unsigned int, int, unsigned int, long) + 64
8
WebCore
WebCore::WebGLRenderingContextBase::drawElements(unsigned int, int, unsigned int, long long) + 316
9
WebCore
WebCore::jsWebGLRenderingContextPrototypeFunctionDrawElements(JSC::ExecState*) + 328
10
JavaScriptCore
llint_entry + 135068
11
JavaScriptCore
llint_entry + 124496
12
JavaScriptCore
llint_entry + 124496
13
JavaScriptCore
llint_entry + 124496
14
JavaScriptCore
llint_entry + 124496
15
JavaScriptCore
llint_entry + 124664
16
JavaScriptCore
llint_entry + 124664
17
JavaScriptCore
llint_entry + 124496
18
JavaScriptCore
llint_entry + 124664
19
JavaScriptCore
llint_entry + 124496
20
JavaScriptCore
llint_entry + 124496
21
JavaScriptCore
llint_entry + 124496
22
JavaScriptCore
llint_entry + 124496
23
JavaScriptCore
llint_entry + 129852
24
JavaScriptCore
llint_entry + 124496
25
JavaScriptCore
llint_entry + 124496
26
JavaScriptCore
vmEntryToJavaScript + 248
27
JavaScriptCore
JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 408
28
JavaScriptCore
JSC::profiledCall(JSC::ExecState*, JSC::ProfilingReason, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&, WTF::NakedPtr<JSC::Exception>&) + 196
29
WebCore
WebCore::JSExecState::profiledCall(JSC::ExecState*, JSC::ProfilingReason, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&, WTF::NakedPtr<JSC::Exception>&) + 140
30
WebCore
WebCore::JSCallbackData::invokeCallback(WebCore::JSDOMGlobalObject&, JSC::JSObject*, JSC::JSValue, JSC::MarkedArgumentBuffer&, WebCore::JSCallbackData::CallbackType, JSC::PropertyName, WTF::NakedPtr<JSC::Exception>&) + 356
31
WebCore
WebCore::JSRequestAnimationFrameCallback::handleEvent(double) + 412
32
WebCore
WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks(double) + 400
33
WebCore
WebCore::Page::updateRendering() + 280
34
WebKitLegacy
LayerFlushController::flushLayers() + 52
35
WebKitLegacy
WebViewLayerFlushScheduler::layerFlushCallback() + 56
36
CoreFoundation
__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
37
CoreFoundation
__CFRunLoopDoObservers + 416
38
CoreFoundation
CFRunLoopRunSpecific + 496
39
WebCore
RunWebThread(void*) + 612
40
libsystem_pthread.dylib
_pthread_start + 156
41
libsystem_pthread.dylib
thread_start + 8
I am not sure why its reporting java because we are not using java in this app; I can only assume Apple has something running in the background. Also, We are not using AppleMetalGLRenderer specifically so again I'm assuming that Apple has it on by default?
Any help would be appreciated.
I am getting a lot of reports on Crashlytics of this WebThread crash, mostly for iPads (~80%) on iOS 12 (~96%). Not sure exactly what it means aside from being a timer / timing issue - any ideas? I have Amazon Ads, Google AdMob and use a WkWebView for the main app.
Crashed: WebThread
0 libGPUSupportMercury.dylib 0x1d0eb5fe4 gpus_ReturnNotPermittedKillClient
1 AGXGLDriver 0x1d54e5ed8 (Missing)
2 libGPUSupportMercury.dylib 0x1d0eb6fac gpusSubmitDataBuffers
3 AGXGLDriver 0x1d54e7404 (Missing)
4 WebCore 0x1beb39e30 WebCore::GraphicsContext3D::reshape(int, int) + 580
5 WebCore 0x1bf001758 WebCore::WebGLRenderingContextBase::initializeNewContext() + 936
6 WebCore 0x1bf001048 WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase(WebCore::CanvasBase&, WTF::Ref<WebCore::GraphicsContext3D, WTF::DumbPtrTraits<WebCore::GraphicsContext3D> >&&, WebCore::GraphicsContext3DAttributes) + 640
7 WebCore 0x1beff7c3c WebCore::WebGLRenderingContext::create(WebCore::CanvasBase&, WTF::Ref<WebCore::GraphicsContext3D, WTF::DumbPtrTraits<WebCore::GraphicsContext3D> >&&, WebCore::GraphicsContext3DAttributes) + 84
8 WebCore 0x1bf0003fc WebCore::WebGLRenderingContextBase::create(WebCore::CanvasBase&, WebCore::GraphicsContext3DAttributes&, WTF::String const&) + 1416
9 WebCore 0x1be6cfd6c WebCore::HTMLCanvasElement::getContext(JSC::ExecState&, WTF::String const&, WTF::Vector<JSC::Strong<JSC::Unknown>, 0ul, WTF::CrashOnOverflow, 16ul>&&) + 904
10 WebCore 0x1bdc59194 WebCore::jsHTMLCanvasElementPrototypeFunctionGetContext(JSC::ExecState*) + 416
11 JavaScriptCore 0x1bc33073c llint_entry + 89260
12 JavaScriptCore 0x1bc32ecb4 llint_entry + 82468
13 JavaScriptCore 0x1bc32ed54 llint_entry + 82628
14 JavaScriptCore 0x1bc32ed54 llint_entry + 82628
15 JavaScriptCore 0x1bc31a7fc vmEntryToJavaScript + 268
16 JavaScriptCore 0x1bc84b32c JSC::Interpreter::executeProgram(JSC::SourceCode const&, JSC::ExecState*, JSC::JSObject*) + 9816
17 JavaScriptCore 0x1bca546dc JSC::evaluate(JSC::ExecState*, JSC::SourceCode const&, JSC::JSValue, WTF::NakedPtr<JSC::Exception>&) + 320
18 WebCore 0x1be30d4bc WebCore::JSExecState::profiledEvaluate(JSC::ExecState*, JSC::ProfilingReason, JSC::SourceCode const&, JSC::JSValue, WTF::NakedPtr<JSC::Exception>&) + 108
19 WebCore 0x1be30d2f8 WebCore::ScriptController::evaluateInWorld(WebCore::ScriptSourceCode const&, WebCore::DOMWrapperWorld&, WebCore::ExceptionDetails*) + 232
20 WebCore 0x1be5af98c WebCore::ScriptElement::executeClassicScript(WebCore::ScriptSourceCode const&) + 640
21 WebCore 0x1be5774c8 WebCore::LoadableClassicScript::execute(WebCore::ScriptElement&) + 140
22 WebCore 0x1be5afc30 WebCore::ScriptElement::executeScriptAndDispatchEvent(WebCore::LoadableScript&) + 224
23 WebCore 0x1be5b2f40 WebCore::ScriptRunner::timerFired() + 508
24 WebCore 0x1bea5a20c WebCore::ThreadTimers::sharedTimerFiredInternal() + 216
25 WebCore 0x1bea7a258 WebCore::timerFired(__CFRunLoopTimer*, void*) + 28
26 CoreFoundation 0x1b4f92650 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 28
27 CoreFoundation 0x1b4f92380 __CFRunLoopDoTimer + 864
28 CoreFoundation 0x1b4f91bb4 __CFRunLoopDoTimers + 248
29 CoreFoundation 0x1b4f8cb04 __CFRunLoopRun + 1844
30 CoreFoundation 0x1b4f8c0b0 CFRunLoopRunSpecific + 436
31 WebCore 0x1bdc1cbd8 RunWebThread(void*) + 600
32 libsystem_pthread.dylib 0x1b4c1f2c0 _pthread_body + 128
33 libsystem_pthread.dylib 0x1b4c1f220 _pthread_start + 44
34 libsystem_pthread.dylib 0x1b4c22cdc thread_start + 4
https://groups.google.com/forum/#!msg/google-admob-ads-sdk/MOaVw22zUgY/sOCFi3TuBgAJ had a workaround but it was fixed in Admob iOS 7.45.0 https://developers.google.com/admob/ios/rel-notes
Fixed a crash that occurs on rare occasions when dismissing video ads.
I faced these crashes, then switch to using WKWebView. WKWebViews run in another process, so even if this issue still occurs it may crash only the web view instead of the entire application.
put this key in your infor.plist should do it
<key>gad_preferred_webview</key>
<string>wkwebview</string>
We are facing the following crash in our iOS Cordova based app:
Crashed: WebThread
0 JavaScriptCore 0x187a3b22c WTFCrash + 72
1 JavaScriptCore 0x187a3b224 WTFCrash + 64
2 WebCore 0x187d6c4fc WebCore::CSSParser::addNamespace(WTF::AtomicString const&, WTF::AtomicString const&) + 186
3 WebCore 0x188a6ecac WebCore::TextResourceDecoder::decodeAndFlush(char const*, unsigned long) + 192
4 WebCore 0x187cb5c9c WebCore::CachedScript::script() + 72
5 JavaScriptCore 0x187a21f20 std::__1::unique_ptr<JSC::FunctionNode, std::__1::default_delete<JSC::FunctionNode> > JSC::parse<JSC::FunctionNode>(JSC::VM*, JSC::SourceCode const&, JSC::FunctionParameters*, JSC::Identifier const&, JSC::JSParserBuiltinMode, JSC::JSParserStrictMode, JSC::JSParserCodeType, JSC::ParserError&, JSC::JSTextPosition*, JSC::ConstructorKind, JSC::ThisTDZMode) + 88
6 JavaScriptCore 0x187a21550 JSC::UnlinkedFunctionExecutable::codeBlockFor(JSC::VM&, JSC::SourceCode const&, JSC::CodeSpecializationKind, JSC::DebuggerMode, JSC::ProfilerMode, JSC::ParserError&) + 156
7 JavaScriptCore 0x1877a3440 JSC::ScriptExecutable::newCodeBlockFor(JSC::CodeSpecializationKind, JSC::JSFunction*, JSC::JSScope*, JSC::JSObject*&) + 508
8 JavaScriptCore 0x1877a3a70 JSC::ScriptExecutable::prepareForExecutionImpl(JSC::ExecState*, JSC::JSFunction*, JSC::JSScope*, JSC::CodeSpecializationKind) + 104
9 JavaScriptCore 0x1875229b0 JSC::LLInt::setUpCall(JSC::ExecState*, JSC::Instruction*, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*) + 164
10 JavaScriptCore 0x187961e58 llint_entry + 23912
11 JavaScriptCore 0x187961d44 llint_entry + 23636
I have tried to check the source code and found the following:
void CSSParser::addNamespace(const AtomicString& prefix, const AtomicString& uri)
{
if (!m_styleSheet || !m_allowNamespaceDeclarations)
return;
m_allowImportRules = false;
m_styleSheet->parserAddNamespace(prefix, uri);
if (prefix.isEmpty() && !uri.isNull())
m_defaultNamespace = uri;
}
But I can't just figure out where could the WTFCrash be happening. Any idea?
I have updated our app for iOS 7 and added the background fetch functionality. However, i'm noticing some crashes because of this feature. After background fetch call is completed, the completion handler block is executed with either new/no data. This results in a call to 'layoutSubviews' of my custom navigation NavigationBar and sometimes app is crashing with the following stack trace. I could not reproduce this issue myself but constantly receiving these crash logs from our users. Any help would be appreciated.
Thread 0 Crashed:
0 libsystem_platform.dylib 0x39cba486 _platform_memmove$VARIANT$Swift + 102
1 Foundation 0x2fce8f47 -[NSData(NSData) getBytes:range:] + 419
2 CoreFoundation 0x2f30637d CFDataGetBytes + 205
3 ImageIO 0x300e7357 CGImageReadGetBytesAtOffset + 283
4 ImageIO 0x300e7231 CGImageReadSessionGetBytes + 29
5 ImageIO 0x3022baeb read_fn + 23
6 ImageIO 0x300e7189 png_read_sig + 45
7 ImageIO 0x300e6e0d _cg_png_read_info + 33
8 ImageIO 0x300ef62f copyImageBlockSetPNG + 1123
9 ImageIO 0x300eec4b ImageProviderCopyImageBlockSetCallback + 539
10 CoreGraphics 0x2f43577d CGImageProviderCopyImageBlockSetWithOptions + 137
11 CoreGraphics 0x2f43a145 subImageProviderCopyImageBlockSet + 305
12 CoreGraphics 0x2f43577d CGImageProviderCopyImageBlockSetWithOptions + 137
13 CoreGraphics 0x2f435433 img_blocks_create + 383
14 CoreGraphics 0x2f4286fd img_data_lock + 1053
15 CoreGraphics 0x2f427ae1 CGSImageDataLock + 89
16 libRIP.A.dylib 0x2f774da7 ripc_AcquireImage + 99
17 libRIP.A.dylib 0x2f774131 ripc_DrawImage + 601
18 CoreGraphics 0x2f4279f3 CGContextDelegateDrawImage + 51
19 CoreGraphics 0x2f427879 CGContextDrawImage + 285
20 WebCore 0x373120db WebCore::GraphicsContext::drawNativeImage(CGImage*, WebCore::FloatSize const&, WebCore::ColorSpace, WebCore::FloatRect const&, WebCore::FloatRect const&, float, WebCore::CompositeOperator, WebCore::BlendMode, WebCore::ImageOrientation) + 1127
21 WebCore 0x37310e79 WebCore::BitmapImage::draw(WebCore::GraphicsContext*, WebCore::FloatRect const&, WebCore::FloatRect const&, WebCore::ColorSpace, WebCore::CompositeOperator, WebCore::BlendMode, WebCore::RespectImageOrientationEnum) + 349
22 WebCore 0x3735d897 WebCore::BitmapImage::draw(WebCore::GraphicsContext*, WebCore::FloatRect const&, WebCore::FloatRect const&, WebCore::ColorSpace, WebCore::CompositeOperator, WebCore::BlendMode) + 31
23 WebCore 0x3735892f WebCore::Image::drawTiled(WebCore::GraphicsContext*, WebCore::FloatRect const&, WebCore::FloatPoint const&, WebCore::FloatSize const&, WebCore::ColorSpace, WebCore::CompositeOperator, WebCore::BlendMode) + 499
24 WebCore 0x37358735 WebCore::GraphicsContext::drawTiledImage(WebCore::Image*, WebCore::ColorSpace, WebCore::IntRect const&, WebCore::IntPoint const&, WebCore::IntSize const&, WebCore::CompositeOperator, bool, WebCore::BlendMode) + 193
25 WebCore 0x3728bc11 WebCore::RenderBoxModelObject::paintFillLayerExtended(WebCore::PaintInfo const&, WebCore::Color const&, WebCore::FillLayer const*, WebCore::LayoutRect const&, WebCore::BackgroundBleedAvoidance, WebCore::InlineFlowBox*, WebCore::LayoutSize const&, WebCore::CompositeOperator, WebCore::RenderObject*) + 3321
26 WebCore 0x3728addd WebCore::RenderBox::paintFillLayers(WebCore::PaintInfo const&, WebCore::Color const&, WebCore::FillLayer const*, WebCore::LayoutRect const&, WebCore::BackgroundBleedAvoidance, WebCore::CompositeOperator, WebCore::RenderObject*) + 449
27 WebCore 0x3728ab41 WebCore::RenderBox::paintBackground(WebCore::PaintInfo const&, WebCore::LayoutRect const&, WebCore::BackgroundBleedAvoidance) + 317
28 WebCore 0x37289ee5 WebCore::RenderBox::paintBoxDecorations(WebCore::PaintInfo&, WebCore::LayoutPoint const&) + 329
29 WebCore 0x3728806f WebCore::RenderBlock::paintObject(WebCore::PaintInfo&, WebCore::LayoutPoint const&) + 55
30 WebCore 0x37289c3f WebCore::RenderBlock::paint(WebCore::PaintInfo&, WebCore::LayoutPoint const&) + 187
31 WebCore 0x37288cc9 WebCore::RenderBlock::paintFloats(WebCore::PaintInfo&, WebCore::LayoutPoint const&, bool) + 305
32 WebCore 0x3728813d WebCore::RenderBlock::paintObject(WebCore::PaintInfo&, WebCore::LayoutPoint const&) + 261
33 WebCore 0x37289c3f WebCore::RenderBlock::paint(WebCore::PaintInfo&, WebCore::LayoutPoint const&) + 187
34 WebCore 0x37288cfb WebCore::RenderBlock::paintFloats(WebCore::PaintInfo&, WebCore::LayoutPoint const&, bool) + 355
35 WebCore 0x3728813d WebCore::RenderBlock::paintObject(WebCore::PaintInfo&, WebCore::LayoutPoint const&) + 261
36 WebCore 0x37289c3f WebCore::RenderBlock::paint(WebCore::PaintInfo&, WebCore::LayoutPoint const&) + 187
37 WebCore 0x37288861 WebCore::RenderLayer::paintForegroundForFragmentsWithPhase(WebCore::PaintPhase, WTF::Vector<WebCore::LayerFragment, 1ul, WTF::CrashOnOverflow> const&, WebCore::GraphicsContext*, WebCore::RenderLayer::LayerPaintingInfo const&, unsigned int, WebCore::RenderObject*) + 269
38 WebCore 0x372886e7 WebCore::RenderLayer::paintForegroundForFragments(WTF::Vector<WebCore::LayerFragment, 1ul, WTF::CrashOnOverflow> const&, WebCore::GraphicsContext*, WebCore::GraphicsContext*, WebCore::LayoutRect const&, bool, WebCore::RenderLayer::LayerPaintingInfo const&, unsigned int, WebCore::RenderObject*, bool, bool) + 235
39 WebCore 0x37286435 WebCore::RenderLayer::paintLayerContents(WebCore::GraphicsContext*, WebCore::RenderLayer::LayerPaintingInfo const&, unsigned int) + 1585
40 WebCore 0x37285ca9 WebCore::RenderLayer::paintLayer(WebCore::GraphicsContext*, WebCore::RenderLayer::LayerPaintingInfo const&, unsigned int) + 621
41 WebCore 0x372885d9 WebCore::RenderLayer::paintList(WTF::Vector<WebCore::RenderLayer*, 0ul, WTF::CrashOnOverflow>*, WebCore::GraphicsContext*, WebCore::RenderLayer::LayerPaintingInfo const&, unsigned int) + 101
42 WebCore 0x3728647f WebCore::RenderLayer::paintLayerContents(WebCore::GraphicsContext*, WebCore::RenderLayer::LayerPaintingInfo const&, unsigned int) + 1659
43 WebCore 0x37285ca9 WebCore::RenderLayer::paintLayer(WebCore::GraphicsContext*, WebCore::RenderLayer::LayerPaintingInfo const&, unsigned int) + 621
44 WebCore 0x372885d9 WebCore::RenderLayer::paintList(WTF::Vector<WebCore::RenderLayer*, 0ul, WTF::CrashOnOverflow>*, WebCore::GraphicsContext*, WebCore::RenderLayer::LayerPaintingInfo const&, unsigned int) + 101
45 WebCore 0x3728647f WebCore::RenderLayer::paintLayerContents(WebCore::GraphicsContext*, WebCore::RenderLayer::LayerPaintingInfo const&, unsigned int) + 1659
46 WebCore 0x37285ca9 WebCore::RenderLayer::paintLayer(WebCore::GraphicsContext*, WebCore::RenderLayer::LayerPaintingInfo const&, unsigned int) + 621
47 WebCore 0x372859b3 WebCore::RenderLayer::paint(WebCore::GraphicsContext*, WebCore::LayoutRect const&, unsigned int, WebCore::RenderObject*, WebCore::RenderRegion*, unsigned int) + 103
48 WebCore 0x3728541b WebCore::FrameView::paintContents(WebCore::GraphicsContext*, WebCore::IntRect const&) + 499
49 WebKit 0x37c4578d -[WebFrame(WebInternal) _drawRect:contentsOnly:] + 357
50 WebKit 0x37c455b9 -[WebHTMLView drawSingleRect:] + 137
51 WebKit 0x37c454db -[WebHTMLView drawRect:] + 43
52 WebCore 0x37284d93 -[WAKView _drawRect:context:lockFocus:] + 275
53 WebCore 0x37284ec7 -[WAKView _drawRect:context:lockFocus:] + 583
54 WebCore 0x37284ec7 -[WAKView _drawRect:context:lockFocus:] + 583
55 WebCore 0x37284ec7 -[WAKView _drawRect:context:lockFocus:] + 583
56 WebCore 0x37284ec7 -[WAKView _drawRect:context:lockFocus:] + 583
57 WebCore 0x37284c47 -[WAKView displayRect:] + 59
58 WebCore 0x37284c03 -[WAKWindow displayRect:] + 55
59 WebCore 0x37284b49 WebCore::TileCache::drawWindowContent(TileLayer*, CGContext*, CGRect) + 673
60 WebCore 0x37284525 WebCore::TileCache::drawLayer(TileLayer*, CGContext*) + 505
61 QuartzCore 0x317d3813 CABackingStoreUpdate_ + 1859
62 QuartzCore 0x318ad735 ___ZN2CA5Layer8display_Ev_block_invoke + 53
63 QuartzCore 0x317d30c3 x_blame_allocations + 83
64 QuartzCore 0x317d2d77 CA::Layer::display_() + 1119
65 QuartzCore 0x317b6969 CA::Layer::display_if_needed(CA::Transaction*) + 209
66 QuartzCore 0x317b6601 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 25
67 QuartzCore 0x317b600d CA::Context::commit_transaction(CA::Transaction*) + 229
68 QuartzCore 0x317b5e1f CA::Transaction::commit() + 315
69 UIKit 0x31d973c9 _UIWindowUpdateVisibleContextOrder + 209
70 UIKit 0x31d9729d +[UIWindow _prepareWindowsPassingTestForAppResume:] + 13
71 UIKit 0x31db0ac5 -[UIApplication _updateSnapshotAndStateRestorationArchiveForBackgroundEvent:saveState:exitIfCouldNotRestoreState:] + 201
72 UIKit 0x31db0d81 -[UIApplication _replyToBackgroundFetchRequestWithResult:remoteNotificationToken:sequenceNumber:updateApplicationSnapshot:] + 105
73 UIKit 0x31db138d __61-[UIApplication _handleOpportunisticFetchWithSequenceNumber:]_block_invoke + 37
74 MyApp 0x001456b7 -[List fetched:error:withBackgroundFetchCompletionHandler:] (List.m:421)
75 MyApp 0x00144f87 __71-[List fetchFromServerWithBackgroundFetchCompletionHandler:]_block_invoke (List.m:292)
76 MyApp 0x0021ed07 APICompletionBlock_block_invoke_6 (APIRequest.m:305)
77 libdispatch.dylib 0x39b8c103 _dispatch_call_block_and_release + 11
78 libdispatch.dylib 0x39b8c0ef _dispatch_client_callout + 23
79 libdispatch.dylib 0x39b8e9a9 _dispatch_main_queue_callback_4CF + 269
80 CoreFoundation 0x2f3785b9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
81 CoreFoundation 0x2f376e85 __CFRunLoopRun + 1309
82 CoreFoundation 0x2f2e1541 CFRunLoopRunSpecific + 525
83 CoreFoundation 0x2f2e1323 CFRunLoopRunInMode + 107
84 GraphicsServices 0x340182eb GSEventRunModal + 139
85 UIKit 0x31b981e5 UIApplicationMain + 1137
86 MyApp 0x0009f77f main (main.m:14)
When you leave your app to the background, it saves the snapshot of the current view to the memory so it could be shown when you double-click the home button.
With the iOS7 background refresh feature ((void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler), you must execute the completionHandler function after you finish executing your fetch request.
The execution of that function also triggers updates to the UI - [UIApplication _updateSnapshotAndStateRestorationArchiveForBackgroundEvent:saveState:exitIfCouldNotRestoreState:], and in your case it triggers calculating the frame for a UIWebView from a background thread.
UIWebView can be updated only from the UIThread, so to overcome this crash I would suggest to wrap the completionHandler with execution on the main thread:
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler
{
void (^safeHandler)(UIBackgroundFetchResult) = ^(UIBackgroundFetchResult result){
dispatch_async(dispatch_get_main_queue(), ^{
completionHandler(result);
});
};
[someInstance doSomethingInBackground:userInfo withHandler:safeHandler];
}
And you will no longer have to worry where you invoke the completionHandler (now safeHandler) from.