EXC_BAD_ACCESS (SIGSEGV) crash - iphone

How do I trace the crash ?
Process: iAddressGrabber [253]
Path: /Users/egrabber/Library/Application Support/iPhone Simulator/User/Applications/DB3B2896-258C-4EC2-A490-802B1190A675/iAddressGrabber.app/iAddressGrabber
Identifier: iAddressGrabber
Version: ??? (???)
Code Type: X86 (Native)
Parent Process: launchd [64]
Interval Since Last Report: 34544 sec
Crashes Since Last Report: 1
Per-App Interval Since Last Report: 0 sec
Per-App Crashes Since Last Report: 2
Date/Time: 2009-11-14 10:17:50.058 +0530
OS Version: Mac OS X 10.5.8 (9L30)
Report Version: 6
Anonymous UUID: 3EC1BE31-C7B9-47B9-8056-879CC319BF57
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000c0000023
Crashed Thread: 0
Application Specific Information:
iPhone Simulator 3.0 (138), iPhone OS 3.0 (7A341)
Thread 0 Crashed:
0 libobjc.A.dylib 0x910e0688 objc_msgSend + 24
1 CFNetwork 0x006b4868 URLConnectionClient::_clientDidFinishLoading(URLConnectionClient::ClientConnectionEventQueue*) + 194
2 CFNetwork 0x006b40c8 URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload(XConnectionEventInfo<XClientEvent, XClientEventParams>*, long) + 306
3 CFNetwork 0x006b4d4c URLConnectionClient::processEvents() + 100
4 CFNetwork 0x00662b29 MultiplexerSource::perform() + 183
5 CoreFoundation 0x302452c1 CFRunLoopRunSpecific + 3217
6 CoreFoundation 0x30244628 CFRunLoopRunInMode + 88
7 GraphicsServices 0x32044c31 GSEventRunModal + 217
8 GraphicsServices 0x32044cf6 GSEventRun + 115
9 UIKit 0x309021ee UIApplicationMain + 1157
10 iAddressGrabber 0x00001efc main + 102 (main.m:14)
11 iAddressGrabber 0x00001e6a start + 54
Thread 1:
0 libSystem.B.dylib 0x928da286 mach_msg_trap + 10
1 libSystem.B.dylib 0x928e1a7c mach_msg + 72
2 CoreFoundation 0x30244d62 CFRunLoopRunSpecific + 1842
3 CoreFoundation 0x30244628 CFRunLoopRunInMode + 88
4 WebCore 0x3588ea13 __ZL12RunWebThreadPv + 467
5 libSystem.B.dylib 0x9290b155 _pthread_start + 321
6 libSystem.B.dylib 0x9290b012 thread_start + 34
Thread 2:
0 libSystem.B.dylib 0x928da286 mach_msg_trap + 10
1 libSystem.B.dylib 0x928e1a7c mach_msg + 72
2 CoreFoundation 0x30244d62 CFRunLoopRunSpecific + 1842
3 CoreFoundation 0x30244628 CFRunLoopRunInMode + 88
4 Foundation 0x3056002e +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:] + 318
5 Foundation 0x3050a79d -[NSThread main] + 45
6 Foundation 0x3050a338 __NSThread__main__ + 280
7 libSystem.B.dylib 0x9290b155 _pthread_start + 321
8 libSystem.B.dylib 0x9290b012 thread_start + 34
Thread 3:
0 libSystem.B.dylib 0x929296fa select$DARWIN_EXTSN + 10
1 libSystem.B.dylib 0x9290b155 _pthread_start + 321
2 libSystem.B.dylib 0x9290b012 thread_start + 34
Thread 0 crashed with X86 Thread State (32-bit):
eax: 0x00f797f0 ebx: 0x305063d1 ecx: 0x9117c334 edx: 0xc0000003
edi: 0x00f7b3b0 esi: 0xbfffeaa4 ebp: 0xbfffea28 esp: 0xbfffe8a8
ss: 0x0000001f efl: 0x00010206 eip: 0x910e0688 cs: 0x00000017
ds: 0x0000001f es: 0x0000001f fs: 0x00000000 gs: 0x00000037
cr2: 0xc0000023

Enable NSZombie - it will tell you which de-allocated object objcMsgSend is trying to call.
See this earlier question.

