I have a crash in my app that I cannot debug for the life of me. When plugged in and debugging from Xcode on a device and NSZombieEnabled on, I do not receive the crash. When I unplug and run the app on its own, or turn of NSZombieEnabled, it crashes every time.
Here is what I get when I turn off NSZombieEnabled: EXC_BAD_ACCESS
bool _WebTryThreadLock(bool), 0x58a260: Multiple locks on web thread not allowed! Please file a bug. Crashing now...
1 _ZL17_WebTryThreadLockb
2 _ZL14WebRunLoopLockP19__CFRunLoopObservermPv
3 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
4 __CFRunLoopDoObservers
5 __CFRunLoopRun
6 CFRunLoopRunSpecific
7 CFRunLoopRunInMode
8 _ZL12RunWebThreadPv
9 _pthread_start
10 thread_start
Here is the stack trace from the test flight:
0 App 0x001ff492 testflight_backtrace + 142
1 App 0x001fffac TFSignalHandler + 212
2 libsystem_c.dylib 0x349e9538 _sigtramp + 48
3 JavaScriptCore 0x34b66aee WTFReportBacktrace + 146
4 WebCore 0x33ed5676 _ZL14WebRunLoopLockP19__CFRunLoopObservermPv + 30
5 CoreFoundation 0x33b39b4a __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 18
6 CoreFoundation 0x33b37d86 __CFRunLoopDoObservers + 258
7 CoreFoundation 0x33b3804e __CFRunLoopRun + 614
8 CoreFoundation 0x33abb4dc CFRunLoopRunSpecific + 300
9 CoreFoundation 0x33abb3a4 CFRunLoopRunInMode + 104
10 WebCore 0x33f7712e _ZL12RunWebThreadPv + 402
11 libsystem_c.dylib 0x349a0c1c _pthread_start + 320
12 libsystem_c.dylib 0x349a0ad7 thread_start + 7
I have had this crash before, and I have resolved it by throwing in the line to my viewDidLoad method on one of the view controllers where the crashing was occurring:
[[NSRunLoop currentRunLoop] runUntilDate: [NSDate dateWithTimeIntervalSinceNow:0.01]];
This line is not helping now.
The process that causes the app to crash is:
Present share view controller,
Dismiss share view controller,
Switch tab view on tabViewController,
Press button which presents share2 view controller
I am not doing any background processing or changing any UI, the crash happens RIGHT when you hit the button that presents the share2 view controller. This crash was not happening a few days ago and I have tried to revert all of my changes to find the cause of the issue, but I had no luck.
I have also scoured the internet for this error, and none of the info I found has helped me.
Any advice to point me in the right direction would be greatly appreciated, thanks!
I ended up re-doing the navigation between the 2 problem screens and I have not had the problem since.
My answer: always use Apples navigation and don’t try to build your own 😛