I am trying to debug the cause of my app to crash. From my trial I realized that somewhere, there were leaks and I am in the middle of figuring out. I knew it because when I tried debugging using this method here, it will crash eventually as it seems the memory leaks bulking up after some time.
To find out the caused, I have now open the NSZombieEnabled to YES on XCode 4. But I didn't see anything. So now I turn to crash log. And here it is :
Thread 7 Crashed:
0 libsystem_kernel.dylib 0x31b71a1c __pthread_kill + 8
1 libsystem_c.dylib 0x35ceb3b4 pthread_kill + 52
2 libsystem_c.dylib 0x35ce3bf8 abort + 72
3 libsystem_c.dylib 0x35d1f024 free + 104
4 ImageIO 0x32ca35f0 ImageProviderReleaseInfoCallback + 56
5 CoreGraphics 0x31a05284 image_provider_finalize + 8
6 CoreFoundation 0x35aad288 _CFRelease + 160
7 CoreFoundation 0x35aad1ae CFRelease + 82
8 CoreGraphics 0x319fe150 CGImageProviderRelease + 4
9 CoreGraphics 0x31a00bac CGImageBlockSetRelease + 44
10 CoreGraphics 0x31a00b70 img_blocks_destroy + 8
11 CoreGraphics 0x319fdaae CGSImageDataUnlock + 26
12 libRIP.A.dylib 0x309eebae ripc_ReleaseImage + 374
13 libRIP.A.dylib 0x309ecc9c ripc_DrawImage + 536
14 CoreGraphics 0x319f9284 CGContextDelegateDrawImage + 44
15 CoreGraphics 0x319f9142 CGContextDrawImage + 250
16 myapp 0x000c6a28 0x45000 + 530984
17 myapp 0x000c6d6a 0x45000 + 531818
18 myapp 0x000c681c 0x45000 + 530460
19 myapp 0x000c3526 0x45000 + 517414
20 myapp 0x000c3796 0x45000 + 518038
21 Foundation 0x33486382 -[NSThread main] + 38
22 Foundation 0x334f85c6 __NSThread__main__ + 966
23 libsystem_c.dylib 0x35ceb30a _pthread_start + 242
24 libsystem_c.dylib 0x35cecbb4 thread_start + 0
My question : is there any tips on how to read and understand this debug log? Maybe a link or book that cover how to debug all together. Thanks.
In this case,
2 libsystem_c.dylib 0x35ce3bf8 abort + 72
3 libsystem_c.dylib 0x35d1f024 free + 104
free function detected the freeing address is not in the range of heap or invalid, and then called abort function.
"Technical Note TN2239 - iOS Debugging Magic" is quite helpful document. Please take a look at "Memory Allocator" and use Malloc* environments like NSZombieEnabled. Setting breakpoint to abort function is also useful for getting the parameter for free and tracking stack.
That crash log is not symbolised, hence it not giving you line numbers and object names in your app. There is a process for adding this information to the crash log to give you a lot more information to help debug the crash.
See http://developer.apple.com/tools/xcode/symbolizingcrashdumps.html In particular the section on symbolising crash dumps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With