The following technical note contains all the information needed to deal with such dumps:
Technical Note TN2124 - Mac OS X Debugging Magic
A little hint:
1 CFNetwork 0x006b4868 URLConnectionClient::_clientDidFinishLoading(URLConnectionClient::ClientConnectionEventQueue*) + 194
Focus on this part, the EXC_BAD_ACCESS suggests a (ab)use of invalid memory pointer.

Related

iOS Simulator crashing in Virtual Machine

I'm brand new to iOS development (and MacOS in general). While waiting for a mac to arrive I've set up a Virtual Machine running Mountain Lion to get started with developing.
When trying to run a simple Hello World application, the simulator crashes with "The simulated application quit" error message.
In the User Diagnostic Reports there is the following crash report:
Process: SpringBoard [9828]
Path: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/CoreServices/SpringBoard.app/SpringBoard
Identifier: SpringBoard
Version: 2127.141
Code Type: X86 (Native)
Parent Process: sim64 [9826]
User ID: 501
Date/Time: 2013-06-06 09:17:09.538 +0100
OS Version: Mac OS X 10.8 (12A269)
Report Version: 10
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Application Specific Information:
iPhone Simulator 369.2, iPhone OS 6.1 (iPhone/10B141)
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x94c75a6a __pthread_kill + 10
1 libsystem_c.dylib 0x930a0acf pthread_kill + 101
2 libsystem_sim_c.dylib 0x050fc57b abort + 140
3 libc++abi.dylib 0x0500ef7b abort_message + 105
4 libc++abi.dylib 0x0500ca25 default_terminate() + 34
5 libobjc.A.dylib 0x04a750c1 _objc_terminate() + 94
6 libc++abi.dylib 0x0500ca65 safe_handler_caller(void (*)()) + 13
7 libc++abi.dylib 0x0500cacd std::terminate() + 23
8 libc++abi.dylib 0x0500dbc2 __cxa_throw + 110
9 libobjc.A.dylib 0x04a74f89 objc_exception_throw + 311
10 CoreFoundation 0x048a60de -[__NSDictionaryM setObject:forKey:] + 158
11 MobileCoreServices 0x02f9aeaa -[LSApplicationWorkspace installedApplications] + 1095
12 SpringBoard 0x000e1f3d 0x1000 + 921405
13 SpringBoard 0x000e2a16 0x1000 + 924182
14 SpringBoard 0x000df5a6 0x1000 + 910758
15 SpringBoard 0x000df2d1 0x1000 + 910033
16 SpringBoard 0x000df316 0x1000 + 910102
17 SpringBoard 0x001ee6df 0x1000 + 2021087
18 SpringBoard 0x00029040 0x1000 + 163904
19 SpringBoard 0x00026232 0x1000 + 152114
20 SpringBoard 0x00023b1e 0x1000 + 142110
21 SpringBoard 0x00005479 0x1000 + 17529
22 UIKit 0x009371af -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 354
23 UIKit 0x009377a1 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1338
24 UIKit 0x0093894b -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 805
25 UIKit 0x00938086 -[UIApplication _run] + 530
26 UIKit 0x00939ffc UIApplicationMain + 1211
27 SpringBoard 0x00004641 0x1000 + 13889
28 SpringBoard 0x00003a55 0x1000 + 10837
Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0 libsystem_kernel.dylib 0x94c769ca kevent64 + 10
1 libdispatch.dylib 0x05080c2b _dispatch_mgr_invoke + 863
2 libdispatch.dylib 0x050808cc _dispatch_mgr_thread + 61
Thread 2:: Dispatch queue: com.apple.root.default-priority
0 libsystem_kernel.dylib 0x94c737d2 mach_msg_trap + 10
1 libsystem_kernel.dylib 0x94c72cb0 mach_msg + 68
2 liblaunch.dylib 0x94c5ce58 0x94c59000 + 15960
3 liblaunch.dylib 0x94c5b68e bootstrap_look_up3 + 78
4 libxpc.dylib 0x051d5de8 _xpc_connection_bootstrap_look_up_slow + 376
5 libxpc.dylib 0x051d6c36 _xpc_connection_init + 936
6 libxpc.dylib 0x051d6885 _xpc_connection_resume_init + 14
7 libdispatch.dylib 0x0508d014 _dispatch_client_callout + 14
8 libdispatch.dylib 0x0507e2e8 _dispatch_root_queue_drain + 335
9 libdispatch.dylib 0x0507e450 _dispatch_worker_thread2 + 39
10 libsystem_c.dylib 0x930a1e12 _pthread_wqthread + 441
11 libsystem_c.dylib 0x93089cca start_wqthread + 30
Thread 3:: Dispatch queue: com.apple.MobileInstallationSetDeviceCapabilities
0 libsystem_kernel.dylib 0x94c758e2 __psynch_cvwait + 10
1 libsystem_c.dylib 0x930a4220 _pthread_cond_wait + 833
2 libsystem_c.dylib 0x9312a0ad pthread_cond_wait$UNIX2003 + 71
3 MobileSystemServices 0x0527d083 MOXPCTransportReceiveMessage + 276
4 MobileInstallation 0x027aa015 perform_command + 682
5 MobileInstallation 0x027aabb8 __MobileInstallationSetDeviceCapabilities_block_invoke_057 + 97
6 libdispatch.dylib 0x0507b53f _dispatch_call_block_and_release + 15
7 libdispatch.dylib 0x0508d014 _dispatch_client_callout + 14
8 libdispatch.dylib 0x0507d418 _dispatch_queue_drain + 239
9 libdispatch.dylib 0x0507d2a6 _dispatch_queue_invoke + 59
10 libdispatch.dylib 0x0507e280 _dispatch_root_queue_drain + 231
11 libdispatch.dylib 0x0507e450 _dispatch_worker_thread2 + 39
12 libsystem_c.dylib 0x930a1e12 _pthread_wqthread + 441
13 libsystem_c.dylib 0x93089cca start_wqthread + 30
Thread 4:
0 libsystem_c.dylib 0x93089cac start_wqthread + 0
Thread 5:: WebThread
0 libsystem_kernel.dylib 0x94c737d2 mach_msg_trap + 10
1 libsystem_kernel.dylib 0x94c72cb0 mach_msg + 68
2 CoreFoundation 0x047c4a49 __CFRunLoopServiceMachPort + 185
3 CoreFoundation 0x047c98d4 __CFRunLoopRun + 1380
4 CoreFoundation 0x047c8f44 CFRunLoopRunSpecific + 276
5 CoreFoundation 0x047c8e1b CFRunLoopRunInMode + 123
6 WebCore 0x068cac50 RunWebThread(void*) + 608
7 libsystem_c.dylib 0x9309f557 _pthread_start + 344
8 libsystem_c.dylib 0x93089cee thread_start + 34
Thread 6:
0 libsystem_kernel.dylib 0x94c737d2 mach_msg_trap + 10
1 libsystem_kernel.dylib 0x94c72cb0 mach_msg + 68
2 CoreFoundation 0x047c4a49 __CFRunLoopServiceMachPort + 185
3 CoreFoundation 0x047c98d4 __CFRunLoopRun + 1380
4 CoreFoundation 0x047c8f44 CFRunLoopRunSpecific + 276
5 CoreFoundation 0x047c8e1b CFRunLoopRunInMode + 123
6 Foundation 0x0161c3ac -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 298
7 Foundation 0x0161c275 -[NSRunLoop(NSRunLoop) run] + 82
8 UIKit 0x00cb6445 -[UIStatusBarServerThread main] + 787
9 Foundation 0x01669764 __NSThread__main__ + 1304
10 libsystem_c.dylib 0x9309f557 _pthread_start + 344
11 libsystem_c.dylib 0x93089cee thread_start + 34
Thread 7:
0 libsystem_kernel.dylib 0x94c737d2 mach_msg_trap + 10
1 libsystem_kernel.dylib 0x94c72cb0 mach_msg + 68
2 CoreFoundation 0x047c4a49 __CFRunLoopServiceMachPort + 185
3 CoreFoundation 0x047c98d4 __CFRunLoopRun + 1380
4 CoreFoundation 0x047c8f44 CFRunLoopRunSpecific + 276
5 CoreFoundation 0x047c8e1b CFRunLoopRunInMode + 123
6 SpringBoard 0x000738a0 0x1000 + 469152
7 libsystem_c.dylib 0x9309f557 _pthread_start + 344
8 libsystem_c.dylib 0x93089cee thread_start + 34
Thread 8:
0 libsystem_c.dylib 0x93089cac start_wqthread + 0
Thread 0 crashed with X86 Thread State (32-bit):
eax: 0x00000000 ebx: 0x0b1de7a0 ecx: 0xbfffe19c edx: 0x94c75a6a
edi: 0xac45ca28 esi: 0x00000006 ebp: 0xbfffe1b8 esp: 0xbfffe19c
ss: 0x00000023 efl: 0x00000206 eip: 0x94c75a6a cs: 0x0000000b
ds: 0x00000023 es: 0x00000023 fs: 0x00000000 gs: 0x0000000f
cr2: 0x05022091
Logical CPU: 0
Binary Images:
0x1000 - 0x2acff7 +SpringBoard (2127.141) <EF39B240-01AE-3E9B-978C-B66804DCBE7B> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/CoreServices/SpringBoard.app/SpringBoard
0x333000 - 0x3edff7 +StoreServices (858.20) <13DDADBB-7756-3DFF-8749-B978D0E9B2D5> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/PrivateFrameworks/StoreServices.framework/StoreServices
0x469000 - 0x517ff7 +CoreText (289.14) <2459B66E-179A-39B4-A9C9-8D09538B3036> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/Frameworks/CoreText.framework/CoreText
0x560000 - 0x6f7fff +vImage (213.5) <B0EF7ABD-F20E-3616-B8B2-BAB707710833> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/vImage
.....
External Modification Summary:
Calls made by other processes targeting this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by all processes on this machine:
task_for_pid: 504
thread_create: 0
thread_set_state: 0
VM Region Summary:
ReadOnly portion of Libraries: Total=199.7M resident=44.0M(22%) swapped_out_or_unallocated=155.7M(78%)
Writable regions: Total=65.2M written=2516K(4%) resident=9.9M(15%) swapped_out=0K(0%) unallocated=55.3M(85%)
REGION TYPE VIRTUAL
=========== =======
CoreServices 360K
JS JIT generated code 32.0M
MALLOC 14.0M
MALLOC guard page 48K
Memory tag=35 11.6M
Stack 67.9M
VM_ALLOCATE 64K
__DATA 12.1M
__LINKEDIT 70.1M
__PAGEZERO 4K
__TEXT 129.7M
__UNICODE 544K
mapped file 242.7M
shared memory 12K
=========== =======
TOTAL 581.0M
Any help with debugging this would be great as I'm not sure where to start with fixing this.
Can you run the simulator stand-alone, not through XCode?
If so, can you run any of the built-in applications?
I'm not sure what may be causing this but it could well be some low-level interaction between the simulator and the VM. You should also bring up Console and see what is logged to the system when you try to run from XCode.
"Reset Content and Settings" resolved this issue, however I think it was combined with a step I made earlier in my attempts at debugging, as at the start I also tried resetting the contents and it didn't work...

