Reputation: 26385
I'm trying to debug an application that download a lot of resources from internet. The issue is that sometimes while downloading the app crashes (not in the same place or for the same resource).
The memory seems ok, no memory warnings, no leaks, no zombies, the dirty size stay around 10M§B +o- 2MB the resident 50MB.
The other weird things is that the error is still never happened on the simulator bu just on the device.
The crash log identifies a crash in another thread (num3) with EXC_BAD_ACCES(something gone) on an Apple lib. I can't understand if it's an application error or an API error.
Incident Identifier: 9138742F-0160-4220-8E62-000001650CF4 CrashReporter Key: 6f0ba5a6bbc182f6798918f01ccd6bac4f8e4713 Hardware Model: iPad1,1 Process: XXX-Upgraded [949] Path:
/var/mobile/Applications/C98657F3-B7E6-4542-B0DA-70D8239E5210/XXX-Upgraded.app/XXX-Upgraded Identifier: XXX-Upgraded Version: ??? (???) Code Type:
ARM (Native) Parent Process: launchd 1Date/Time: 2011-11-18 11:13:25.994 +0100 OS Version: iPhone OS 5.0.1 (9A405) Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0xf006191c Crashed Thread: 3
Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0: 0
libsystem_kernel.dylib 0x360ad010 0x360ac000 + 4112 1
libsystem_kernel.dylib 0x360ad206 0x360ac000 + 4614 2
CoreFoundation 0x33ac441c 0x33a37000 + 578588 3
CoreFoundation 0x33ac311a 0x33a37000 + 573722 4
CoreFoundation 0x33a464d6 0x33a37000 + 62678 5
CoreFoundation 0x33a4639e 0x33a37000 + 62366 6
GraphicsServices 0x35686fc6 0x35683000 + 16326 7 UIKit 0x34b8b73c 0x34b5a000 + 202556 8 XXX-Upgraded
0x000028a8 main (main.m:15) 9 XXX-Upgraded
0x00002860 start + 32Thread 1 name: Dispatch queue: com.apple.libdispatch-manager Thread 1: 0 libsystem_kernel.dylib 0x360ad3b4 0x360ac000 + 5044 1
libdispatch.dylib 0x36dd3e78 0x36dc7000 + 52856 2
libdispatch.dylib 0x36dd3b96 0x36dc7000 + 52118Thread 2 name: WebThread Thread 2: 0 libsystem_kernel.dylib
0x360ad010 0x360ac000 + 4112 1 libsystem_kernel.dylib
0x360ad206 0x360ac000 + 4614 2 CoreFoundation
0x33ac441c 0x33a37000 + 578588 3 CoreFoundation
0x33ac3154 0x33a37000 + 573780 4 CoreFoundation
0x33a464d6 0x33a37000 + 62678 5 CoreFoundation
0x33a4639e 0x33a37000 + 62366 6 WebCore
0x33f02128 0x33e5a000 + 688424 7 libsystem_c.dylib
0x3492bc16 0x3491c000 + 64534 8 libsystem_c.dylib
0x3492bad0 0x3491c000 + 64208Thread 3 name: com.apple.NSURLConnectionLoader Thread 3 Crashed: 0
libobjc.A.dylib 0x35206fbc 0x35203000 + 16316 1
CoreFoundation 0x33a73d16 0x33a37000 + 249110 2
CoreFoundation 0x33a395bc 0x33a37000 + 9660 3
CFNetwork 0x32e56fd8 0x32dc7000 + 589784 4
CFNetwork 0x32e57cee 0x32dc7000 + 593134 5
CFNetwork 0x32e56940 0x32dc7000 + 588096 6
CoreFoundation 0x33a8555c 0x33a37000 + 320860 7
CoreFoundation 0x33a857a4 0x33a37000 + 321444 8
CoreFoundation 0x33ac4afc 0x33a37000 + 580348 9
CoreFoundation 0x33ac42c8 0x33a37000 + 578248 10 CoreFoundation 0x33ac306e 0x33a37000 + 573550 11 CoreFoundation 0x33a464d6 0x33a37000 + 62678 12 CoreFoundation 0x33a4639e 0x33a37000 + 62366 13 Foundation 0x3152abc2 0x3151a000 + 68546 14 Foundation 0x3152aa8a 0x3151a000 + 68234 15 Foundation 0x315be59a 0x3151a000 + 673178 16 libsystem_c.dylib 0x3492bc16 0x3491c000 + 64534 17 libsystem_c.dylib 0x3492bad0 0x3491c000 + 64208Thread 4 name: com.apple.CFSocket.private Thread 4: 0
libsystem_kernel.dylib 0x360bd570 0x360ac000 + 71024 1
CoreFoundation 0x33ac866a 0x33a37000 + 595562 2
libsystem_c.dylib 0x3492bc16 0x3491c000 + 64534 3
libsystem_c.dylib 0x3492bad0 0x3491c000 + 64208Thread 5: 0 libsystem_kernel.dylib 0x360bdcd4 0x360ac000 + 72916 1 libsystem_c.dylib 0x3492630a 0x3491c000 + 41738 2 libsystem_c.dylib 0x3492609c 0x3491c000 + 41116
Thread 6: 0 libsystem_kernel.dylib 0x360bdcd4 0x360ac000 + 72916 1 libsystem_c.dylib 0x3492630a 0x3491c000 + 41738 2 libsystem_c.dylib 0x3492609c 0x3491c000 + 41116
Thread 7: 0 libsystem_kernel.dylib 0x360bdcd4 0x360ac000 + 72916 1 libsystem_c.dylib 0x3492630a 0x3491c000 + 41738 2 libsystem_c.dylib 0x3492609c 0x3491c000 + 41116
Thread 3 crashed with ARM Thread State: r0: 0x006eaf90 r1: 0x328c119e r2: 0xf0061914 r3: 0x3eeb09a8 r4: 0xf0061914 r5: 0x006eaf94 r6: 0x020014c0 r7: 0x0343b2b0 r8: 0x3eecc690 r9: 0x0ca30467 r10: 0x00000014 r11: 0x00000080 ip: 0x3eea6814 sp: 0x0343b2a0 lr: 0x33a73d1d pc: 0x35206fbc cpsr: 0x20000030
[Update]
Finally I was cable to catch the error. It seems to be an overreleased chunk of data right at the end of connection:didReceiveData:. Actually to simplify debugging I've just left one line of code that appends data using output stream. I can't understand where I'm over-releasing.
Instruments shows pretty weird stuffs:
-first the zombie seems to be created inside some Apple API calling
-second, if you take a look at the image of the stack trace you can see that there is a CFRetain that doesn't increment the reference count of the object, thus unbalancing the other operations
Can someone help me out?
Thanks,
Andrea
Upvotes: 0
Views: 671
Reputation: 26385
OK, after a lot of test a (DST request never taken in charge by Apple, NOT TRUE ANYMORE), headache, hysteria etc. It's turning out to be as a kind of false positive. If I test using leaks, allocation, zombie, the usual console debugger happens. If I run the application alone just on device (without connecting it) everything seems to run fine.
The DTS helped me out to find the bug, the issue refers probably to two bugs, one located in instruments and one CF. The most important thing is that those bugs affect the application only while using allocation logging, so the app could run safe as I discovered during my tests session.
Upvotes: 0