MKMapView crashes by setRegion - ios

i want to show a specific adress on the Map. Here is my code.
- (void)viewDidLoad{
[super viewDidLoad];
CLLocationCoordinate2D startCoord = CLLocationCoordinate2DMake(51.514302, 7.616798);
MKCoordinateRegion adjustedRegion = [_map regionThatFits:MKCoordinateRegionMakeWithDistance(startCoord, 200.0, 200.0)];
adjustedRegion.span = MKCoordinateSpanMake(0.005, 0.005);
[_map setRegion:adjustedRegion];
On the Simulator it works fine but on my iPad it crashes...
Where is my fault?
Last Exception Backtrace:
0 CoreFoundation 0x33cbe3e2 __exceptionPreprocess + 158
1 libobjc.A.dylib 0x3bb4e95e objc_exception_throw + 26
2 CoreFoundation 0x33cbe0d0 -[NSException raise] + 4
3 MapKit 0x34aec530 -[MKMapView setRegion:animated:] + 672
4 MapKit 0x34aec64a __32-[MKMapView setRegion:animated:]_block_invoke_0 + 90
5 MapKit 0x34ad6006 -[MKMapView _updateCenteredAttributesWithCoordinate:] + 122
6 MapKit 0x34ad5f3a -[MKMapView _sizeDidChangeWithCenterCoordinate:] + 126
7 MapKit 0x34ae8b58 -[MKMapView setBounds:] + 224
8 UIKit 0x35cb2476 -[UIView(Geometry) _applyISEngineLayoutValues] + 246
9 UIKit 0x35b3068a -[UIView(Geometry) _resizeWithOldSuperviewSize:] + 138
10 CoreFoundation 0x33cb9c1c __NSArrayChunkIterate + 364
11 CoreFoundation 0x33cb2bb2 __NSArrayEnumerate + 590
12 CoreFoundation 0x33c14e32 -[NSArray enumerateObjectsWithOptions:usingBlock:] + 58
13 UIKit 0x35ae9096 -[UIView(Geometry) resizeSubviewsWithOldSize:] + 114
14 UIKit 0x35f09da8 -[UIView(AdditionalLayoutSupport) _is_layout] + 112
15 UIKit 0x35ad6ae0 -[UIView(Hierarchy) layoutSubviews] + 68
16 UIKit 0x35ad08c2 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 254
17 QuartzCore 0x3587c50e -[CALayer layoutSublayers] + 210
18 QuartzCore 0x3587c0b0 CA::Layer::layout_if_needed(CA::Transaction*) + 456
19 QuartzCore 0x358aaeca -[CALayer layoutIfNeeded] + 138
20 UIKit 0x35b7a0dc -[UIViewController window:setupWithInterfaceOrientation:] + 204
21 UIKit 0x35b792c6 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 3598
22 UIKit 0x35b784aa -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 42
23 UIKit 0x35b78434 -[UIWindow _setRotatableViewOrientation:duration:force:] + 64
24 UIKit 0x35cadcb4 __57-[UIWindow _updateToInterfaceOrientation:duration:force:]_block_invoke_0 + 100
25 UIKit 0x35b3667e -[UIWindow _updateToInterfaceOrientation:duration:force:] + 214
26 UIKit 0x35b363c2 -[UIWindow setAutorotates:forceUpdateInterfaceOrientation:] + 690
27 UIKit 0x35b35d2a -[UIViewController _tryBecomeRootViewControllerInWindow:] + 150
28 UIKit 0x35b2ce86 -[UIWindow addRootViewControllerViewIfPossible] + 366
29 UIKit 0x35b28af0 -[UIWindow _setHidden:forced:] + 360
30 UIKit 0x35b6a1dc -[UIWindow makeKeyAndVisible] + 56
31 UIKit 0x35b2d7fe -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1642
32 UIKit 0x35b2582e -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 694
33 UIKit 0x35acdd1a -[UIApplication handleEvent:withNewEvent:] + 1006
34 UIKit 0x35acd7a8 -[UIApplication sendEvent:] + 68
35 UIKit 0x35acd1ea _UIApplicationHandleEvent + 6194
36 GraphicsServices 0x377c05f2 _PurpleEventCallback + 586
37 GraphicsServices 0x377c0222 PurpleEventCallback + 30
38 CoreFoundation 0x33c933e2 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 30
39 CoreFoundation 0x33c93386 __CFRunLoopDoSource1 + 134
40 CoreFoundation 0x33c9220a __CFRunLoopRun + 1378
41 CoreFoundation 0x33c05238 CFRunLoopRunSpecific + 352
42 CoreFoundation 0x33c050c4 CFRunLoopRunInMode + 100
43 UIKit 0x35b24468 -[UIApplication _run] + 664
44 UIKit 0x35b212b4 UIApplicationMain + 1116
45 AD HOK 0x000bcd80 main (main.m:16)
46 libdyld.dylib 0x3bf7bb1c start + 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x3c042350 __pthread_kill + 8
1 libsystem_c.dylib 0x3bfb8fb2 pthread_kill + 54
2 libsystem_c.dylib 0x3bff5366 abort + 90
3 libc++abi.dylib 0x3b59ddda abort_message + 70
4 libc++abi.dylib 0x3b59b094 _ZL17default_terminatev + 20
5 libobjc.A.dylib 0x3bb4ea58 _ZL15_objc_terminatev + 144
6 libc++abi.dylib 0x3b59b118 _ZL19safe_handler_callerPFvvE + 76
7 libc++abi.dylib 0x3b59b1b0 std::terminate() + 16
8 libc++abi.dylib 0x3b59c626 __cxa_rethrow + 90
9 libobjc.A.dylib 0x3bb4e9b0 objc_exception_rethrow + 8
10 CoreFoundation 0x33c0529c CFRunLoopRunSpecific + 452
11 CoreFoundation 0x33c050c4 CFRunLoopRunInMode + 100
12 UIKit 0x35b24468 -[UIApplication _run] + 664
13 UIKit 0x35b212b4 UIApplicationMain + 1116
14 AD HOK 0x000bcd80 main (main.m:16)
15 libdyld.dylib 0x3bf7bb1c start + 0
Thread 1:
0 libsystem_kernel.dylib 0x3c042d98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x3bf90ad6 _pthread_workq_return + 14
2 libsystem_c.dylib 0x3bf907f2 _pthread_wqthread + 362
3 libsystem_c.dylib 0x3bf90680 start_wqthread + 4
Thread 2 name: Dispatch queue: com.apple.libdispatch-manager
Thread 2:
0 libsystem_kernel.dylib 0x3c0325d0 kevent64 + 24
1 libdispatch.dylib 0x3bf6dd22 _dispatch_mgr_invoke + 806
2 libdispatch.dylib 0x3bf69374 _dispatch_mgr_thread + 32
Thread 3:
0 libsystem_kernel.dylib 0x3c042d98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x3bf90ad6 _pthread_workq_return + 14
2 libsystem_c.dylib 0x3bf907f2 _pthread_wqthread + 362
3 libsystem_c.dylib 0x3bf90680 start_wqthread + 4
Thread 4 name: WebThread
Thread 4:
0 libsystem_kernel.dylib 0x3c031e30 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3c031fd0 mach_msg + 48
2 CoreFoundation 0x33c932b6 __CFRunLoopServiceMachPort + 126
3 CoreFoundation 0x33c9202c __CFRunLoopRun + 900
4 CoreFoundation 0x33c05238 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x33c050c4 CFRunLoopRunInMode + 100
6 WebCore 0x39be0390 _ZL12RunWebThreadPv + 440
7 libsystem_c.dylib 0x3bf9b0de _pthread_start + 306
8 libsystem_c.dylib 0x3bf9afa4 thread_start + 4
Thread 5:
0 libsystem_kernel.dylib 0x3c042d98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x3bf90ad6 _pthread_workq_return + 14
2 libsystem_c.dylib 0x3bf907f2 _pthread_wqthread + 362
3 libsystem_c.dylib 0x3bf90680 start_wqthread + 4
Thread 0 crashed with ARM Thread State (32-bit):
r0: 0x00000000 r1: 0x00000000 r2: 0x00000000 r3: 0x3db31524
r4: 0x00000006 r5: 0x3db31b78 r6: 0x210aa354 r7: 0x2fd459d4
r8: 0x210aa330 r9: 0x00000300 r10: 0x00000000 r11: 0x7ff80000
ip: 0x00000148 sp: 0x2fd459c8 lr: 0x3bfb8fb7 pc: 0x3c042350
cpsr: 0x00000010

It's not clear why you are asking the map for the region that fits, when you end up setting the span for that region again explicitly anyway. Further, the map doesn't have a meaningful answer to this question before layout is completed. This is probably why it is crashing, because the region is not correctly defined.
From your code, it looks like you just wanted to do this:
- (void)viewDidLoad{
[super viewDidLoad];
CLLocationCoordinate2D startCoord = CLLocationCoordinate2DMake(51.514302, 7.616798);
[_map setRegion:MKCoordinateRegionMakeWithDistance(startCoord, 200.0, 200.0) animated:NO];
}
I think that's much simpler, and should work fine on the device. Hope that helps.

Related

ios app crashes for only one customer

One of my customers reports consistent crashing, about 75% of the times he performs a particular operation in the app. That operation involves some image processing. He's using an iPhone 4S (the same model I used when developing the app) and iOS 7.1.1. No other customer has reported this issue. He has deleted the app and reinstalled from the App Store. He's using the app's default settings. I cannot recreate the issue.
Thread 8 crashes, but does not show any lines in my code ("gCard"). The issue appears to be "doesNotRecognizeSelector:" in a thread that does not show any lines in my code. I don't understand this. (The app uses brad Larson's GPUImage but I don't know if that's a factor.)
I need help to understand the dump and suggestions on my next step.
{"name":"gCard","bug_type":"109","os_version":"iPhone OS 7.1.1 (11D201)","bundleID":"com.PFM3.Ghost-Card","version":"1.2.1 (1.2.1)","app_name":"gCard"}
Incident Identifier: E85F86F8-0F39-4E55-9EAD-48461F1EF955
CrashReporter Key: 64c031d9f1572910e1137bebea2b9be924396928
Hardware Model: iPhone4,1
Process: gCard [136]
Path: /var/mobile/Applications/4E5D5D22-0202-47DE-B8B2-B9C9D90825B2/gCard.app/gCard
Identifier: com.PFM3.Ghost-Card
Version: 1.2.1 (1.2.1)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2014-06-23 00:03:18.728 -0700
OS Version: iOS 7.1.1 (11D201)
Report Version: 104
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x000000000000defe
Triggered by Thread: 8
Last Exception Backtrace:
0 CoreFoundation 0x2ec27fce __exceptionPreprocess + 126
1 libobjc.A.dylib 0x394a0cca objc_exception_throw + 34
2 CoreFoundation 0x2ec2b962 -[NSObject(NSObject) doesNotRecognizeSelector:] + 198
3 CoreFoundation 0x2ec2a24e ___forwarding___ + 702
4 CoreFoundation 0x2eb797b4 _CF_forwarding_prep_0 + 20
5 UIFoundation 0x36865a20 __NSStringDrawingEngine + 12200
6 UIFoundation 0x368629a2 -[NSString(NSExtendedStringDrawing) drawWithRect:options:attributes:context:] + 146
7 UIKit 0x3145cd1c -[UILabel _drawTextInRect:baselineCalculationOnly:] + 4220
8 UIKit 0x314c3004 -[UILabel drawTextInRect:] + 496
9 UIKit 0x314c2e06 -[UILabel drawRect:] + 74
10 UIKit 0x314c2da0 -[UIView(CALayerDelegate) drawLayer:inContext:] + 368
11 QuartzCore 0x310f02bc -[CALayer drawInContext:] + 96
12 QuartzCore 0x310d9e3a CABackingStoreUpdate_ + 1850
13 QuartzCore 0x311b4d68 ___ZN2CA5Layer8display_Ev_block_invoke + 48
14 QuartzCore 0x310d96ee x_blame_allocations + 78
15 QuartzCore 0x310d9396 CA::Layer::display_() + 1102
16 QuartzCore 0x310bd038 CA::Layer::display_if_needed(CA::Transaction*) + 204
17 QuartzCore 0x310bccd0 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 20
18 QuartzCore 0x310bc6da CA::Context::commit_transaction(CA::Transaction*) + 226
19 QuartzCore 0x310bc4ea CA::Transaction::commit() + 310
20 QuartzCore 0x310e9a7e CA::Transaction::release_thread(void*) + 158
21 libsystem_pthread.dylib 0x39acb688 _pthread_tsd_cleanup + 160
22 libsystem_pthread.dylib 0x39acb406 _pthread_exit + 82
23 libsystem_pthread.dylib 0x39acabe2 _pthread_wqthread + 314
24 libsystem_pthread.dylib 0x39acaa94 start_wqthread + 4
Thread 0:
0 libsystem_kernel.dylib 0x39a50a58 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x39a50854 mach_msg + 44
2 CoreFoundation 0x2ebf2896 __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x2ebf1002 __CFRunLoopRun + 850
4 CoreFoundation 0x2eb5bf0a CFRunLoopRunSpecific + 518
5 CoreFoundation 0x2eb5bcee CFRunLoopRunInMode + 102
6 GraphicsServices 0x33ab465e GSEventRunModal + 134
7 UIKit 0x314a7168 UIApplicationMain + 1132
8 gCard 0x00089e12 main (main.m:16)
9 libdyld.dylib 0x399adab4 start + 0
Thread 1:
0 libsystem_kernel.dylib 0x39a50808 kevent64 + 24
1 libdispatch.dylib 0x39992078 _dispatch_mgr_invoke + 228
2 libdispatch.dylib 0x39991dfe _dispatch_mgr_thread$VARIANT$mp + 34
Thread 2:
0 libsystem_kernel.dylib 0x39a50a58 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x39a50854 mach_msg + 44
2 CoreFoundation 0x2ebf2896 __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x2ebf0fbc __CFRunLoopRun + 780
4 CoreFoundation 0x2eb5bf0a CFRunLoopRunSpecific + 518
5 CoreFoundation 0x2eb5bcee CFRunLoopRunInMode + 102
6 Foundation 0x2f54e1e6 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 250
7 Foundation 0x2f59f09c -[NSRunLoop(NSRunLoop) run] + 76
8 gCard 0x000cd8d4 +[AFURLConnectionOperation networkRequestThreadEntryPoint:] (AFURLConnectionOperation.m:151)
9 Foundation 0x2f610a5a __NSThread__main__ + 1058
10 libsystem_pthread.dylib 0x39acc916 _pthread_body + 138
11 libsystem_pthread.dylib 0x39acc886 _pthread_start + 98
12 libsystem_pthread.dylib 0x39acaaa0 thread_start + 4
Thread 3:
0 libsystem_kernel.dylib 0x39a50a58 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x39a50854 mach_msg + 44
2 CoreFoundation 0x2ebf2896 __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x2ebf0fbc __CFRunLoopRun + 780
4 CoreFoundation 0x2eb5bf0a CFRunLoopRunSpecific + 518
5 CoreFoundation 0x2eb9f9fe CFRunLoopRun + 94
6 CoreMotion 0x2f2193a8 ___lldb_unnamed_function1423$$CoreMotion + 724
7 libsystem_pthread.dylib 0x39acc916 _pthread_body + 138
8 libsystem_pthread.dylib 0x39acc886 _pthread_start + 98
9 libsystem_pthread.dylib 0x39acaaa0 thread_start + 4
Thread 4 name: com.apple.NSURLConnectionLoader
Thread 4:
0 libsystem_kernel.dylib 0x39a50a58 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x39a50854 mach_msg + 44
2 CoreFoundation 0x2ebf2896 __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x2ebf0fbc __CFRunLoopRun + 780
4 CoreFoundation 0x2eb5bf0a CFRunLoopRunSpecific + 518
5 CoreFoundation 0x2eb5bcee CFRunLoopRunInMode + 102
6 Foundation 0x2f59b082 +[NSURLConnection(Loader) _resourceLoadLoop:] + 314
7 Foundation 0x2f610a5a __NSThread__main__ + 1058
8 libsystem_pthread.dylib 0x39acc916 _pthread_body + 138
9 libsystem_pthread.dylib 0x39acc886 _pthread_start + 98
10 libsystem_pthread.dylib 0x39acaaa0 thread_start + 4
Thread 5 name: com.apple.CFSocket.private
Thread 5:
0 libsystem_kernel.dylib 0x39a63434 __select + 20
1 CoreFoundation 0x2ebf6758 __CFSocketManager + 480
2 libsystem_pthread.dylib 0x39acc916 _pthread_body + 138
3 libsystem_pthread.dylib 0x39acc886 _pthread_start + 98
4 libsystem_pthread.dylib 0x39acaaa0 thread_start + 4
Thread 6:
0 libsystem_kernel.dylib 0x39a63c70 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x39acabda _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x39acaa94 start_wqthread + 4
Thread 7:
0 libsystem_kernel.dylib 0x39a63c70 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x39acabda _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x39acaa94 start_wqthread + 4
Thread 8 Crashed:
0 libsystem_c.dylib 0x39a1404e __abort + 102
1 libsystem_c.dylib 0x39a13fe4 abort + 84
2 libc++abi.dylib 0x38d42cd2 abort_message + 70
3 libc++abi.dylib 0x38d5b6e0 default_terminate_handler() + 248
4 libobjc.A.dylib 0x394a0f62 _objc_terminate() + 190
5 libc++abi.dylib 0x38d591c4 std::__terminate(void (*)()) + 76
6 libc++abi.dylib 0x38d58a18 __cxa_throw + 112
7 libobjc.A.dylib 0x394a0d9e objc_exception_throw + 246
8 CoreFoundation 0x2ec2b962 -[NSObject(NSObject) doesNotRecognizeSelector:] + 198
9 CoreFoundation 0x2ec2a24e ___forwarding___ + 702
10 CoreFoundation 0x2eb797b4 _CF_forwarding_prep_0 + 20
11 UIFoundation 0x36865a20 __NSStringDrawingEngine + 12200
12 UIFoundation 0x368629a2 -[NSString(NSExtendedStringDrawing) drawWithRect:options:attributes:context:] + 146
13 UIKit 0x3145cd1c -[UILabel _drawTextInRect:baselineCalculationOnly:] + 4220
14 UIKit 0x314c3004 -[UILabel drawTextInRect:] + 496
15 UIKit 0x314c2e06 -[UILabel drawRect:] + 74
16 UIKit 0x314c2da0 -[UIView(CALayerDelegate) drawLayer:inContext:] + 368
17 QuartzCore 0x310f02bc -[CALayer drawInContext:] + 96
18 QuartzCore 0x310d9e3c CABackingStoreUpdate_ + 1852
19 QuartzCore 0x311b4d68 ___ZN2CA5Layer8display_Ev_block_invoke + 48
20 QuartzCore 0x310d96f0 x_blame_allocations + 80
21 QuartzCore 0x310d9396 CA::Layer::display_() + 1102
22 QuartzCore 0x310bd038 CA::Layer::display_if_needed(CA::Transaction*) + 204
23 QuartzCore 0x310bccd0 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 20
24 QuartzCore 0x310bc6da CA::Context::commit_transaction(CA::Transaction*) + 226
25 QuartzCore 0x310bc4ea CA::Transaction::commit() + 310
26 QuartzCore 0x310e9a7e CA::Transaction::release_thread(void*) + 158
27 libsystem_pthread.dylib 0x39acb68a _pthread_tsd_cleanup + 162
28 libsystem_pthread.dylib 0x39acb406 _pthread_exit + 82
29 libsystem_pthread.dylib 0x39acabe2 _pthread_wqthread + 314
30 libsystem_pthread.dylib 0x39acaa94 start_wqthread + 4
Thread 8 crashed with ARM Thread State (32-bit):
r0: 0x00000000 r1: 0x00000000 r2: 0x00000000 r3: 0x00000001
r4: 0x06277c84 r5: 0xffffffff r6: 0x00000000 r7: 0x06277c94
r8: 0x1767ed40 r9: 0x39ac7f69 r10: 0x368b94c8 r11: 0x00000000
ip: 0x00000030 sp: 0x06277c7c lr: 0x39a1404f pc: 0x39a1404e
cpsr: 0x40000030
You should/must do all( or nearly all) ui specific operations on the main thread. Possibly you alter the view hierarchy in a block performed on another block.