Unknown exception and crash

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.

App Crash, no idea why

I trying to figure out why my App crashes sometimes on costumers devices. It doesnt matter if the device is jailbreaked or not. My App is from the AppStore. The other crashlogs are nearly the same although their crashed threads are different.
Hardware Model: iPhone3,1
Process: [the APP] [296]
Path: /var/mobile/Applications/06DF5BC5-F9C2-49EE-B2D5-5979C09B51A2/[the APP].app/[the APP]
Identifier: [the APP]
Version: 3.3.0
Code Type: ARM
Parent Process: launchd [1]
Date/Time: 2012-07-22 15:15:18 +0000
OS Version: iPhone OS 5.1.1 (9B206)
Report Version: 104
Exception Type: SIGSEGV
Exception Codes: SEGV_ACCERR at 0xbbadbeef
Crashed Thread: 7
Thread 0:
0 libsystem_kernel.dylib 0x35c39004 mach_msg_trap + 20
1 CoreFoundation 0x353673f3 __CFRunLoopServiceMachPort + 127
2 CoreFoundation 0x353660f1 __CFRunLoopRun + 825
3 CoreFoundation 0x352e94a5 CFRunLoopRunSpecific + 301
4 CoreFoundation 0x352e936d CFRunLoopRunInMode + 105
5 GraphicsServices 0x36f85439 GSEventRunModal + 137
6 UIKit 0x32df5cd5 UIApplicationMain + 1081
7 [the APP] 0x0000b549 main (main.m:20)
Thread 1:
0 libsystem_kernel.dylib 0x35c393a8 kevent + 24
1 libdispatch.dylib 0x3422cbc9 _dispatch_mgr_wakeup + 1
Thread 2:
0 libsystem_kernel.dylib 0x35c490d8 __psynch_mutexwait + 24
1 WebCore 0x311454ef _ZL17_WebTryThreadLockb + 215
2 WebCore 0x311a4173 _ZL19SendDelegateMessageP12NSInvocation + 707
3 WebKit 0x3507ad87 -[_WebSafeForwarder forwardInvocation:] + 119
4 CoreFoundation 0x35395a83 ___forwarding___ + 667
5 CoreFoundation 0x352f0650 _CF_forwarding_prep_0 + 48
6 WebKit 0x350816a1 WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(void (WebCore::PolicyChecker::*)(WebCore::PolicyAction), WebCore::NavigationAction const&, WebCore::ResourceRequest const&, WTF::PassRefPtr) + 221
7 WebCore 0x3120b8b9 WebCore::PolicyChecker::checkNavigationPolicy(WebCore::ResourceRequest const&, WebCore::DocumentLoader*, WTF::PassRefPtr, void (*)(void*, WebCore::ResourceRequest const&, WTF::PassRefPtr, bool), void*) + 873
8 WebCore 0x3120ae4d WebCore::FrameLoader::loadWithDocumentLoader(WebCore::DocumentLoader*, WebCore::FrameLoadType, WTF::PassRefPtr) + 913
9 WebCore 0x312092b9 WebCore::FrameLoader::load(WebCore::DocumentLoader*) + 169
10 WebCore 0x312091e5 WebCore::FrameLoader::load(WebCore::ResourceRequest const&, WebCore::SubstituteData const&, bool) + 241
11 WebKit 0x350b3f5f -[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:] + 1119
12 WebKit 0x350b3797 -[WebFrame _loadHTMLString:baseURL:unreachableURL:] + 79
13 WebKit 0x350b37bb -[WebFrame loadHTMLString:baseURL:] + 31
14 WebCore 0x311950b5 HandleRunSource + 365
15 CoreFoundation 0x35367ad3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
16 CoreFoundation 0x35367335 __CFRunLoopDoSources0 + 365
17 CoreFoundation 0x35366045 __CFRunLoopRun + 653
18 CoreFoundation 0x352e94a5 CFRunLoopRunSpecific + 301
19 CoreFoundation 0x352e936d CFRunLoopRunInMode + 105
20 WebCore 0x311e8ca3 _ZL12RunWebThreadPv + 403
21 libsystem_c.dylib 0x32756735 _pthread_start + 321
Thread 3:
0 libsystem_kernel.dylib 0x35c39004 mach_msg_trap + 20
1 CoreFoundation 0x353673f3 __CFRunLoopServiceMachPort + 127
2 CoreFoundation 0x3536612b __CFRunLoopRun + 883
3 CoreFoundation 0x352e94a5 CFRunLoopRunSpecific + 301
4 CoreFoundation 0x352e936d CFRunLoopRunInMode + 105
5 Foundation 0x34e22bb9 +[NSURLConnection(Loader) _resourceLoadLoop:] + 309
6 Foundation 0x34e22a81 -[NSThread main] + 73
7 Foundation 0x34eb6591 __NSThread__main__ + 1049
8 libsystem_c.dylib 0x32756735 _pthread_start + 321
Thread 4:
0 libsystem_kernel.dylib 0x35c49570 __select + 20
1 libsystem_c.dylib 0x32756735 _pthread_start + 321
Thread 5:
0 libsystem_kernel.dylib 0x35c39004 mach_msg_trap + 20
1 CoreFoundation 0x353673f3 __CFRunLoopServiceMachPort + 127
2 CoreFoundation 0x3536612b __CFRunLoopRun + 883
3 CoreFoundation 0x352e94a5 CFRunLoopRunSpecific + 301
4 CoreFoundation 0x352e936d CFRunLoopRunInMode + 105
5 YouTube 0x33e336c9 -[YTImageLoader(Internal) _startLoader] + 245
6 Foundation 0x34e22a81 -[NSThread main] + 73
7 Foundation 0x34eb6591 __NSThread__main__ + 1049
8 libsystem_c.dylib 0x32756735 _pthread_start + 321
Thread 6:
0 libsystem_kernel.dylib 0x35c49cd4 __workq_kernreturn + 8
Thread 7 Crashed:
0 WebCore 0x311454e2 _ZL17_WebTryThreadLockb + 202
1 WebCore 0x3114540f WebThreadLock + 55
2 UIKit 0x32e5537b -[UIWebTiledView layoutSubviews] + 43
3 UIKit 0x32e5534b -[UIWebDocumentView layoutSubviews] + 127
4 UIKit 0x32dcaf37 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 183
5 CoreFoundation 0x352f21fb -[NSObject performSelector:withObject:] + 43
6 QuartzCore 0x321c2aa5 -[CALayer layoutSublayers] + 217
7 QuartzCore 0x321c26bd CA::Layer::layout_if_needed(CA::Transaction*) + 217
8 QuartzCore 0x321c6843 CA::Context::commit_transaction(CA::Transaction*) + 227
9 QuartzCore 0x321c657f CA::Transaction::commit() + 315
10 QuartzCore 0x3220dd01 CA::Transaction::release_thread(void*) + 37
11 libsystem_c.dylib 0x327490ff _pthread_tsd_cleanup + 171
12 libsystem_c.dylib 0x32748d7b _pthread_exit + 123
13 libsystem_c.dylib 0x3275a0f3 pthread_exit + 31
14 Foundation 0x34e3237b +[NSThread exit] + 11
15 Foundation 0x34eb65af __NSThread__main__ + 1079
16 libsystem_c.dylib 0x32756735 _pthread_start + 321
Thread 8:
0 libsystem_kernel.dylib 0x35c49cd4 __workq_kernreturn + 8
Thread 9:
0 libsystem_kernel.dylib 0x35c49cd4 __workq_kernreturn + 8
Thread 10:
0 libsystem_kernel.dylib 0x35c49cd4 __workq_kernreturn + 8
Thread 11:
0 libsystem_kernel.dylib 0x35c49cd4 __workq_kernreturn + 8
Thread 7 crashed with ARM Thread State:
r0: 0xffffffff r1: 0x00001100 r2: 0x2ffc850c r3: 0x00000000
r4: 0xbbadbeef r5: 0x00000000 r6: 0x0054b000 r7: 0x2ffc8b4c
r8: 0x0ca32800 r9: 0x3399fc2c r10: 0x2ffc8be4 r11: 0x2ffc8ebc
ip: 0x3ee8e270 sp: 0x2ffc8b40 lr: 0x35790fef pc: 0x32c7f4e2
cpsr: 0x60000030
Binary Images:
[cut cause of char limit]
I have no idea what happend, anyone an idea?
The problem is that you send messages to UI objects from a background thread, which is forbidden.
Thread 7 crashed with a stack trace into UIView's layout mechanism. The fact that thread 7 is in this code probably results from a setNeedsLayout or some other method being sent from this background thread.
I think web view finished loading and trying to reload view but view controller was poped and released,you need to add this in viewWillDisappear method:
- (void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
if ([webView isLoading]) {
[webView stopLoading];
}
}
The project that I am on sees a similar exception for a WinTel based GWT App running on the WebKit. It has been determined that this particular problem only occurs when the WebKit runs out of memory.

