I got this app live on the app store, for which in 10 days I got more than 6000 crashes! The stacktrace I can see on HockeyApp is quite cryptic, and I also get 2 different stacktraces depending on iOS version (5 or 6), but I'm pretty sure they are both the same crash.
What do you think about this? Where should I hunt the bug? Needless to say I can't reproduce it.
iOS 6
Thread 0 Crashed:
0 libobjc.A.dylib 0x3ae395d0 _objc_msgSend + 16
1 Foundation 0x338bc4a1 __NSThreadPerformPerform + 461
2 CoreFoundation 0x32f798f7 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
3 CoreFoundation 0x32f791f3 __CFRunLoopDoSources0 + 363
4 CoreFoundation 0x32f77f2f __CFRunLoopRun + 647
5 CoreFoundation 0x32eeb23d _CFRunLoopRunSpecific + 357
6 CoreFoundation 0x32eeb0c9 _CFRunLoopRunInMode + 105
7 GraphicsServices 0x36aa633b _GSEventRunModal + 75
8 UIKit 0x34e072b9 _UIApplicationMain + 1121
9 <REDACTED> 0x00055943 main (main.m:16)
Exception Type: SIGSEGV
Exception Codes: SEGV_ACCERR at 0x736f7477
Crashed Thread: 0
iOS 5:
Thread 0 Crashed:
0 libobjc.A.dylib 0x338c8f78 _objc_msgSend + 16
1 CoreFoundation 0x35c091fb -[NSObject performSelector:withObject:] + 43
2 Foundation 0x350d9747 ___NSThreadPerformPerform + 351
3 CoreFoundation 0x35c7ead3 ___CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
4 CoreFoundation 0x35c7e335 ___CFRunLoopDoSources0 + 365
5 CoreFoundation 0x35c7d045 ___CFRunLoopRun + 653
6 CoreFoundation 0x35c004a5 _CFRunLoopRunSpecific + 301
7 CoreFoundation 0x35c0036d _CFRunLoopRunInMode + 105
8 GraphicsServices 0x3399b439 _GSEventRunModal + 137
9 UIKit 0x333d8cd5 _UIApplicationMain + 1081
10 <REDACTED> 0x0003f32b main (main.m:16)
Exception Type: SIGSEGV
Exception Codes: SEGV_ACCERR at 0xf10d9e21
Crashed Thread: 0
I have checked every call to performSelector:withObject: and I can't see any unrecognized selector being called. Where can the bug lie?
UPDATE ** Included stack traces from background threads as well
Thread 1:
0 libsystem_kernel.dylib 0x3568a3a8 _kevent + 24
1 libdispatch.dylib 0x339bdbc9 __dispatch_mgr_wakeup + 1
Thread 2:
0 libsystem_kernel.dylib 0x3569acd4 ___workq_kernreturn + 8
Thread 3:
0 libsystem_kernel.dylib 0x3569acd4 ___workq_kernreturn + 8
Thread 4:
0 libsystem_kernel.dylib 0x3569a0d8 ___psynch_mutexwait + 24
1 WebCore 0x3721d4ef __ZL17_WebTryThreadLockb + 215
2 WebCore 0x3721d7f3 __ZL14WebRunLoopLockP19__CFRunLoopObservermPv + 31
3 CoreFoundation 0x355f8b1b ___CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 19
4 CoreFoundation 0x355f6d57 ___CFRunLoopDoObservers + 259
5 CoreFoundation 0x355f701f ___CFRunLoopRun + 615
6 CoreFoundation 0x3557a4a5 _CFRunLoopRunSpecific + 301
7 CoreFoundation 0x3557a36d _CFRunLoopRunInMode + 105
8 WebCore 0x372c0ca3 __ZL12RunWebThreadPv + 403
9 libsystem_c.dylib 0x34843735 __pthread_start + 321
Thread 5:
0 libsystem_kernel.dylib 0x3569acd4 ___workq_kernreturn + 8
Thread 6:
0 libsystem_kernel.dylib 0x3569acd4 ___workq_kernreturn + 8
Thread 7:
0 libsystem_kernel.dylib 0x3568a004 _mach_msg_trap + 20
1 CoreFoundation 0x355f83f3 ___CFRunLoopServiceMachPort + 127
2 CoreFoundation 0x355f712b ___CFRunLoopRun + 883
3 CoreFoundation 0x3557a4a5 _CFRunLoopRunSpecific + 301
4 CoreFoundation 0x3557a36d _CFRunLoopRunInMode + 105
5 Foundation 0x349bfbb9 +[NSURLConnection(Loader) _resourceLoadLoop:] + 309
6 Foundation 0x349bfa81 -[NSThread main] + 73
7 Foundation 0x34a53591 ___NSThread__main__ + 1049
8 libsystem_c.dylib 0x34843735 __pthread_start + 321
Thread 8:
0 libsystem_kernel.dylib 0x3569acd4 ___workq_kernreturn + 8
Thread 9:
0 libsystem_kernel.dylib 0x3569a570 ___select + 20
1 libsystem_c.dylib 0x34843735 __pthread_start + 321
Thread 10:
0 libsystem_kernel.dylib 0x3569acd4 ___workq_kernreturn + 8
Thread 11:
0 libsystem_kernel.dylib 0x3569acd4 ___workq_kernreturn + 8
Thread 12:
0 libsystem_kernel.dylib 0x3569acd4 ___workq_kernreturn + 8
Thread 13:
0 libsystem_kernel.dylib 0x3569acd4 ___workq_kernreturn + 8
Thread 14:
0 libsystem_kernel.dylib 0x3569acd4 ___workq_kernreturn + 8
Thread 15:
0 libsystem_kernel.dylib 0x3569acd4 ___workq_kernreturn + 8
Thread 16:
0 libsystem_kernel.dylib 0x3569acd4 ___workq_kernreturn + 8
Thread 17:
0 libsystem_kernel.dylib 0x3569acd4 ___workq_kernreturn + 8
Thread 0 crashed with ARM Thread State:
r0: 0x10910cc0 r1: 0x322194f6 r2: 0x00482a7a r3: 0x00000000
r4: 0xf10a6823 r5: 0x00481a7a r6: 0x33102823 r7: 0x2fef2e54
r8: 0x00482a7a r9: 0x0c88653d r10: 0x3efac9b4 r11: 0x00000000
ip: 0x004a710c sp: 0x2fef2e38 lr: 0x00315cf3 pc: 0x33242f78
cpsr: 0x20080030
Thanks
EDITED: I finally solved it thanks to DDPerformDebugger.m
The crash was caused by a third party framework provided by the customer.
Thanks everybody
It seems you have a memory and threading issue in your app. The app is trying to send a message (method) to an object that is already deallocated.
Both stack traces hint at the usage of threads. It looks like you are doing some work in a background thread and then sending a message to an object (on the main thread?) which does not exist any more. So it might be helpful to check the stack traces of your background threads and see what they are doing.
Related
My application crashes when I try to scroll the tableview very fast or reload the data from remote. Everything seems to be working fine, when I let the remote fetch happen first and then scroll the tableview. I have no idea what the crash log below means. It just works fine sometimes and crashes sometime.
Incident Identifier: 710A120C-97E3-45C8-A7B2-E6A7BD98BC1A
CrashReporter Key: 8bd54d8428128b9e6b8c04d59b86c40cccf33457
Hardware Model: iPhone5,2
Process: MyApp [5294]
Path: /var/mobile/Applications/B6ED5B19-B8D7-4146-90A2-F709AE35292F/MyApp.app/MyApp
Identifier: MyApp
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2013-02-26 16:45:27.693 +0200
OS Version: iOS 6.1.2 (10B146)
Report Version: 104
Exception Type: EXC_CRASH (SIGSEGV)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Crashed Thread: 1
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 libobjc.A.dylib 0x3c3f658a _cache_getImp + 10
1 libobjc.A.dylib 0x3c3f6fa0 lookUpMethod + 24
2 libobjc.A.dylib 0x3c3f81e2 class_respondsToSelector + 26
3 CoreFoundation 0x3470a750 objectIsKindOfClass + 32
4 CoreFoundation 0x3470a49c __handleUncaughtException + 64
5 libobjc.A.dylib 0x3c3fba46 _objc_terminate() + 126
6 libc++abi.dylib 0x3be48118 safe_handler_caller(void (*)()) + 76
7 libc++abi.dylib 0x3be481b0 std::terminate() + 16
8 libc++abi.dylib 0x3be49626 __cxa_rethrow + 90
9 libobjc.A.dylib 0x3c3fb9b0 objc_exception_rethrow + 8
10 CoreFoundation 0x3465129c CFRunLoopRunSpecific + 452
11 CoreFoundation 0x346510c4 CFRunLoopRunInMode + 100
12 GraphicsServices 0x3822f336 GSEventRunModal + 70
13 UIKit 0x3656d2b4 UIApplicationMain + 1116
14 MyApp 0x000910a2 0x44000 + 315554
15 MyApp 0x0004668c 0x44000 + 9868
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1 Crashed:
0 libsystem_kernel.dylib 0x3c8df5d0 kevent64 + 24
1 libdispatch.dylib 0x3c81ad22 _dispatch_mgr_invoke + 806
2 libdispatch.dylib 0x3c816374 _dispatch_mgr_thread + 32
Thread 2 name: WebThread
Thread 2:
0 libsystem_kernel.dylib 0x3c8dee30 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3c8defd0 mach_msg + 48
2 CoreFoundation 0x346df2b6 __CFRunLoopServiceMachPort + 126
3 CoreFoundation 0x346de02c __CFRunLoopRun + 900
4 CoreFoundation 0x34651238 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x346510c4 CFRunLoopRunInMode + 100
6 WebCore 0x3a650390 RunWebThread(void*) + 440
7 libsystem_c.dylib 0x3c8480de _pthread_start + 306
8 libsystem_c.dylib 0x3c847fa4 thread_start + 4
Thread 3 name: com.apple.NSURLConnectionLoader
Thread 3:
0 libsystem_kernel.dylib 0x3c8dee30 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3c8defd0 mach_msg + 48
2 CoreFoundation 0x346df2b6 __CFRunLoopServiceMachPort + 126
3 CoreFoundation 0x346de02c __CFRunLoopRun + 900
4 CoreFoundation 0x34651238 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x346510c4 CFRunLoopRunInMode + 100
6 Foundation 0x34f9e888 +[NSURLConnection(Loader) _resourceLoadLoop:] + 304
7 Foundation 0x3502222c __NSThread__main__ + 968
8 libsystem_c.dylib 0x3c8480de _pthread_start + 306
9 libsystem_c.dylib 0x3c847fa4 thread_start + 4
Thread 4:
0 libsystem_kernel.dylib 0x3c8efd98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x3c83dad6 _pthread_workq_return + 14
2 libsystem_c.dylib 0x3c83d7f2 _pthread_wqthread + 362
3 libsystem_c.dylib 0x3c83d680 start_wqthread + 4
Thread 5:
0 libsystem_kernel.dylib 0x3c8dee30 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3c8defd0 mach_msg + 48
2 CoreFoundation 0x346df2b6 __CFRunLoopServiceMachPort + 126
3 CoreFoundation 0x346de02c __CFRunLoopRun + 900
4 CoreFoundation 0x34651238 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x346510c4 CFRunLoopRunInMode + 100
6 Foundation 0x34f755be -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 250
7 Foundation 0x35018c40 -[NSRunLoop(NSRunLoop) run] + 76
8 MyApp 0x0016b900 0x44000 + 1210624
9 Foundation 0x3502222c __NSThread__main__ + 968
10 libsystem_c.dylib 0x3c8480de _pthread_start + 306
11 libsystem_c.dylib 0x3c847fa4 thread_start + 4
Thread 6:
0 libsystem_kernel.dylib 0x3c8dee30 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3c8defd0 mach_msg + 48
2 CoreFoundation 0x346df2b6 __CFRunLoopServiceMachPort + 126
3 CoreFoundation 0x346de02c __CFRunLoopRun + 900
4 CoreFoundation 0x34651238 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x346510c4 CFRunLoopRunInMode + 100
6 Foundation 0x34f755be -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 250
7 Foundation 0x35018c40 -[NSRunLoop(NSRunLoop) run] + 76
8 MyApp 0x000e63d0 0x44000 + 664528
9 Foundation 0x3502222c __NSThread__main__ + 968
10 libsystem_c.dylib 0x3c8480de _pthread_start + 306
11 libsystem_c.dylib 0x3c847fa4 thread_start + 4
Thread 7 name: com.apple.CFSocket.private
Thread 7:
0 libsystem_kernel.dylib 0x3c8ef594 __select + 20
1 CoreFoundation 0x346e3474 __CFSocketManager + 676
2 libsystem_c.dylib 0x3c8480de _pthread_start + 306
3 libsystem_c.dylib 0x3c847fa4 thread_start + 4
Thread 8:
0 libsystem_kernel.dylib 0x3c8dee30 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3c8defd0 mach_msg + 48
2 CoreFoundation 0x346df2b6 __CFRunLoopServiceMachPort + 126
3 CoreFoundation 0x346de02c __CFRunLoopRun + 900
4 CoreFoundation 0x34651238 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x346afc46 CFRunLoopRun + 94
6 MyApp 0x00115d7e 0x44000 + 859518
7 Foundation 0x3502222c __NSThread__main__ + 968
8 libsystem_c.dylib 0x3c8480de _pthread_start + 306
9 libsystem_c.dylib 0x3c847fa4 thread_start + 4
Thread 9:
0 libsystem_kernel.dylib 0x3c8efd98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x3c83dad6 _pthread_workq_return + 14
2 libsystem_c.dylib 0x3c83d7f2 _pthread_wqthread + 362
3 libsystem_c.dylib 0x3c83d680 start_wqthread + 4
Thread 10:
0 libsystem_kernel.dylib 0x3c8efd98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x3c83dad6 _pthread_workq_return + 14
2 libsystem_c.dylib 0x3c83d7f2 _pthread_wqthread + 362
3 libsystem_c.dylib 0x3c83d680 start_wqthread + 4
Thread 11 name: JavaScriptCore::BlockFree
Thread 11:
0 libsystem_kernel.dylib 0x3c8ef08c __psynch_cvwait + 24
1 libsystem_c.dylib 0x3c840afc _pthread_cond_wait + 644
2 libsystem_c.dylib 0x3c840870 pthread_cond_timedwait + 40
3 JavaScriptCore 0x38625df6 WTF::ThreadCondition::timedWait(WTF::Mutex&, double) + 102
4 JavaScriptCore 0x38738532 JSC::BlockAllocator::blockFreeingThreadMain() + 78
5 JavaScriptCore 0x3874b030 WTF::wtfThreadEntryPoint(void*) + 12
6 libsystem_c.dylib 0x3c8480de _pthread_start + 306
7 libsystem_c.dylib 0x3c847fa4 thread_start + 4
Thread 12 name: JavaScriptCore::Marking
Thread 12:
0 libsystem_kernel.dylib 0x3c8ef08c __psynch_cvwait + 24
1 libsystem_c.dylib 0x3c840afc _pthread_cond_wait + 644
2 libsystem_c.dylib 0x3c84acf8 pthread_cond_wait + 36
3 JavaScriptCore 0x386cb6dc JSC::SlotVisitor::drainFromShared(JSC::SlotVisitor::SharedDrainMode) + 140
4 JavaScriptCore 0x386cb620 JSC::MarkStackThreadSharedData::markingThreadMain() + 140
5 JavaScriptCore 0x3874b030 WTF::wtfThreadEntryPoint(void*) + 12
6 libsystem_c.dylib 0x3c8480de _pthread_start + 306
7 libsystem_c.dylib 0x3c847fa4 thread_start + 4
Thread 13 name: WebCore: CFNetwork Loader
Thread 13:
0 libsystem_kernel.dylib 0x3c8dee30 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3c8defd0 mach_msg + 48
2 CoreFoundation 0x346df2b6 __CFRunLoopServiceMachPort + 126
3 CoreFoundation 0x346de02c __CFRunLoopRun + 900
4 CoreFoundation 0x34651238 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x346510c4 CFRunLoopRunInMode + 100
6 WebCore 0x3a6eaccc WebCore::runLoaderThread(void*) + 140
7 JavaScriptCore 0x3874b030 WTF::wtfThreadEntryPoint(void*) + 12
8 libsystem_c.dylib 0x3c8480de _pthread_start + 306
9 libsystem_c.dylib 0x3c847fa4 thread_start + 4
Thread 14:
0 libsystem_kernel.dylib 0x3c8efd98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x3c83dad6 _pthread_workq_return + 14
2 libsystem_c.dylib 0x3c83d7f2 _pthread_wqthread + 362
3 libsystem_c.dylib 0x3c83d680 start_wqthread + 4
Thread 1 crashed with ARM Thread State (32-bit):
r0: 0x00000004 r1: 0x00000000 r2: 0x00000000 r3: 0x0042c714
r4: 0x00000001 r5: 0x00000000 r6: 0x0042c744 r7: 0x0042c764
r8: 0x00000000 r9: 0x0042c6c8 r10: 0x3e3a2188 r11: 0x00000002
ip: 0x00000171 sp: 0x0042c6d0 lr: 0x3c81ad27 pc: 0x3c8df5d0
cpsr: 0x60000010
I would be really happy if anybody could explain me what this crash log could relate to and how I could solve it. Many many thanks to all those who are willing to help others.
Seems to me that it's dangling pointer, and you're sending message to it.
As MikeD said, use breakpoint on exception if it can help. But it's not 100% reliable since you get a SIGSEGV and not a SIGABRT. And the exception throw is not really the cause of the crash, just a border effect.
Edit
Ok: In your log crash, it says that libsystem_kernel.dylib has crashed in a kevent call. That won't help you since this is private and opaque, and you can be 100% sure this lib do its job well. This can appears because you have used (unintentionally) a space memory where you should not write into. Like with a dangling pointer. Let's say you have allocated memory to 0x2000 and you have a pointer pointing to this memory, if you freed the memory but still using this pointer to this address, if someone else (like libsystem_kernel) use it, and you change some data in the same time (because of your dangling pointer). Then the other side will use data corrupted, and some random behavior will occur. That's why if you analyze literally your crash log, you'll do wrong statement. Because kevent from libSystem is stable.
By the way you have thread 1 who crashed, but look into thread 0, it was trying to raise an exception too, but it didn't get time to do it. This can occur because of data corrupted too.
That's why I recommend you to make another crash, and compare it to this one. If the crash log are the same, then i was totally wrong. If the crash log are different, this is a dangling pointer.
one of my app user is getting a wearied crash and he send me the report can any one help me in finding the error. The app is already in use so needed to fix it soon.
He said that he is getting the crash when he is navigating in a particular parten. its not happening when in general but if we go in a particular manner the its crashing.
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x65436572
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x3388f5b6 objc_msgSend + 22
1 UIKit 0x3a380ecc __53-[UITableView _configureCellForDisplay:forIndexPath:]_block_invoke_0 + 220
2 UIKit 0x3a1d209e +[UIView(Animation) _performWithoutAnimation:] + 70
3 UIKit 0x3a1d2050 -[UITableView _configureCellForDisplay:forIndexPath:] + 96
4 UIKit 0x3a1cf558 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 432
5 UIKit 0x3a1b4306 -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 1306
6 UIKit 0x3a1cb7c2 -[UITableView layoutSubviews] + 202
7 UIKit 0x3a1877fe -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 254
8 QuartzCore 0x397b2d5e -[CALayer layoutSublayers] + 210
9 QuartzCore 0x397b28fc CA::Layer::layout_if_needed(CA::Transaction*) + 456
10 QuartzCore 0x397b3830 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 12
11 QuartzCore 0x397b3216 CA::Context::commit_transaction(CA::Transaction*) + 234
12 QuartzCore 0x397b3024 CA::Transaction::commit() + 312
13 UIKit 0x3a18d8e6 _afterCACommitHandler + 122
14 CoreFoundation 0x329ab6ca __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 18
15 CoreFoundation 0x329a99bc __CFRunLoopDoObservers + 272
16 CoreFoundation 0x329a9d12 __CFRunLoopRun + 738
17 CoreFoundation 0x3291ceb8 CFRunLoopRunSpecific + 352
18 CoreFoundation 0x3291cd44 CFRunLoopRunInMode + 100
19 GraphicsServices 0x3a71a2e6 GSEventRunModal + 70
20 UIKit 0x3a1d82f4 UIApplicationMain + 1116
21 APP 0x00103f64 main (main.m:15)
22 APP 0x000fe88c start + 36
Thread 1:
0 libsystem_kernel.dylib 0x31bc4d98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x35004cf6 _pthread_workq_return + 14
2 libsystem_c.dylib 0x35004a12 _pthread_wqthread + 362
3 libsystem_c.dylib 0x350048a0 start_wqthread + 4
Thread 2 name: Dispatch queue: com.apple.libdispatch-manager
Thread 2:
0 libsystem_kernel.dylib 0x31bb4648 kevent64 + 24
1 libdispatch.dylib 0x34fd54ec _dispatch_mgr_invoke + 792
2 libdispatch.dylib 0x34fc7df4 _dispatch_mgr_thread$VARIANT$up + 32
Thread 3:
0 libsystem_kernel.dylib 0x31bc4d98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x35004cf6 _pthread_workq_return + 14
2 libsystem_c.dylib 0x35004a12 _pthread_wqthread + 362
3 libsystem_c.dylib 0x350048a0 start_wqthread + 4
Thread 4 name: WebThread
Thread 4:
0 libsystem_kernel.dylib 0x31bb3eb4 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x31bb4048 mach_msg + 36
2 CoreFoundation 0x329ab040 __CFRunLoopServiceMachPort + 124
3 CoreFoundation 0x329a9d9e __CFRunLoopRun + 878
4 CoreFoundation 0x3291ceb8 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x3291cd44 CFRunLoopRunInMode + 100
6 WebCore 0x36c78a40 _ZL12RunWebThreadPv + 440
7 libsystem_c.dylib 0x3500f30e _pthread_start + 306
8 libsystem_c.dylib 0x3500f1d4 thread_start + 4
Thread 5:
0 libsystem_kernel.dylib 0x31bb3eb4 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x31bb4048 mach_msg + 36
2 CoreFoundation 0x329ab040 __CFRunLoopServiceMachPort + 124
3 CoreFoundation 0x329a9d9e __CFRunLoopRun + 878
4 CoreFoundation 0x3291ceb8 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x3291cd44 CFRunLoopRunInMode + 100
6 Foundation 0x3451378a -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 250
7 Foundation 0x345b7058 -[NSRunLoop(NSRunLoop) run] + 76
8 APP 0x0013ee96 +[AFURLConnectionOperation networkRequestThreadEntryPoint:] (AFURLConnectionOperation.m:127)
9 Foundation 0x345c0678 __NSThread__main__ + 968
10 libsystem_c.dylib 0x3500f30e _pthread_start + 306
11 libsystem_c.dylib 0x3500f1d4 thread_start + 4
Thread 6 name: com.apple.NSURLConnectionLoader
Thread 6:
0 libsystem_kernel.dylib 0x31bb3eb4 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x31bb4048 mach_msg + 36
2 CoreFoundation 0x329ab040 __CFRunLoopServiceMachPort + 124
3 CoreFoundation 0x329a9d9e __CFRunLoopRun + 878
4 CoreFoundation 0x3291ceb8 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x3291cd44 CFRunLoopRunInMode + 100
6 Foundation 0x3453cbc8 +[NSURLConnection(Loader) _resourceLoadLoop:] + 304
7 Foundation 0x345c0678 __NSThread__main__ + 968
8 libsystem_c.dylib 0x3500f30e _pthread_start + 306
9 libsystem_c.dylib 0x3500f1d4 thread_start + 4
Thread 7 name: com.apple.CFSocket.private
Thread 7:
0 libsystem_kernel.dylib 0x31bc4594 __select + 20
1 CoreFoundation 0x329af1f2 __CFSocketManager + 674
2 libsystem_c.dylib 0x3500f30e _pthread_start + 306
3 libsystem_c.dylib 0x3500f1d4 thread_start + 4
Thread 8:
0 libsystem_kernel.dylib 0x31bc4d98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x35004cf6 _pthread_workq_return + 14
2 libsystem_c.dylib 0x35004a12 _pthread_wqthread + 362
3 libsystem_c.dylib 0x350048a0 start_wqthread + 4
Thread 9:
0 libsystem_kernel.dylib 0x31bc4d98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x35004cf6 _pthread_workq_return + 14
2 libsystem_c.dylib 0x35004a12 _pthread_wqthread + 362
3 libsystem_c.dylib 0x350048a0 start_wqthread + 4
Thread 10:
0 libsystem_kernel.dylib 0x31bc4d98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x35004cf6 _pthread_workq_return + 14
2 libsystem_c.dylib 0x35004a12 _pthread_wqthread + 362
3 libsystem_c.dylib 0x350048a0 start_wqthread + 4
Thread 0 crashed with ARM Thread State (32-bit):
r0: 0x2fd029f0 r1: 0x3a60c4ec r2: 0x00000000 r3: 0x6543657a
r4: 0x3a60dbc7 r5: 0x00000001 r6: 0x3a60109d r7: 0x2fd029b0
r8: 0x00000000 r9: 0x0e98313b r10: 0x000002f4 r11: 0x2fd029d0
ip: 0x3c399d64 sp: 0x2fd02908 lr: 0x3a380ed1 pc: 0x3388f5b6
cpsr: 0x00000030
it seems you are using multiThreading for network operations.
in case you calling your thread from UIViewContoller please look at the Deallocation problem:
deallocation problem
search for the paragraph deallocation problem.
thats happens when calling threads from UIViewControoler and navigating before thread finish works.
look at the link for full description of the problem.
Apple rejected our iphone app, showing that it crashed on iPad. We could not reproduce the crash on 3 different iPads and asked them to confirm. Apple came back saying that they produced the crash on iPhone 4 (although the log shows iPhone 3). We can not reproduce it...
They produce the crash by: Launch app. Select Let me look around
first. App crashes.
The log they sent us back seems to not show any of the apps own methods called:
ncident Identifier: 8B5E90DE-99FD-4279-B634-2C777209F2B3
CrashReporter Key: 6e9ccd0fcdc29915ebe22fb7376bd343cdcc252a
Hardware Model: iPhone3,1
Process: Snug [297]
Path: /var/mobile/Applications/DB3EFF00-7E5E-492A-9108-1341B6371B0D/Snug.app/Snug
Identifier: Snug
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2012-09-09 13:00:32.642 -0700
OS Version: iPhone OS 5.1.1 (9B206)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 6
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 libsystem_kernel.dylib 0x319e7660 __semwait_signal_nocancel + 24
1 libsystem_c.dylib 0x3410b4da nanosleep$NOCANCEL + 118
2 libsystem_c.dylib 0x340dd3a0 usleep$NOCANCEL + 44
3 libsystem_c.dylib 0x340dd2b6 abort + 118
4 Snug 0x001f8760 uncaught_exception_handler + 12
5 CoreFoundation 0x37830950 __handleUncaughtException + 68
6 libobjc.A.dylib 0x3553533e _objc_terminate + 122
7 libc++abi.dylib 0x36f683be safe_handler_caller(void (*)()) + 70
8 libc++abi.dylib 0x36f6844a std::terminate() + 14
9 libc++abi.dylib 0x36f6981e __cxa_rethrow + 82
10 libobjc.A.dylib 0x355352a2 objc_exception_rethrow + 6
11 CoreFoundation 0x37786506 CFRunLoopRunSpecific + 398
12 CoreFoundation 0x37786366 CFRunLoopRunInMode + 98
13 GraphicsServices 0x33f45432 GSEventRunModal + 130
14 UIKit 0x31532cce UIApplicationMain + 1074
15 Snug 0x000f590c main (main.m:16)
16 Snug 0x000f58c0 start + 32
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x319d73a8 kevent + 24
1 libdispatch.dylib 0x3095cea4 _dispatch_mgr_invoke + 708
2 libdispatch.dylib 0x3095cbc2 _dispatch_mgr_thread + 30
Thread 2:
0 libsystem_kernel.dylib 0x319e7cd4 __workq_kernreturn + 8
1 libsystem_c.dylib 0x3409ff36 _pthread_wqthread + 610
2 libsystem_c.dylib 0x3409fcc8 start_wqthread + 0
Thread 3:
0 libsystem_kernel.dylib 0x319e7cd4 __workq_kernreturn + 8
1 libsystem_c.dylib 0x3409ff36 _pthread_wqthread + 610
2 libsystem_c.dylib 0x3409fcc8 start_wqthread + 0
Thread 4 name: WebThread
Thread 4:
0 libsystem_kernel.dylib 0x319d7004 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x319d71fa mach_msg + 50
2 CoreFoundation 0x378043ec __CFRunLoopServiceMachPort + 120
3 CoreFoundation 0x37803124 __CFRunLoopRun + 876
4 CoreFoundation 0x3778649e CFRunLoopRunSpecific + 294
5 CoreFoundation 0x37786366 CFRunLoopRunInMode + 98
6 WebCore 0x3312fc9c RunWebThread(void*) + 396
7 libsystem_c.dylib 0x340a572e _pthread_start + 314
8 libsystem_c.dylib 0x340a55e8 thread_start + 0
Thread 5 name: com.apple.NSURLConnectionLoader
Thread 5:
0 libsystem_kernel.dylib 0x319d7004 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x319d71fa mach_msg + 50
2 CoreFoundation 0x378043ec __CFRunLoopServiceMachPort + 120
3 CoreFoundation 0x37803124 __CFRunLoopRun + 876
4 CoreFoundation 0x3778649e CFRunLoopRunSpecific + 294
5 CoreFoundation 0x37786366 CFRunLoopRunInMode + 98
6 Foundation 0x38016bb2 +[NSURLConnection(Loader) _resourceLoadLoop:] + 302
7 Foundation 0x38016a7a -[NSThread main] + 66
8 Foundation 0x380aa58a __NSThread__main__ + 1042
9 libsystem_c.dylib 0x340a572e _pthread_start + 314
10 libsystem_c.dylib 0x340a55e8 thread_start + 0
Thread 6 Crashed:
0 libsystem_kernel.dylib 0x319e7cd4 __workq_kernreturn + 8
1 libsystem_c.dylib 0x3409ff36 _pthread_wqthread + 610
2 libsystem_c.dylib 0x3409fcc8 start_wqthread + 0
Thread 7:
0 libsystem_kernel.dylib 0x319e7cd4 __workq_kernreturn + 8
1 libsystem_c.dylib 0x3409ff36 _pthread_wqthread + 610
2 libsystem_c.dylib 0x3409fcc8 start_wqthread + 0
Thread 8:
0 libsystem_kernel.dylib 0x319e7cd4 __workq_kernreturn + 8
1 libsystem_c.dylib 0x3409ff36 _pthread_wqthread + 610
2 libsystem_c.dylib 0x3409fcc8 start_wqthread + 0
Thread 9 name: com.apple.CFSocket.private
Thread 9:
0 libsystem_kernel.dylib 0x319e7570 __select + 20
1 CoreFoundation 0x3780863a __CFSocketManager + 726
2 libsystem_c.dylib 0x340a572e _pthread_start + 314
3 libsystem_c.dylib 0x340a55e8 thread_start + 0
Thread 6 crashed with ARM Thread State:
r0: 0x00000004 r1: 0x00000000 r2: 0x00000000 r3: 0x00000000
r4: 0x0c8cc800 r5: 0x0036a08c r6: 0x04339000 r7: 0x04338fe0
r8: 0x3f29fd30 r9: 0x00000000 r10: 0x3f29fd50 r11: 0x00000000
ip: 0x00000170 sp: 0x04338fc0 lr: 0x3409ff3d pc: 0x319e7cd4
cpsr: 0x40000010
Can anyone enlighten us with this crash report?
UPDATE:
We nagged the app review team to send us the console trace, they did. In the trace it was evident that a call is being made to a String category method that does not exists.
The fault was that the particular category implementation file was not added to our release target. So everything worked perfectly but when the app was archived an implementation file was missing.
Unfortunately this log doesn't look like it'll be too useful - it just shows the main thread handling an exception that's being re-thrown from another thread; that thread has gone off to do something else at the time of the log.
You mention your suspicion about the RestKit loop and the possibility NSOperation is throwing the exception. That's possible and worth putting a check in (and crossing your fingers that it doesn't break something else...), but it's probably time to beg the app review team to give you better steps to reproduce. See if you can pin down what you all are doing differently. I wish I had a better answer for you, but I think exploring all you can about what you're doing in the background while in this part of the app and trying to figure out the missing steps to reproduce is going to be your best bet. Good luck!
The crash happened in Thread 0 at the top most Snug line 4
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 libsystem_kernel.dylib 0x319e7660 __semwait_signal_nocancel + 24
1 libsystem_c.dylib 0x3410b4da nanosleep$NOCANCEL + 118
2 libsystem_c.dylib 0x340dd3a0 usleep$NOCANCEL + 44
3 libsystem_c.dylib 0x340dd2b6 abort + 118
4 Snug 0x001f8760 uncaught_exception_handler + 12
5 CoreFoundation 0x37830950 __handleUncaughtException + 68
6 libobjc.A.dylib 0x3553533e _objc_terminate + 122
7 libc++abi.dylib 0x36f683be safe_handler_caller(void (*)()) + 70
8 libc++abi.dylib 0x36f6844a std::terminate() + 14
9 libc++abi.dylib 0x36f6981e __cxa_rethrow + 82
10 libobjc.A.dylib 0x355352a2 objc_exception_rethrow + 6
11 CoreFoundation 0x37786506 CFRunLoopRunSpecific + 398
12 CoreFoundation 0x37786366 CFRunLoopRunInMode + 98
13 GraphicsServices 0x33f45432 GSEventRunModal + 130
14 UIKit 0x31532cce UIApplicationMain + 1074
15 Snug 0x000f590c main (main.m:16)
16 Snug 0x000f58c0 start + 32
There the app caused an exception which was not caught.
To symbolicate the report just drag it into xCode - you need to have the dSYM file for the reviewed version. Then xCode will show you the exact line where the problem occured. To get the dSym you need to "build and archive".
Also since the crash code is
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
the reason for the crash is a memory access problem. These kind of crash reports are generated in many cases where one tries to instert a nil object into an array or dictionary. (since the crash is in the main thread and not in Thread 6 as reported)
In your case I do not see any obvious insert, however I would check the logic starting in line 16 of your main file and all the subsequent. I would assume you are accessing an object which is not existent anymore at the time of this invokation.
You can analyze the crash report using the below
Steps to analyze crash report from apple:
Copy the release .app file which was pushed to the appstore, the .dSYM file that was created at the time of release and the crash report receive from APPLE into a FOLDER.
OPEN terminal application and go to the folder created above (using CD command)
atos -arch armv7 -o YOURAPP.app/YOURAPP MEMORY_LOCATION_OF_CRASH. The memory location should be the one at which the app crashed as per the report.
Ex: atos -arch armv7 -o 'app name.app'/'app name' 0x0003b508
This would show you the exact line, method name which resulted in crash.
Ex: [classname functionName:]; -510
Symbolicating IPA
if we use IPA for symbolicating - just rename the extention .ipa with .zip , extract it then we can get a Payload Folder which contain app. In this case we don't need .dSYM file.
Link for this Symbolicating iPhone App Crash Reports
I am having a big problem figuring out where my app crash is being caused, and I'm not sure how to interpret the crash report.
The crash clearly occurs in Thread 0, but at what step might it actually be crashing in? I certainly am not manipulating CALayers in my code at all. In anyone experience, does this happen for any particular reason?
Incident Identifier: 23D06670-4C44-49F4-A0CB-01CF95D558D2
CrashReporter Key: 1d7775167d5336b2369c148ce37405638a6abe74
Hardware Model: iPhone3,1
Process: CrazyTimes [3169]
Path: /var/mobile/Applications/41DF0A05-710D-48BB-A468-73B7B224F5A3/CrazyTimes.app/CrazyTimes
Identifier: CrazyTimes
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2012-02-09 18:22:36.422 -0500
OS Version: iPhone OS 5.0 (9A334)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00600ad0
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x383a7fca objc_msgSend + 30
1 CrazyTimes 0x00114460 0x1000 + 1127520
2 CrazyTimes 0x000c2f10 0x1000 + 794384
3 UIKit 0x331b0f72 -[UIView(CALayerDelegate) drawLayer:inContext:] + 270
4 QuartzCore 0x328c0e16 -[CALayer drawInContext:] + 110
5 QuartzCore 0x328c0418 CABackingStoreUpdate_ + 1776
6 QuartzCore 0x328bfc16 CA::Layer::display_() + 966
7 QuartzCore 0x328bf832 CA::Layer::display() + 122
8 QuartzCore 0x328bf774 CA::Layer::display_if_needed(CA::Transaction*) + 168
9 QuartzCore 0x328bf11c CA::Context::commit_transaction(CA::Transaction*) + 228
10 QuartzCore 0x328bee50 CA::Transaction::commit() + 308
11 QuartzCore 0x328b6d7e CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 50
12 CoreFoundation 0x311dcb44 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 12
13 CoreFoundation 0x311dad80 __CFRunLoopDoObservers + 252
14 CoreFoundation 0x311db0da __CFRunLoopRun + 754
15 CoreFoundation 0x3115e4d6 CFRunLoopRunSpecific + 294
16 CoreFoundation 0x3115e39e CFRunLoopRunInMode + 98
17 GraphicsServices 0x33d8cfe6 GSEventRunModal + 150
18 UIKit 0x331d073c UIApplicationMain + 1084
19 CrazyTimes 0x00004084 0x1000 + 12420
20 CrazyTimes 0x00003af8 0x1000 + 11000
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x324dd3b4 kevent + 24
1 libdispatch.dylib 0x32c31e78 _dispatch_mgr_invoke + 708
2 libdispatch.dylib 0x32c31b96 _dispatch_mgr_thread + 30
Thread 2 name: WebThread
Thread 2:
0 libsystem_kernel.dylib 0x324dd010 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x324dd206 mach_msg + 50
2 CoreFoundation 0x311dc41c __CFRunLoopServiceMachPort + 120
3 CoreFoundation 0x311db154 __CFRunLoopRun + 876
4 CoreFoundation 0x3115e4d6 CFRunLoopRunSpecific + 294
5 CoreFoundation 0x3115e39e CFRunLoopRunInMode + 98
6 WebCore 0x379f2128 _ZL12RunWebThreadPv + 396
7 libsystem_c.dylib 0x369a5c16 _pthread_start + 314
8 libsystem_c.dylib 0x369a5ad0 thread_start + 0
Thread 3:
0 libsystem_kernel.dylib 0x324edcd4 __workq_kernreturn + 8
1 libsystem_c.dylib 0x369a030a _pthread_wqthread + 610
2 libsystem_c.dylib 0x369a009c start_wqthread + 0
Thread 4 name: com.apple.NSURLConnectionLoader
Thread 4:
0 libsystem_kernel.dylib 0x324dd010 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x324dd206 mach_msg + 50
2 CoreFoundation 0x311dc41c __CFRunLoopServiceMachPort + 120
3 CoreFoundation 0x311db154 __CFRunLoopRun + 876
4 CoreFoundation 0x3115e4d6 CFRunLoopRunSpecific + 294
5 CoreFoundation 0x3115e39e CFRunLoopRunInMode + 98
6 Foundation 0x3821abc2 +[NSURLConnection(Loader) _resourceLoadLoop:] + 302
7 Foundation 0x3821aa8a -[NSThread main] + 66
8 Foundation 0x382ae59a __NSThread__main__ + 1042
9 libsystem_c.dylib 0x369a5c16 _pthread_start + 314
10 libsystem_c.dylib 0x369a5ad0 thread_start + 0
Thread 5 name: com.apple.CFSocket.private
Thread 5:
0 libsystem_kernel.dylib 0x324ed570 __select + 20
1 CoreFoundation 0x311e066a __CFSocketManager + 726
2 libsystem_c.dylib 0x369a5c16 _pthread_start + 314
3 libsystem_c.dylib 0x369a5ad0 thread_start + 0
Thread 6:
0 libsystem_kernel.dylib 0x324edcd4 __workq_kernreturn + 8
1 libsystem_c.dylib 0x369a030a _pthread_wqthread + 610
2 libsystem_c.dylib 0x369a009c start_wqthread + 0
Thread 7 name: WebCore: CFNetwork Loader
Thread 7:
0 libsystem_kernel.dylib 0x324dd010 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x324dd206 mach_msg + 50
2 CoreFoundation 0x311dc41c __CFRunLoopServiceMachPort + 120
3 CoreFoundation 0x311db154 __CFRunLoopRun + 876
4 CoreFoundation 0x3115e4d6 CFRunLoopRunSpecific + 294
5 CoreFoundation 0x3115e39e CFRunLoopRunInMode + 98
6 WebCore 0x37a1b69e _ZN7WebCoreL15runLoaderThreadEPv + 122
7 libsystem_c.dylib 0x369a5c16 _pthread_start + 314
8 libsystem_c.dylib 0x369a5ad0 thread_start + 0
Thread 8 name: WebCore: LocalStorage
Thread 8:
0 libsystem_kernel.dylib 0x324ed068 __psynch_cvwait + 24
1 libsystem_c.dylib 0x369a5f2e _pthread_cond_wait + 634
2 libsystem_c.dylib 0x369a5caa pthread_cond_wait + 34
3 JavaScriptCore 0x3768940e WTF::ThreadCondition::timedWait(WTF::Mutex&, double) + 54
4 WebCore 0x37b51494 WTF::PassOwnPtr<WebCore::LocalStorageTask> WTF::MessageQueue<WebCore::LocalStorageTask>::waitForMessageFilteredWithTimeout<bool ()(WebCore::LocalStorageTask*)>(WTF::MessageQueueWaitResult&, bool (&)(WebCore::LocalStorageTask*), double) + 52
5 WebCore 0x37b5144a WebCore::LocalStorageThread::threadEntryPointCallback(void*) + 106
6 libsystem_c.dylib 0x369a5c16 _pthread_start + 314
7 libsystem_c.dylib 0x369a5ad0 thread_start + 0
Thread 9:
0 libsystem_kernel.dylib 0x324dd010 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x324dd206 mach_msg + 50
2 CoreFoundation 0x311dc41c __CFRunLoopServiceMachPort + 120
3 CoreFoundation 0x311db154 __CFRunLoopRun + 876
4 CoreFoundation 0x3115e4d6 CFRunLoopRunSpecific + 294
5 CoreFoundation 0x311db474 CFRunLoopRun + 92
6 CrazyTimes 0x00039ee4 0x1000 + 233188
7 Foundation 0x3821aa8a -[NSThread main] + 66
8 Foundation 0x382ae59a __NSThread__main__ + 1042
9 libsystem_c.dylib 0x369a5c16 _pthread_start + 314
10 libsystem_c.dylib 0x369a5ad0 thread_start + 0
Thread 10 name: com.apple.coremedia.player.async
Thread 10:
0 libsystem_kernel.dylib 0x324ed068 __psynch_cvwait + 24
1 libsystem_c.dylib 0x369a5f2e _pthread_cond_wait + 634
2 libsystem_c.dylib 0x369a5caa pthread_cond_wait + 34
3 CoreMedia 0x3255d000 FigSemaphoreWaitRelative + 212
4 MediaToolbox 0x3261afca fpa_AsyncMovieControlThread + 18
5 CoreMedia 0x3257cbc6 figThreadMain + 146
6 libsystem_c.dylib 0x369a5c16 _pthread_start + 314
7 libsystem_c.dylib 0x369a5ad0 thread_start + 0
Thread 11:
0 libsystem_kernel.dylib 0x324edcd4 __workq_kernreturn + 8
1 libsystem_c.dylib 0x369a030a _pthread_wqthread + 610
2 libsystem_c.dylib 0x369a009c start_wqthread + 0
Thread 0 crashed with ARM Thread State:
r0: 0x09b99000 r1: 0x345621e3 r2: 0x0019e7dc r3: 0x0019e910
r4: 0x0019e800 r5: 0x09b99000 r6: 0x00199f3c r7: 0x2fdfdb00
r8: 0x00196f94 r9: 0x00118870 r10: 0x00196bdc r11: 0x0019789c
ip: 0x0019e8f4 sp: 0x2fdfdae0 lr: 0x00114467 pc: 0x383a7fca
cpsr: 0x20080030
UIViews are implemented with CALayers, so if you are using UIKit, you are using layers. My guess is that an already released object is receiving messages. Maybe you released an object more times than you should. Try recompiling with NSZombieEnabled.
3 UIKit 0x331b0f72 -[UIView(CALayerDelegate) drawLayer:inContext:] + 270
By any chance, did you release an objectA which is a delegate to objectB without removing the delegate assignment first, i.e. objectB.delegate = nil; [objectA release];?
Im somewhat stuck, and need to have this resolved because one of my apps is exhibiting random crashes which cannot always be reproduced. This is one of the crash logs:
Incident Identifier: 59865612-9F00-44EA-9474-2BF607AD662E
CrashReporter Key: bea17b7f4237e78a13ce60449d694621d0f16a44
Hardware Model: iPhone2,1
Process: APPNAME [82]
Path: /var/mobile/Applications/ACE9A1A2-F1BE-43E0-9775-1291723D4C4A/APPNAME.app/APPNAME
Identifier: APPNAME
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2011-05-21 19:10:27.893 +0100
OS Version: iPhone OS 4.3.3 (8J2)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000009
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x33b24c98 objc_msgSend + 16
1 Foundation 0x344507b4 __NSFireTimer + 112
2 CoreFoundation 0x3039ca40 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 8
3 CoreFoundation 0x3039eec4 __CFRunLoopDoTimer + 844
4 CoreFoundation 0x3039f83e __CFRunLoopRun + 1082
5 CoreFoundation 0x3032febc CFRunLoopRunSpecific + 224
6 CoreFoundation 0x3032fdc4 CFRunLoopRunInMode + 52
7 GraphicsServices 0x3448e418 0x3448a000 + 17432
8 GraphicsServices 0x3448e4c4 0x3448a000 + 17604
9 UIKit 0x33f3cd62 -[UIApplication _run] + 398
10 UIKit 0x33f3a800 UIApplicationMain + 664
11 APPNAME 0x00002d88 0x1000 + 7560
12 APPNAME 0x00002d3c 0x1000 + 7484
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x36100fbc kevent + 24
1 libdispatch.dylib 0x33d0b032 _dispatch_mgr_invoke + 706
2 libdispatch.dylib 0x33d0c03a _dispatch_queue_invoke + 86
3 libdispatch.dylib 0x33d0b5ea _dispatch_worker_thread2 + 186
4 libsystem_c.dylib 0x33e0a58a _pthread_wqthread + 258
5 libsystem_c.dylib 0x33e0abbc start_wqthread + 0
Thread 2 name: WebThread
Thread 2:
0 libsystem_kernel.dylib 0x360fdc00 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x360fd758 mach_msg + 44
2 CoreFoundation 0x3039d2b8 __CFRunLoopServiceMachPort + 88
3 CoreFoundation 0x3039f562 __CFRunLoopRun + 350
4 CoreFoundation 0x3032febc CFRunLoopRunSpecific + 224
5 CoreFoundation 0x3032fdc4 CFRunLoopRunInMode + 52
6 WebCore 0x34c2627e RunWebThread(void*) + 382
7 libsystem_c.dylib 0x33e0930a _pthread_start + 242
8 libsystem_c.dylib 0x33e0abb4 thread_start + 0
Thread 3:
0 libsystem_kernel.dylib 0x360fdc00 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x360fd758 mach_msg + 44
2 CoreFoundation 0x3039d2b8 __CFRunLoopServiceMachPort + 88
3 CoreFoundation 0x3039f562 __CFRunLoopRun + 350
4 CoreFoundation 0x3032febc CFRunLoopRunSpecific + 224
5 CoreFoundation 0x3032fdc4 CFRunLoopRunInMode + 52
6 Foundation 0x343ea7f6 +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:] + 206
7 Foundation 0x343dd382 -[NSThread main] + 38
8 Foundation 0x3444f5c6 __NSThread__main__ + 966
9 libsystem_c.dylib 0x33e0930a _pthread_start + 242
10 libsystem_c.dylib 0x33e0abb4 thread_start + 0
Thread 4 name: com.apple.CFSocket.private
Thread 4:
0 libsystem_kernel.dylib 0x360ffc60 __select + 20
1 CoreFoundation 0x303a28f2 __CFSocketManager + 582
2 libsystem_c.dylib 0x33e0930a _pthread_start + 242
3 libsystem_c.dylib 0x33e0abb4 thread_start + 0
Thread 5:
0 libsystem_kernel.dylib 0x361003ec __workq_kernreturn + 8
1 libsystem_c.dylib 0x33e0a6d8 _pthread_wqthread + 592
2 libsystem_c.dylib 0x33e0abbc start_wqthread + 0
Thread 6:
0 libsystem_kernel.dylib 0x361003ec __workq_kernreturn + 8
1 libsystem_c.dylib 0x33e0a6d8 _pthread_wqthread + 592
2 libsystem_c.dylib 0x33e0abbc start_wqthread + 0
Thread 7:
0 libsystem_kernel.dylib 0x361003ec __workq_kernreturn + 8
1 libsystem_c.dylib 0x33e0a6d8 _pthread_wqthread + 592
2 libsystem_c.dylib 0x33e0abbc start_wqthread + 0
Thread 8:
0 libsystem_kernel.dylib 0x361003ec __workq_kernreturn + 8
1 libsystem_c.dylib 0x33e0a6d8 _pthread_wqthread + 592
2 libsystem_c.dylib 0x33e0abbc start_wqthread + 0
Thread 0 crashed with ARM Thread State:
r0: 0x04246810 r1: 0x33738814 r2: 0x042b3704 r3: 0x00000000
r4: 0x00000001 r5: 0x00000001 r6: 0x00259330 r7: 0x2fdfeb30
r8: 0x002593d0 r9: 0x00000000 r10: 0x04241720 r11: 0x00000000
ip: 0x3fa3f4e8 sp: 0x2fdfea60 lr: 0x349077bb pc: 0x33dfcc98
cpsr: 0x280f0030
Can someone offer a suggestion as to what might be the cause ?
Thanks!
It looks like you have a timer firing and trying to send a message to an object that has been dealloc'ed.
Keyline here is: Exception Type: EXC_BAD_ACCESS (SIGBUS)
It occurs, when you are trying to access an object that has been released earlier. Since, you are trying to access an object in a timer's callback, what is possibly happening is that while the timer responds for an object, the object in question has been released.
You can track the object by enabling the NSZombie environment variable.
When you create a NSTimer it is critical that you hold on to the ref and then invalidate it if the object to be called goes away. Like so:
[self.bugZapTimer invalidate];
self.bugZapTimer = [NSTimer timerWithTimeInterval: 0.1
target: self
selector: #selector(bugZapTimer:)
userInfo: NULL
repeats: FALSE];
[[NSRunLoop currentRunLoop] addTimer:self.bugZapTimer forMode: NSDefaultRunLoopMode];
Then, in your dealloc method you must do:
[self.bugZapTimer invalidate];
self.bugZapTimer = nil;