EXC_CRASH (SIGABRT) crash error only for release version

The app that I have runs perfectly fine in debug mode but when tested in ad hoc in release mode a crash happens. The crash actually happens when the app first starts. I don't really know how to debug or proceed to find out what's the issue. Xcode doesn't throw any error.
The following is my crash log
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x2eb6dfce __exceptionPreprocess + 126
1 libobjc.A.dylib 0x3970ecca objc_exception_throw + 34
2 CoreFoundation 0x2eaa49c0 -[__NSArrayM removeObjectAtIndex:] + 420
3 geezer 0x0008dfce 0x25000 + 430030
4 geezer 0x0008d2c0 0x25000 + 426688
5 UIKit 0x3138e4c6 -[UIViewController loadViewIfRequired] + 514
6 UIKit 0x3138e284 -[UIViewController view] + 20
7 geezer 0x000413fa 0x25000 + 115706
8 geezer 0x00041082 0x25000 + 114818
9 geezer 0x0005616e 0x25000 + 201070
10 UIKit 0x313f95a2 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 270
11 UIKit 0x313f8ef6 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1606
12 UIKit 0x313f3586 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 710
13 UIKit 0x3138f704 -[UIApplication handleEvent:withNewEvent:] + 3536
14 UIKit 0x3138e86c -[UIApplication sendEvent:] + 68
15 UIKit 0x313f2cc4 _UIApplicationHandleEvent + 612
16 GraphicsServices 0x339c8ae8 _PurpleEventCallback + 604
17 GraphicsServices 0x339c86d2 PurpleEventCallback + 30
18 CoreFoundation 0x2eb38ab2 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 30
19 CoreFoundation 0x2eb38a4e __CFRunLoopDoSource1 + 342
20 CoreFoundation 0x2eb37222 __CFRunLoopRun + 1394
21 CoreFoundation 0x2eaa1f0a CFRunLoopRunSpecific + 518
22 CoreFoundation 0x2eaa1cee CFRunLoopRunInMode + 102
23 UIKit 0x313f1eec -[UIApplication _run] + 756
24 UIKit 0x313ed168 UIApplicationMain + 1132
25 geezer 0x0008b19a 0x25000 + 418202
26 libdyld.dylib 0x39c1bab2 tlv_initializer + 2
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x39cd11f0 __pthread_kill + 8
1 libsystem_pthread.dylib 0x39d3b792 pthread_kill + 54
2 libsystem_c.dylib 0x39c81fd8 abort + 72
3 libc++abi.dylib 0x38fb0cd2 abort_message + 70
4 libc++abi.dylib 0x38fc96e0 default_terminate_handler() + 248
5 libobjc.A.dylib 0x3970ef62 _objc_terminate() + 190
6 libc++abi.dylib 0x38fc71c4 std::__terminate(void (*)()) + 76
7 libc++abi.dylib 0x38fc6d28 __cxa_rethrow + 96
8 libobjc.A.dylib 0x3970ee12 objc_exception_rethrow + 38
9 CoreFoundation 0x2eaa1f80 CFRunLoopRunSpecific + 636
10 CoreFoundation 0x2eaa1cee CFRunLoopRunInMode + 102
11 UIKit 0x313f1eec -[UIApplication _run] + 756
12 UIKit 0x313ed168 UIApplicationMain + 1132
13 geezer 0x0008b19a 0x25000 + 418202
14 libdyld.dylib 0x39c1bab4 start + 0
Thread 1:
0 libsystem_kernel.dylib 0x39cbe808 kevent64 + 24
1 libdispatch.dylib 0x39c00078 _dispatch_mgr_invoke + 228
2 libdispatch.dylib 0x39bffdfe _dispatch_mgr_thread$VARIANT$mp + 34
Thread 2:
0 libsystem_kernel.dylib 0x39cd1c70 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x39d38bda _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x39d38a94 start_wqthread + 4
Thread 3:
0 libsystem_kernel.dylib 0x39cd1c70 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x39d38bda _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x39d38a94 start_wqthread + 4
Thread 4 name: AFNetworking
Thread 4:
0 libobjc.A.dylib 0x3971794c objc_opt::objc_selopt_t::get(char const*) const + 36
1 libobjc.A.dylib 0x39717828 __sel_registerName(char const*, int, int) + 40
2 CFNetwork 0x2e7fec56 ___ZN24ClassicConnectionSession14processDefaultEv_block_invoke + 34
3 libdispatch.dylib 0x39bf681c _dispatch_client_callout + 20
4 libdispatch.dylib 0x39bfe60a dispatch_once_f$VARIANT$mp + 42
5 CFNetwork 0x2e7fec2e ClassicConnectionSession::processDefault() + 38
6 CFNetwork 0x2e7a9e90 URLProtocol::getProtocolRegistry() + 4
7 CFNetwork 0x2e761d28 _CFURLProtocolRegisterFoundationBridge + 8
8 Foundation 0x2f4dfb94 +[_NSCFURLProtocolBridge registerWithCFURLProtocol] + 168
9 Foundation 0x2f4dfa9c NSURLProtocolInit + 316
10 libsystem_pthread.dylib 0x39d3b82c __pthread_once_handler + 48
11 libsystem_platform.dylib 0x39d334e0 _os_once + 40
12 libsystem_pthread.dylib 0x39d39ada pthread_once + 46
13 Foundation 0x2f4aca0c +[NSURLProtocol(NSURLProtocolPrivate) _registeredClasses] + 48
14 libdispatch.dylib 0x39bf681c _dispatch_client_callout + 20
15 libdispatch.dylib 0x39bfe60a dispatch_once_f$VARIANT$mp + 42
16 Foundation 0x2f4abccc -[NSURLConnection(Private) _initWithRequest:delegate:usesCache:maxContentLength:startImmediately:connectionProperties:] + 464
17 Foundation 0x2f4fdd0a -[NSURLConnection initWithRequest:delegate:startImmediately:] + 50
18 geezer 0x0003153a 0x25000 + 50490
19 Foundation 0x2f556c6e __NSThreadPerformPerform + 382
20 CoreFoundation 0x2eb39258 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 12
21 CoreFoundation 0x2eb38726 __CFRunLoopDoSources0 + 202
22 CoreFoundation 0x2eb36f1a __CFRunLoopRun + 618
23 CoreFoundation 0x2eaa1f0a CFRunLoopRunSpecific + 518
24 CoreFoundation 0x2eaa1cee CFRunLoopRunInMode + 102
25 Foundation 0x2f4941e6 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 250
26 Foundation 0x2f4e509c -[NSRunLoop(NSRunLoop) run] + 76
27 geezer 0x0002fd12 0x25000 + 44306
28 Foundation 0x2f556a5a __NSThread__main__ + 1058
29 libsystem_pthread.dylib 0x39d3a916 _pthread_body + 138
30 libsystem_pthread.dylib 0x39d3a886 _pthread_start + 98
31 libsystem_pthread.dylib 0x39d38aa0 thread_start + 4
Thread 5 name: com.apple.NSURLConnectionLoader
Thread 5:
0 libsystem_kernel.dylib 0x39cbea58 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x39cbe854 mach_msg + 44
2 CoreFoundation 0x2eb38896 __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x2eb36fbc __CFRunLoopRun + 780
4 CoreFoundation 0x2eaa1f0a CFRunLoopRunSpecific + 518
5 CoreFoundation 0x2eaa1cee CFRunLoopRunInMode + 102
6 Foundation 0x2f4e1082 +[NSURLConnection(Loader) _resourceLoadLoop:] + 314
7 Foundation 0x2f556a5a __NSThread__main__ + 1058
8 libsystem_pthread.dylib 0x39d3a916 _pthread_body + 138
9 libsystem_pthread.dylib 0x39d3a886 _pthread_start + 98
10 libsystem_pthread.dylib 0x39d38aa0 thread_start + 4
Thread 0 crashed with ARM Thread State (32-bit):
r0: 0x00000000 r1: 0x00000000 r2: 0x00000000 r3: 0x00002060
r4: 0x00000006 r5: 0x3bcb518c r6: 0x00000000 r7: 0x27dde584
r8: 0x17d745a0 r9: 0x00000001 r10: 0x000e6070 r11: 0x000e3994
ip: 0x00000148 sp: 0x27dde578 lr: 0x39d3b797 pc: 0x39cd11f0
cpsr: 0x00000010
Update: After reading tonnes of stuff on the internet about symbolicating, finally I managed to do it with Xcode 5. Some were pretty complicated with the need to use the terminal. Luckily all I needed to do was to go to Organizer in Xcode, grab the latest Archive in Finder. Show Package Contents from that file to get the dsym folder. Copy it out to a folder together with the ipa file and then just install the ipa through Organizer. The crash log will look much more meaningful.
After reading tonnes of stuff on the internet about symbolicating, finally I managed to do it with Xcode 5. Some were pretty complicated with the need to use the terminal. Luckily all I needed to do was to go to Organizer in Xcode, grab the latest Archive in Finder. Show Package Contents from that file to get the dsym folder. Copy it out to a folder together with the ipa file and then just install the ipa through Organizer. The crash log will look much more meaningful.