iPhone SDK - CALayer crash

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];?

Why did this app crash while in the background?

My app uses background location for GPS updates. I've registered it for background location updates, and while it's running in background, it always crashes like this.
Since I haven't written most of this code, I really have no idea what happened.
I have checked the memory allocations and there doesn't seem to be much of a problem there. Here's a crash report:
Incident Identifier: 39F6F622-1274-4B6C-BA19-32D10E04E309
CrashReporter Key: 4757f4c5e5f009daf18eb0c512f729356c3e5de4
Hardware Model: iPhone3,1
Process: Get Off Now! [3040]
Path: /var/mobile/Applications/43D41F77-B225-4F47-AFB0-D2F2E00E18DF/Get Off Now!.app/Get Off Now!
Identifier: Get Off Now!
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2010-12-22 13:31:29.293 +0800
OS Version: iPhone OS 4.1 (8B117)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000d
Crashed Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x000027d8 objc_msgSend + 16
1 CoreFoundation 0x000042ae CFRetain + 62
2 CoreFoundation 0x0005ab58 CFMessagePortInvalidate + 304
3 CoreFoundation 0x0005b05e CFMessagePortIsValid + 42
4 CoreLocation 0x000030f8 CLClientIsValid + 12
5 CoreLocation 0x00004b10 CLClientSendAndCache(__CLClient*, CLDaemonCommType, void*, int, unsigned char, unsigned char) + 40
6 CoreLocation 0x000051cc CLClientHandleWatchdogTimerExpiry(__CFRunLoopTimer*, void*) + 24
7 CoreFoundation 0x000567f4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 8
8 CoreFoundation 0x000562a6 __CFRunLoopDoTimer + 854
9 CoreFoundation 0x0002779e __CFRunLoopRun + 1082
10 CoreFoundation 0x00027270 CFRunLoopRunSpecific + 224
11 CoreFoundation 0x00027178 CFRunLoopRunInMode + 52
12 GraphicsServices 0x000045ec GSEventRunModal + 108
13 GraphicsServices 0x00004698 GSEventRun + 56
14 UIKit 0x0000411c -[UIApplication _run] + 396
15 UIKit 0x00002128 UIApplicationMain + 664
16 Get Off Now! 0x00002406 0x1000 + 5126
17 Get Off Now! 0x000023d0 0x1000 + 5072
Thread 1:
0 libSystem.B.dylib 0x0002d330 kevent + 24
1 libSystem.B.dylib 0x000d6b6c _dispatch_mgr_invoke + 88
2 libSystem.B.dylib 0x000d65bc _dispatch_queue_invoke + 96
3 libSystem.B.dylib 0x000d675c _dispatch_worker_thread2 + 120
4 libSystem.B.dylib 0x0007a67a _pthread_wqthread + 258
5 libSystem.B.dylib 0x00073190 start_wqthread + 0
Thread 2:
0 libSystem.B.dylib 0x00000cf4 semaphore_wait_signal_trap + 8
1 libSystem.B.dylib 0x0002e4ee semaphore_wait_signal + 2
2 libSystem.B.dylib 0x00002ae4 pthread_mutex_lock + 248
3 WebCore 0x00002620 _WebTryThreadLock(bool) + 140
4 WebCore 0x00002566 WebRunLoopLock(__CFRunLoopObserver*, unsigned long, void*) + 18
5 CoreFoundation 0x00030236 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 10
6 CoreFoundation 0x000300aa __CFRunLoopDoObservers + 406
7 CoreFoundation 0x000276c0 __CFRunLoopRun + 860
8 CoreFoundation 0x00027270 CFRunLoopRunSpecific + 224
9 CoreFoundation 0x00027178 CFRunLoopRunInMode + 52
10 WebCore 0x000024e2 RunWebThread(void*) + 362
11 libSystem.B.dylib 0x0007a27e _pthread_start + 242
12 libSystem.B.dylib 0x0006f2a8 thread_start + 0
Thread 3:
0 libSystem.B.dylib 0x0007b19c __workq_kernreturn + 8
1 libSystem.B.dylib 0x0007a790 _pthread_wqthread + 536
2 libSystem.B.dylib 0x00073190 start_wqthread + 0
Thread 4:
0 libSystem.B.dylib 0x0007b19c __workq_kernreturn + 8
1 libSystem.B.dylib 0x0007a790 _pthread_wqthread + 536
2 libSystem.B.dylib 0x00073190 start_wqthread + 0
Thread 0 crashed with ARM Thread State:
r0: 0x001a01c0 r1: 0x33024270 r2: 0x00000005 r3: 0x3002d7c9
r4: 0x00000005 r5: 0x3e1af5e4 r6: 0x00000017 r7: 0x2fffeac0
r8: 0x00000004 r9: 0x001fc098 r10: 0x00855864 r11: 0x2fffeb48
ip: 0x3e19c3f0 sp: 0x2fffeaa8 lr: 0x307fc2b5 pc: 0x3002d7d8
cpsr: 0x20000030
This is another way it crashes; it looks the same, except it uses 100% CPU for a long time:
Incident Identifier: 61B42F36-021F-48D2-B180-112527BAE5CF
CrashReporter Key: 4757f4c5e5f009daf18eb0c512f729356c3e5de4
Hardware Model: iPhone3,1
Process: Get Off Now! [3751]
Path: /var/mobile/Applications/43D41F77-B225-4F47-AFB0-D2F2E00E18DF/Get Off Now!.app/Get Off Now!
Identifier: Get Off Now!
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2010-12-23 13:06:50.363 +0800
OS Version: iPhone OS 4.1 (8B117)
Report Version: 104
Exception Type: 00000020
Exception Codes: 0x8badf00d
Highlighted Thread: 0
Application Specific Information:
Get Off Now![3751] has active assertions beyond permitted time:
{(
<SBProcessAssertion: 0xca2a8a0> identifier: CoreLocationRegistration process: Get Off Now![3751] permittedBackgroundDuration: 600.000000 reason: finishTask owner pid:3751 preventSuspend preventIdleSleep
)}
Elapsed total CPU time (seconds): 600.010 (user 19.350, system 580.660), 100% CPU
Elapsed application CPU time (seconds): 575.320, 96% CPU
Thread 0:
0 libSystem.B.dylib 0x00004f0c OSSpinLockLock + 44
1 CoreFoundation 0x0005aa42 CFMessagePortInvalidate + 26
2 CoreFoundation 0x0005b05e CFMessagePortIsValid + 42
3 CoreLocation 0x000030f8 CLClientIsValid + 12
4 CoreLocation 0x00004b10 CLClientSendAndCache(__CLClient*, CLDaemonCommType, void*, int, unsigned char, unsigned char) + 40
5 CoreLocation 0x000051cc CLClientHandleWatchdogTimerExpiry(__CFRunLoopTimer*, void*) + 24
6 CoreFoundation 0x000567f4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 8
7 CoreFoundation 0x000562a6 __CFRunLoopDoTimer + 854
8 CoreFoundation 0x0002779e __CFRunLoopRun + 1082
9 CoreFoundation 0x00027270 CFRunLoopRunSpecific + 224
10 CoreFoundation 0x00027178 CFRunLoopRunInMode + 52
11 GraphicsServices 0x000045ec GSEventRunModal + 108
12 GraphicsServices 0x00004698 GSEventRun + 56
13 UIKit 0x0000411c -[UIApplication _run] + 396
14 UIKit 0x00002128 UIApplicationMain + 664
15 Get Off Now! 0x000022de main (main.m:13)
16 Get Off Now! 0x000022a8 start + 32
Thread 1:
0 libSystem.B.dylib 0x0002d330 kevent + 24
1 libSystem.B.dylib 0x000d6b6c _dispatch_mgr_invoke + 88
2 libSystem.B.dylib 0x000d65bc _dispatch_queue_invoke + 96
3 libSystem.B.dylib 0x000d675c _dispatch_worker_thread2 + 120
4 libSystem.B.dylib 0x0007a67a _pthread_wqthread + 258
5 libSystem.B.dylib 0x00073190 start_wqthread + 0
Thread 2:
0 libSystem.B.dylib 0x00000c98 mach_msg_trap + 20
1 libSystem.B.dylib 0x00002d64 mach_msg + 44
2 CoreFoundation 0x00027c38 __CFRunLoopServiceMachPort + 88
3 CoreFoundation 0x000274c2 __CFRunLoopRun + 350
4 CoreFoundation 0x00027270 CFRunLoopRunSpecific + 224
5 CoreFoundation 0x00027178 CFRunLoopRunInMode + 52
6 WebCore 0x000024e2 RunWebThread(void*) + 362
7 libSystem.B.dylib 0x0007a27e _pthread_start + 242
8 libSystem.B.dylib 0x0006f2a8 thread_start + 0
Unknown thread crashed with unknown flavor: 5, state_count: 1
I think you need to check some objects which are released by other threads, but they are accessed by main thread. I encountered something like this, and it was because I accessed some objects which had been released.
I had precisely the same crash logs being generated. I have a main thread, which uses an NSOperationQueue to spawn a data download thread, which then uses performSelectorOnMainThread when finished.
In my didupdatelocation method, I was cycling through an array, launching a local notification in some cases. It seemed to fail on the SECOND instance of a local notification (for the same array item), but I cannot be sure. I did try symbolicating the logs, but there is some missing file error with 4.2.1, so I'd copied in symbols from 4.2, and couldn't get atos to work (but that was probably my fault).
Last night I made the following changes, and all seems to be resolved:
1) changed all self.locationManager notation to just locationManager
2) removed everything from the dealloc method in the appdelegate (aside from super)