App Crash on setRightButton. No idea why

I trying to figure out why my App crashes sometimes on costumers devices. My App is from the AppStore. It happend not always, only in rare cases it seams.
Here is the used codeblock
[UIView animateWithDuration:0.3 animations:^(void){ [self.spinner setAlpha:0.0]; } completion:^(BOOL finished){
if(self.spinner != nil){
[self.spinner removeFromSuperview];
self.spinner = nil;
UIBarButtonItem *externButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:#selector(openBrowser)];
[self.navigationItem setRightBarButtonItem:externButton animated:YES];
}
}];
It crashes on setRightBarButtomItem:animated:. The codeblock is executed in an Background-Thread. Is that the Problem?
Here the crashlog:
Hardware Model: iPhone5,2
Process: [THE APP] [3052]
Path: (null)
Identifier: [THE APP]
Version: 3.9.0 (3.9.0)
Code Type: ARM
Parent Process: launchd [1]
Date/Time: 2013-11-09 16:07:04.000 +0100
OS Version: iPhone OS 7.0 (11A465)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x7000000c
Crashed Thread: 13
Thread 0:
0 CoreFoundation 0x30781224 __CFStringCreateImmutableFunnel3 + 1160
1 CoreFoundation 0x306dbf38 CFStringCreateWithBytes + 48
2 Foundation 0x310c49e8 -[NSPlaceholderString initWithBytes:length:encoding:] + 100
3 Foundation 0x310c4968 +[NSString stringWithUTF8String:] + 124
4 Foundation 0x310c48b0 NSStringFromClass + 128
5 UIKit 0x32fddb68 +[_UIAppearanceCustomizableClassInfo _customizableClassInfoForViewClass:withGuideClass:] + 260
6 UIKit 0x32fddd90 -[_UIAppearanceCustomizableClassInfo _superClassInfo] + 160
7 UIKit 0x32fddcc8 existingAppearancesNodesInNodeForClassAndSuperclasses + 136
8 UIKit 0x32fdd1d0 +[_UIAppearance _applyInvocationsTo:window:matchingSelector:] + 164
9 UIKit 0x32fdd120 +[_UIAppearance _applyInvocationsTo:window:] + 24
10 UIKit 0x32f32488 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 176
11 QuartzCore 0x32bb9f40 -[CALayer layoutSublayers] + 140
12 QuartzCore 0x32bb5760 CA::Layer::layout_if_needed(CA::Transaction*) + 344
13 UIKit 0x32f47410 -[UIView(Hierarchy) layoutBelowIfNeeded] + 532
14 UIKit 0x32fe9810 -[UIBarButtonItem(UIStatic) _leftRightImagePaddingForEdgeMarginInNavBarIsMini:] + 360
15 UIKit 0x32fcf140 -[UINavigationBar _getTitleViewFrame:leftViewFrames:rightViewFrames:forItemAtIndex:returnedIdealWidthOfTextContent:availableLayoutWidthForTextContent:idealBackButtonWidth:] + 2504
16 UIKit 0x32fc6e38 -[UINavigationBar _getTitleViewFrame:leftViewFrames:rightViewFrames:forItemAtIndex:] + 632
17 UIKit 0x32fc6bb8 -[UINavigationBar _getTitleViewFrame:leftViewFrames:rightViewFrames:] + 136
18 UIKit 0x32fcd080 -[UINavigationBar _setLeftViews:rightViews:] + 1248
19 UIKit 0x32fca2b8 -[UINavigationBar _pushNavigationItem:transition:] + 464
20 UIKit 0x32fc9e98 __71-[UINavigationController pushViewController:transition:forceImmediate:]_block_invoke + 148
21 UIKit 0x32fe13a0 -[UINavigationController _startDeferredTransitionIfNeeded:] + 868
22 UIKit 0x32fe0fe8 -[UINavigationController __viewWillLayoutSubviews] + 44
23 UIKit 0x32fe0f78 -[UILayoutContainerView layoutSubviews] + 180
24 UIKit 0x32f32530 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 344
25 QuartzCore 0x32bb9f40 -[CALayer layoutSublayers] + 140
26 QuartzCore 0x32bb5760 CA::Layer::layout_if_needed(CA::Transaction*) + 344
27 QuartzCore 0x32bb55f8 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 16
28 QuartzCore 0x32bb5008 CA::Context::commit_transaction(CA::Transaction*) + 224
29 QuartzCore 0x32bb4e18 CA::Transaction::commit() + 308
30 QuartzCore 0x32baeb48 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 52
31 CoreFoundation 0x30777f70 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 20
32 CoreFoundation 0x307758f8 __CFRunLoopDoObservers + 280
33 CoreFoundation 0x30775c48 __CFRunLoopRun + 736
34 CoreFoundation 0x306e0540 CFRunLoopRunSpecific + 524
35 CoreFoundation 0x306e0320 CFRunLoopRunInMode + 104
36 GraphicsServices 0x354172e8 GSEventRunModal + 136
37 UIKit 0x32f971e0 UIApplicationMain + 1132
38 [THE APP] 0x00059f48 main (main.m:21)
Thread 1:
0 libsystem_kernel.dylib 0x3b043838 kevent64 + 24
1 libdispatch.dylib 0x3af8c640 _dispatch_mgr_thread + 36
Thread 2:
0 libsystem_kernel.dylib 0x3b056c7c __workq_kernreturn + 8
Thread 3:
0 libsystem_kernel.dylib 0x3b056c7c __workq_kernreturn + 8
Thread 4:
0 libsystem_kernel.dylib 0x3b043a84 mach_msg_trap + 20
1 CoreFoundation 0x30777560 __CFRunLoopServiceMachPort + 156
2 CoreFoundation 0x30775c80 __CFRunLoopRun + 792
3 CoreFoundation 0x306e0540 CFRunLoopRunSpecific + 524
4 CoreFoundation 0x306e0320 CFRunLoopRunInMode + 104
5 Foundation 0x3111b650 +[NSURLConnection(Loader) _resourceLoadLoop:] + 320
6 Foundation 0x31190dc0 __NSThread__main__ + 1056
7 libsystem_pthread.dylib 0x3b0bcc58 _pthread_body + 136
8 libsystem_pthread.dylib 0x3b0bcbc8 _pthread_start + 96
Thread 5:
0 libsystem_kernel.dylib 0x3b056c7c __workq_kernreturn + 8
Thread 6:
0 libsystem_kernel.dylib 0x3b056c7c __workq_kernreturn + 8
Thread 7:
0 libsystem_kernel.dylib 0x3b056550 __semwait_signal + 24
1 Foundation 0x311904d8 +[NSThread sleepForTimeInterval:] + 144
2 [THE APP] 0x0014a870 -[KSCrashDeadlockMonitor runMonitor] + 232
3 Foundation 0x31190dc0 __NSThread__main__ + 1056
4 libsystem_pthread.dylib 0x3b0bcc58 _pthread_body + 136
5 libsystem_pthread.dylib 0x3b0bcbc8 _pthread_start + 96
Thread 8:
0 libsystem_kernel.dylib 0x3b043a84 mach_msg_trap + 20
1 [THE APP] 0x001469e0 ksmachexc_i_handleExceptions + 128
2 libsystem_pthread.dylib 0x3b0bcc58 _pthread_body + 136
3 libsystem_pthread.dylib 0x3b0bcbc8 _pthread_start + 96
Thread 9:
Thread 10:
0 libsystem_kernel.dylib 0x3b056c7c __workq_kernreturn + 8
Thread 11:
0 libsystem_kernel.dylib 0x3b056440 select$DARWIN_EXTSN + 20
1 libsystem_pthread.dylib 0x3b0bcc58 _pthread_body + 136
2 libsystem_pthread.dylib 0x3b0bcbc8 _pthread_start + 96
Thread 12:
0 libsystem_kernel.dylib 0x3b056c7c __workq_kernreturn + 8
Thread 13 Crashed:
0 libobjc.A.dylib 0x3aaa1b66 objc_msgSend + 6
1 UIKit 0x32fe4b80 -[UINavigationItem updateNavigationBarButtonsAnimated:] + 156
2 UIKit 0x32fe46e8 -[UINavigationItem setRightBarButtonItem:animated:] + 156
3 [THE APP] 0x000c6058 -[ProductViewController loadXML] (ProductViewController.m:978)
4 Foundation 0x31190dc0 __NSThread__main__ + 1056
5 libsystem_pthread.dylib 0x3b0bcc58 _pthread_body + 136
6 libsystem_pthread.dylib 0x3b0bcbc8 _pthread_start + 96
Thread 13 crashed with ARM Thread State:
r0: 0x15e78c40 r1: 0x33517435 r2: 0x00000000 r3: 0x00000000
r4: 0x33517435 r5: 0x33530ea0 r6: 0x15e83b00 r7: 0x037a2be0
r8: 0x15d56570 r9: 0x70000000 r10: 0x00000000 r11: 0x00000001
ip: 0x3b5be224 sp: 0x037a27f0 lr: 0x32fccffb pc: 0x3aaa1b66
cpsr: 0x20000030
Binary Images:
[cut cause of char limit]
Any ideas? Thanks for the help!
First of all you shouldn't run this in a background thread.
Secondly BAD_ACCESS usually happens when you over-release something.
I can't figure out where you over-release but maybe you can find it in your code. my guess is the navigation item tries to release something before setting your externButton...
EDIT: where is this code happening at? could be that the UIViewController isn't pushed anymore into the navigation controller or not the top one by the time this code is executed?
Things that update the UI should be on the main thread.
dispatch_async(dispatch_get_main_queue(), ^{ /* UI code goes here */ });

solve Crash Log in ios

I have an app of sending free text MSG ..
While i select a contact i got my application crash and from crash log i didn't get solution of it ..
Can any one tell me how to solve crash log with proper stapes ..
Here is my Crash Log :
Incident Identifier: A8E3BBD6-CD0D-45C8-8134-65EF03CBFF5E
CrashReporter Key: 64c47e02a46dcc17a25718b8b3d9f579f535b545
Hardware Model: iPhone2,1
Process: [6703]
Path: /var/mobile/Applications/9055F800-A876-4D5E-B1CD-202BC6F80BDB/.app/
Identifier:
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2011-11-24 13:27:16.113 +0530
OS Version: iPhone OS 4.1 (8B117)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x656a6277
Crashed Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x000027d8 objc_msgSend + 16
1 CoreFoundation 0x000042ae CFRetain + 62
2 CoreFoundation 0x0002832a +[__NSArrayI __new::] + 54
3 CoreFoundation 0x00028152 -[__NSPlaceholderArray initWithObjects:count:] + 122
4 CoreFoundation 0x00027ef4 +[NSArray arrayWithObjects:] + 356
5 0x00033fcc 0x1000 + 208844
6 0x00033f46 0x1000 + 208710
7 UIKit 0x0022fb26 -[UISearchDisplayController searchBar:textDidChange:] + 78
8 UIKit 0x001f48aa -[UISearchBar(UISearchBarStatic) _searchFieldEditingChanged] + 106
9 CoreFoundation 0x00047712 -[NSObject(NSObject) performSelector:withObject:withObject:] + 18
10 UIKit 0x0010dfa0 -[UIApplication sendAction:fromSender:toTarget:forEvent:] + 76
11 UIKit 0x00137c00 -[UIControl(Deprecated) sendAction:toTarget:forEvent:] + 28
12 UIKit 0x000ab930 -[UIControl(Internal) _sendActionsForEventMask:withEvent:] + 352
13 UIKit 0x000dd888 -[UITextField fieldEditorDidChange:] + 188
14 UIKit 0x000dd6c0 -[UIFieldEditor webViewDidChange:] + 48
15 Foundation 0x000146ac _nsnote_callback + 136
16 CoreFoundation 0x0002670c __CFXNotificationPost_old + 396
17 CoreFoundation 0x000263ac _CFXNotificationPostNotification + 112
18 Foundation 0x00003db0 -[NSNotificationCenter postNotificationName:object:userInfo:] + 64
19 CoreFoundation 0x0004b42c __invoking___ + 60
20 CoreFoundation 0x0004b2fe -[NSInvocation invoke] + 102
21 WebCore 0x00049816 SendMessage(NSInvocation*) + 10
22 WebCore 0x00057dc0 SendDelegateMessage(NSInvocation*) + 700
23 WebCore 0x000617f4 WebThreadPostNotification + 88
24 WebKit 0x0001347c WebEditorClient::respondToChangedContents() + 24
25 WebCore 0x0026d8ce WebCore::Editor::respondToChangedContents(WebCore::VisibleSelection const&) + 98
26 WebCore 0x0026db34 WebCore::Editor::appliedEditing(WTF::PassRefPtr<WebCore::EditCommand>) + 204
27 WebCore 0x004e852a WebCore::TypingCommand::insertTextRunWithoutNewlines(WebCore::String const&, bool) + 258
28 WebCore 0x004e8606 WebCore::TypingCommand::insertText(WebCore::String const&, bool) + 134
29 WebCore 0x004e6c7a WebCore::TypingCommand::doApply() + 126
30 WebCore 0x0026af2e WebCore::EditCommand::apply() + 86
31 WebCore 0x0026af8c WebCore::applyCommand(WTF::PassRefPtr<WebCore::EditCommand>) + 4
32 WebCore 0x004e8ba6 WebCore::TypingCommand::insertText(WebCore::Document*, WebCore::String const&, WebCore::VisibleSelection const&, bool, bool) + 526
33 WebCore 0x0027020a WebCore::Editor::insertTextWithoutSendingTextEvent(WebCore::String const&, bool, WebCore::Event*) + 210
34 WebCore 0x002751e0 WebCore::EventHandler::defaultTextInputEventHandler(WebCore::TextEvent*) + 76
35 WebCore 0x00066a86 WebCore::Node::defaultEventHandler(WebCore::Event*) + 342
36 WebCore 0x000666e2 WebCore::Node::dispatchGenericEvent(WTF::PassRefPtr<WebCore::Event>) + 578
37 WebCore 0x00066440 WebCore::Node::dispatchEvent(WTF::PassRefPtr<WebCore::Event>) + 144
38 WebCore 0x00164232 WebCore::EventTarget::dispatchEvent(WTF::PassRefPtr<WebCore::Event>, int&) + 54
39 WebCore 0x0027535c WebCore::EventHandler::handleTextInputEvent(WebCore::String const&, WebCore::Event*, bool, bool) + 43 WebCore 0x004ee42c -[WAKResponder tryToPerform:with:] + 40
44 WebKit 0x000122ac -[WebView(WebViewEditingActions) _performResponderOperation:with:] + 76
45 WebKit 0x00012254 -[WebView(WebViewEditingActions) insertText:] + 16
46 UIKit 0x00100f46 -[UIWebDocumentView insertText:] + 26
47 UIKit 0x0010076c -[UIKeyboardImpl addInputString:fromVariantK
ey:] + 2504
48 UIKit 0x000ffd80 -[UIKeyboardImpl handleStringInput:fromVariantKey:] + 128
49 UIKit 0x000fec0c -[UIKeyboardImpl handleKeyEvent:] + 1292
50 UIKit 0x000fe6ec -[UIApplication _handleKeyEvent:] + 28
51 UIKit 0x000fe6be -[UIResponder(Internal) _handleKeyEvent:] + 22
52 UIKit 0x000fe6be -[UIResponder(Internal) _handleKeyEvent:] + 22
53 UIKit 0x000fe6be -[UIResponder(Internal) _handleKeyEvent:] + 22
54 UIKit 0x000fe6be -[UIResponder(Internal) _handleKeyEvent:] + 22
55 UIKit 0x000fe6be -[UIResponder(Internal) _handleKeyEvent:] + 22
56 UIKit 0x000fe6be -[UIResponder(Internal) _handleKeyEvent:] + 22
57 UIKit 0x000fe694 -[UIApplication handleKeyEvent:] + 40
58 UIKit 0x000fe5ae -[UIKeyboardLayoutStar sendStringAction:forKey:] + 394
59 UIKit 0x000fc2e4 -[UIKeyboardLayoutStar touchUp:] + 1656
60 UIKit 0x000fbbe0 -[UIKeyboardLayout touchesEnded:withEvent:] + 296
61 UIKit 0x00062dd6 -[UIWindow _sendTouchesForEvent:] + 362
62 UIKit 0x00062750 -[UIWindow sendEvent:] + 256
63 UIKit 0x0005d9f8 -[UIApplication sendEvent:] + 292
64 UIKit 0x0005d330 _UIApplicationHandleEvent + 5104
65 GraphicsServices 0x00005044 PurpleEventCallback + 660
66 CoreFoundation 0x00034cdc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 20
67 CoreFoundation 0x00034ca0 __CFRunLoopDoSource1 + 160
68 CoreFoundation 0x00027566 __CFRunLoopRun + 514
69 CoreFoundation 0x00027270 CFRunLoopRunSpecific + 224
70 CoreFoundation 0x00027178 CFRunLoopRunInMode + 52
71 GraphicsServices 0x000045ec GSEventRunModal + 108
72 GraphicsServices 0x00004698 GSEventRun + 56
73 UIKit 0x0000411c -[UIApplication _run] + 396
74 UIKit 0x00002128 UIApplicationMain + 664
75 0x0000265a 0x1000 + 5722
76 0x1000 + 5668
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 0x0007b19c __workq_kernreturn + 8
1 libSystem.B.dylib 0x0007a790 _pthread_wqthread + 536
2 libSystem.B.dylib 0x00073190 start_wqthread + 0
Thread 3:
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 4:
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 CFNetwork 0x00069074 CFURLConnectionSendSynchronousRequest + 244
7 Foundation 0x000aed8c +[NSURLConnection sendSynchronousRequest:returningResponse:error:] + 76
8 0x00025ea4 0x1000 + 151204
9 0x000296c8 0x1000 + 165576
10 Foundation 0x0000b222 -[NSThread main] + 38
11 Foundation 0x000042d6 __NSThread__main__ + 966
12 libSystem.B.dylib 0x0007a27e _pthread_start + 242
13 libSystem.B.dylib 0x0006f2a8 thread_start + 0
Thread 5:
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 Foundation 0x0002d686 +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:] + 206
7 Foundation 0x0000b222 -[NSThread main] + 38
8 Foundation 0x000042d6 __NSThread__main__ + 966
9 libSystem.B.dylib 0x0007a27e _pthread_start + 242
10 libSystem.B.dylib 0x0006f2a8 thread_start + 0
Thread 6:
0 libSystem.B.dylib 0x00025060 select$DARWIN_EXTSN + 20
1 CoreFoundation 0x0005edfc __CFSocketManager + 540
2 libSystem.B.dylib 0x0007a27e _pthread_start + 242
3 libSystem.B.dylib 0x0006f2a8 thread_start + 0
Thread 7:
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 8:
0 libSystem.B.dylib 0x00000c98 mach_msg_trap + 20
1 libSystem.B.dylib 0x00002d64 mach_msg + 44
2 libSystem.B.dylib 0x0002591e thread_policy + 118
3 libSystem.B.dylib 0x00025896 pthread_setschedparam_internal + 62
4 libSystem.B.dylib 0x000257d0 pthread_setschedparam + 68
5 UIKit 0x00100ea2 InitTextChecker + 22
6 libSystem.B.dylib 0x0007a27e _pthread_start + 242
7 libSystem.B.dylib 0x0006f2a8 thread_start + 0
Thread 0 crashed with ARM Thread State:
r0: 0x32ca2efa r1: 0x32ca3270 r2: 0x656a626f r3: 0x339737c9
r4: 0x656a626f r5: 0x3e8055e4 r6: 0x00000005 r7: 0x2fffd824
r8: 0x06417f18 r9: 0x2fffd7c0 r10: 0x06417f10 r11: 0x2fffd870
ip: 0x3e7f23e4 sp: 0x2fffd80c lr: 0x3440f2b5 pc: 0x339737d8
cpsr: 0x20010030
Thanks in Advance ....
arrayWithObjects: takes a nil terminated list of object ids. You might have forget the nil
myArray = [NSArray arrayWithObjects:aDate, aValue, aString, nil];
Check reference
Without any details (like a completely symbolicated crash log and the corresponding code) this is like looking into a crystal ball: we have to guess.
From the crash log I'd say you create an array (via [NSArray arrayWithObjects:]) and feed it something that is not an Objective-C object. Maybe you forgot to add nil as the last object in the list? It's necessary so Objective-C knows where your list of objects ends.
You are getting EXC_BAD_ACCESS that means you are trying to reach a released object. Best practice is to put some break points and go step by step. I also recommend you to turn the zombies on. Product->Edit Scheme->Diagnostics and check Enable Zombie Objects.
after you do this when you crash you can see the point you crash and which method is trying to reach the released object.
The crash log gives you some information, which is not much, but better than nothing if you are not able to reproduce the crash yourself.
As you can see from these lines:
4 CoreFoundation 0x00027ef4 +[NSArray arrayWithObjects:] + 356
5 - 0x00033fcc 0x1000 + 208844
6 - 0x00033f46 0x1000 + 208710
7 UIKit 0x0022fb26 -[UISearchDisplayController searchBar:textDidChange:] + 78
the crash happens after a change in your searchBar, which triggers the corresponding action in your code. The action then tries to create an array and it crashes.
So, I would start checking the action that you associated to the search bar and see what happens there. You could also post it here, so that we can have a look.

iPhone app crashes when coming to foreground

I have an application that is communicating to a device through the accessory port. When the device is spitting data (at a rate of one 13-byte packet every 20 ms, so not very quickly) to the iPhone, if I press the home button to send the app to the background, then open it again it will crash. I have added listeners to the UIApplicationDidBecomeActiveNotification and UIApplicationWillResignActiveNotification to shut down the data transmission when the app goes to the background, and turn it back on when it comes back, and now it doesn't crash all the time, but irregularly. When it crashes, it crashes even before it sends the UIApplicationDidBecomeActiveNotification.
Here's the Device Log from the error:
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000004
Crashed Thread: 3
Thread 0:
0 libSystem.B.dylib 0x000016a8 semaphore_wait_trap + 8
1 libSystem.B.dylib 0x0002ed9e semaphore_wait + 2
2 libSystem.B.dylib 0x000d7ce4 _dispatch_semaphore_wait_slow + 296
3 libSystem.B.dylib 0x000d64a0 _dispatch_barrier_sync_f_slow + 128
4 CoreFoundation 0x0001511e CFMachPortCreateRunLoopSource + 118
5 QuartzCore 0x00005466 CA::Context::client_port() + 78
6 QuartzCore 0x00005310 CA::Context::connect_remote() + 244
7 QuartzCore 0x00004fda -[CAContextImpl initRemoteWithOptions:] + 26
8 QuartzCore 0x00004f9c +[CAContext remoteContextWithOptions:] + 28
9 UIKit 0x0000dae0 -[UIWindow _createContext] + 532
10 UIKit 0x0015957e _UIWindowUpdateVisibleContextOrder + 98
11 UIKit 0x0015962a +[UIWindow _prepareWindowsForAppResume] + 10
12 UIKit 0x00152824 -[UIApplication _handleApplicationResumeEvent:] + 68
13 UIKit 0x0005da80 -[UIApplication handleEvent:withNewEvent:] + 3772
14 UIKit 0x0005ca56 -[UIApplication sendEvent:] + 38
15 UIKit 0x0005c500 _UIApplicationHandleEvent + 5016
16 GraphicsServices 0x00004140 PurpleEventCallback + 660
17 GraphicsServices 0x000041ca PurpleEventSignalCallback + 10
18 CoreFoundation 0x00071a86 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION_ + 6
19 CoreFoundation 0x000736ac _CFRunLoopDoSources0 + 188
20 CoreFoundation 0x00074504 _CFRunLoopRun + 224
21 CoreFoundation 0x0001d8e4 CFRunLoopRunSpecific + 224
22 CoreFoundation 0x0001d7ec CFRunLoopRunInMode + 52
23 GraphicsServices 0x000036e8 GSEventRunModal + 108
24 GraphicsServices 0x00003794 GSEventRun + 56
25 UIKit 0x000062a0 -[UIApplication _run] + 396
26 UIKit 0x00004e10 UIApplicationMain + 664
27 TestRaspLayer 0x00003034 main (main.m:14)
28 TestRaspLayer 0x00002fe8 start + 32
Thread 1:
0 libSystem.B.dylib 0x0002dc4c kevent + 24
1 libSystem.B.dylib 0x000d6e44 _dispatch_mgr_invoke + 88
2 libSystem.B.dylib 0x000d6894 _dispatch_queue_invoke + 96
3 libSystem.B.dylib 0x000d6a34 _dispatch_worker_thread2 + 120
4 libSystem.B.dylib 0x0007ad82 _pthread_wqthread + 258
5 libSystem.B.dylib 0x00073fcc start_wqthread + 0
Thread 2:
0 libSystem.B.dylib 0x00001658 mach_msg_trap + 20
1 libSystem.B.dylib 0x00003724 mach_msg + 44
2 CoreFoundation 0x000722c8 _CFRunLoopServiceMachPort + 88
3 CoreFoundation 0x00074582 _CFRunLoopRun + 350
4 CoreFoundation 0x0001d8e4 CFRunLoopRunSpecific + 224
5 CoreFoundation 0x0001d7ec CFRunLoopRunInMode + 52
6 WebCore 0x00003056 RunWebThread(void*) + 362
7 libSystem.B.dylib 0x0007a986 _pthread_start + 242
8 libSystem.B.dylib 0x000700e4 thread_start + 0
Thread 3 Crashed:
0 libicucore.A.dylib 0x00001bd0 uhash_get + 24
1 libicucore.A.dylib 0x00055b10 ures_hasNext + 720
2 libicucore.A.dylib 0x00055d08 ures_hasNext + 1224
3 libicucore.A.dylib 0x00055e64 ures_hasNext + 1572
4 libicucore.A.dylib 0x00003a28 ures_openDirect + 80
5 libicucore.A.dylib 0x000b4dee icu::TimeZone::getGMT() + 442
6 libicucore.A.dylib 0x0000861a icu::TimeZone::createSystemTimeZone(icu::UnicodeString const&) + 22
7 libicucore.A.dylib 0x0000cf90 icu::TimeZone::createTimeZone(icu::UnicodeString const&) + 4
8 libicucore.A.dylib 0x000bc6f8 ucal_setAttribute + 96
9 libicucore.A.dylib 0x0000d650 ucal_open + 32
10 CoreFoundation 0x000a7968 _CFCalendarCreateUCalendar + 160
11 CoreFoundation 0x00029cde CFCalendarCreateWithIdentifier + 362
12 CoreFoundation 0x0008d128 _CFLogCString + 472
13 CoreFoundation 0x00029b52 _CFLogvEx + 166
14 CoreFoundation 0x0003d63e CFLog + 26
15 CoreFoundation 0x00015184 _CFAutoreleasePoolPop + 52
16 Foundation 0x0000422a NSPopAutoreleasePool + 2
17 Foundation 0x0000de16 -[_NSOperationInternal start] + 910
18 Foundation 0x0000da78 -[NSOperation start] + 16
19 Foundation 0x0007e5b4 _startOperations_block_invoke_2 + 40
20 libSystem.B.dylib 0x000d5c54 _dispatch_call_block_and_release + 12
21 libSystem.B.dylib 0x000d6a34 _dispatch_worker_thread2 + 120
22 libSystem.B.dylib 0x0007ad82 _pthread_wqthread + 258
23 libSystem.B.dylib 0x00073fcc start_wqthread + 0
Thread 4:
0 libSystem.B.dylib 0x00001f8e memcpy + 718
1 TestRaspLayer 0x00007718 _inline_memcpy_chk (_string.h:58)
2 TestRaspLayer 0x00007678 -[SERIALPort processRxBuffer] (SERIALPort.m:243)
3 CoreFoundation 0x0009f06c _invoking_ + 60
4 CoreFoundation 0x00032706 -[NSInvocation invoke] + 102
5 Foundation 0x0007eb50 -[NSInvocationOperation main] + 72
6 Foundation 0x0000dd14 -[_NSOperationInternal start] + 652
7 Foundation 0x0000da78 -[NSOperation start] + 16
8 Foundation 0x0007e5b4 _startOperations_block_invoke_2 + 40
9 libSystem.B.dylib 0x000d5c54 _dispatch_call_block_and_release + 12
10 libSystem.B.dylib 0x000d6a34 _dispatch_worker_thread2 + 120
11 libSystem.B.dylib 0x0007ad82 _pthread_wqthread + 258
12 libSystem.B.dylib 0x00073fcc start_wqthread + 0
Thread 3 crashed with ARM Thread State:
r0: 0x00000000 r1: 0x0000007f r2: 0x00000077 r3: 0x80000001
r4: 0x0013fc50 r5: 0x0038003c r6: 0x0038012c r7: 0x0037ff70
r8: 0x00000000 r9: 0xffffffff r10: 0x0013fcb4 r11: 0x00000000
ip: 0x00000077 sp: 0x0037ff68 lr: 0x339fbe09 pc: 0x339b8bd0
cpsr: 0x50000030
Will your app crash when the device is disconnected or idle, or does the crash only occur when the device is sending data?
I think
Thread 4:
0 libSystem.B.dylib 0x00001f8e memcpy + 718
1 TestRaspLayer 0x00007718 _inline_memcpy_chk (_string.h:58)
2 TestRaspLayer 0x00007678 -[SERIALPort processRxBuffer] (SERIALPort.m:243)
is where the app crashes, the problem could be from method processRXBuffer in SERIALPort class.
Double check you code and you'll find where the problem is.

Resources