I have an app which seems to work fine in debug mode, but now it's live in the app store it crashes every time. I have managed to find a crash log, which shows the following:
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Crashed Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x3238329e __exceptionPreprocess + 158
1 libobjc.A.dylib 0x3a22e97a objc_exception_throw + 26
2 UIKit 0x3451837c +[UIStoryboard storyboardWithName:bundle:] + 436
3 UIKit 0x3435a58e -[UIApplication _loadMainStoryboardFileNamed:bundle:] + 38
4 UIKit 0x341e379c -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 524
5 UIKit 0x3418bc34 -[UIApplication handleEvent:withNewEvent:] + 1000
6 UIKit 0x3418b6c8 -[UIApplication sendEvent:] + 68
7 UIKit 0x3418b116 _UIApplicationHandleEvent + 6150
8 GraphicsServices 0x35e9659e _PurpleEventCallback + 586
9 GraphicsServices 0x35e961ce PurpleEventCallback + 30
10 CoreFoundation 0x3235816e __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 30
11 CoreFoundation 0x32358112 __CFRunLoopDoSource1 + 134
12 CoreFoundation 0x32356f94 __CFRunLoopRun + 1380
13 CoreFoundation 0x322c9eb8 CFRunLoopRunSpecific + 352
14 CoreFoundation 0x322c9d44 CFRunLoopRunInMode + 100
15 UIKit 0x341e2480 -[UIApplication _run] + 664
16 UIKit 0x341df2fc UIApplicationMain + 1116
Does anyone know what this means? I really need to submit an update for this app quickly so I need to fix it.
One great place to start is this link:
http://www.raywenderlich.com/23704/demystifying-ios-application-crash-logs
It will show you how to read your crash log.
For instance EXC_CRASH (SIGABRT) means:
The exception code is a SIGABRT. Usually, a SIGABRT exception is raised when an object receives an unimplemented message. Or to put it in simpler terms, there’s a call for a nonexistent method on an object.
This should give you a hint as to what the problem is. It's not in your code as you can see that your classes are not called in the list to the right.
I would also say that if it doesn't work in the app store you might make sure that it works for all languages on Ad-Hoc. Maybe something is missing from your storyboard?
Check the storyboard names. Make sure you have a main storyboard selected for ipad and that the name matches.
Related
Here is my crash report and this is irrespective of the iOS version and the device. Also I would like to know, is SIGSEGV_ACCERR is something related to memory. Can you Please help me nailing down this issue. I have a bunch of crash reports with the below log
Date/Time: 2012-09-25 23:55:33 +0000
OS Version: iPhone OS 5.1.1 (9B206)
Report Version: 104
Exception Type: SIGSEGV
Exception Codes: SEGV_ACCERR at 0x60000008
Crashed Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x37734f78 objc_msgSend + 16
1 UIKit 0x32e0c503 -[UINavigationController _startDeferredTransitionIfNeeded] + 251
2 UIKit 0x32e568eb _popViewControllerNormal + 191
3 UIKit 0x32e56719 -[UINavigationController _popViewControllerWithTransition:allowPoppingLast:] + 393
4 UIKit 0x32e56c79 -[UINavigationController navigationBar:shouldPopItem:] + 153
5 UIKit 0x32e56a8f -[UINavigationBar _popNavigationItemWithTransition:] + 99
6 UIKit 0x32ea6247 -[UINavigationBar popNavigationItemAnimated:] + 123
7 UIKit 0x32ea60d5 -[UINavigationBar _handleMouseUpAtPoint:] + 925
8 UIKit 0x32ea5d33 -[UINavigationBar touchesEnded:withEvent:] + 83
9 UIKit 0x32de192b -[UIWindow _sendTouchesForEvent:] + 319
10 UIKit 0x32de1319 -[UIWindow sendEvent:] + 381
11 UIKit 0x32dc7695 -[UIApplication sendEvent:] + 357
12 UIKit 0x32dc6f3b _UIApplicationHandleEvent + 5827
13 GraphicsServices 0x36f8622b PurpleEventCallback + 883
14 CoreFoundation 0x35367523 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 39
15 CoreFoundation 0x353674c5 __CFRunLoopDoSource1 + 141
16 CoreFoundation 0x35366313 __CFRunLoopRun + 1371
17 CoreFoundation 0x352e94a5 CFRunLoopRunSpecific + 301
18 CoreFoundation 0x352e936d CFRunLoopRunInMode + 105
19 GraphicsServices 0x36f85439 GSEventRunModal + 137
20 UIKit 0x32df5cd5 UIApplicationMain + 1081
21 Myapp 0x00003597 main (main.m:20)
A very quick google of SIGSEGV will tell you exactly what it is (a signal meaning a segmentation violation). Those links will also teach you why it happens.
From the stack trace, you can see that the main loop is handling a touch in the navigation bar., which results in a pop transition. While popping the view controller, a bad memory access crashes the app.
It even tells you the address it tried to access (which resulted in the crash): 0x60000008 Doesn't that address look a bit too "neat?"
So, I'd first try to recreate it in the debugger. I'd also add some logging in my view controllers that are pushed/popped so I can tell which one is causing the crash.
You can guess that it is a direct result of pressing one of the "back" buttons in your navigation controller.
So, I'd also be inclined to look at how I setup my controllers that are pushed on the nav controller and also investigate how you are using the navigation bar (because popping them is causing the crash).
It looks like the crash is happening in the core library, so it must be in the setup of your controller, as there does not appear to be any calls to you code in the stack trace.
My app (named MyLittleApplication) crashes randomly when I click on a button that pops view controller.
I could use some help (to find out where should I start looking) with crash log:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x600332e0
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x351faf78 objc_msgSend + 16
1 Foundation 0x37d0a74c NSKVOPendingNotificationCreate + 216
2 Foundation 0x37d0a652 NSKeyValuePushPendingNotificationPerThread + 62
3 Foundation 0x37cfc744 NSKeyValueWillChange + 408
4 Foundation 0x37cd3848-[NSObject(NSKeyValueObserverNotification) willChangeValueForKey:] + 176
5 Foundation 0x37d55a14 _NSSetPointValueAndNotify + 76
6 UIKit 0x311f825a -[UIScrollView(Static) _adjustContentOffsetIfNecessary] + 1890
7 UIKit 0x31215a54 -[UIScrollView setFrame:] + 548
8 UIKit 0x31215802 -[UITableView setFrame:] + 182
9 POViO 0x000fcac8 0xf8000 + 19144
10 UIKit 0x31211b8e -[UIViewController _setViewAppearState:isAnimating:] + 138
11 UIKit 0x3126b8a8 -[UIViewController beginAppearanceTransition:animated:] + 184
12 UIKit 0x3121490c -[UINavigationController _startTransition:fromViewController:toViewController:] + 832
13 UIKit 0x312144fc -[UINavigationController _startDeferredTransitionIfNeeded] + 244
14 UIKit 0x3125e8e4 _popViewControllerNormal + 184
15 UIKit 0x3125e712 -[UINavigationController _popViewControllerWithTransition:allowPoppingLast:] + 386
16 UIKit 0x31242bba -[UINavigationController popToViewController:transition:] + 626
17 POViO 0x001074e6 0xf8000 + 62694
18 CoreFoundation 0x374553f6 -[NSObject performSelector:withObject:withObject:] + 46
19 UIKit 0x311eae00 -[UIApplication sendAction:to:from:forEvent:] + 56
20 UIKit 0x311eadbc -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 24
21 UIKit 0x311ead9a -[UIControl sendAction:to:forEvent:] + 38
22 UIKit 0x311eab0a -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 486
23 UIKit 0x311eb442 -[UIControl touchesEnded:withEvent:] + 470
24 UIKit 0x311e9924 -[UIWindow _sendTouchesForEvent:] + 312
25 UIKit 0x311e9312 -[UIWindow sendEvent:] + 374
26 UIKit 0x311cf68e -[UIApplication sendEvent:] + 350
27 UIKit 0x311cef34 _UIApplicationHandleEvent + 5820
28 GraphicsServices 0x33c11224 PurpleEventCallback + 876
29 CoreFoundation 0x374cf51c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
30 CoreFoundation 0x374cf4be __CFRunLoopDoSource1 + 134
31 CoreFoundation 0x374ce30c __CFRunLoopRun + 1364
32 CoreFoundation 0x3745149e CFRunLoopRunSpecific + 294
33 CoreFoundation 0x37451366 CFRunLoopRunInMode + 98
34 GraphicsServices 0x33c10432 GSEventRunModal + 130
35 UIKit 0x311fdcce UIApplicationMain + 1074
36 MyLittleApplication 0x000f90ae 0xf8000 + 4270
37 MyLittleApplication 0x000f9048 0xf8000 + 4168
I suspect that it has something to do with notificationCenter and UIDeviceOrientationDidChangeNotifications I use. Is this true or am I looking in the wrong direction?
I am calling
[notificationCenter removeObserver:self name:UIDeviceOrientationDidChangeNotification object:nil]
in viewDidUnload, this shuld be enough?
Can you please tell me what bug should i start looking for?
This is a stacktrace you see the stack of methods called when the crash happened.
You start at the bottom and work yourself up to the top and search for a method call from your app (the stacktrace includes calls from the frameworks too (e.g. -[UIScrollView(Static) _adjustContentOffsetIfNecessary])).
The topmost method call from your app is likely the cause of your error and you can see what the system tried afterwards.
In your case it seems that you call popToViewController and the iOS frameworks try to animate the transition from one UIViewController to the next. There seems to be a problem for the table view to set its frame and scroll to the contentOffset.
This is likely to be caused by a memory error. You get this hint by examining Exception Type: EXC_BAD_ACCESS (SIGSEGV)
EXC_BAD_ACCESS is likely a hint that you try to acces a something which is no more in the memory -> already released.
In general I would recomment to activate exveption breakpoints in Xcode:
Have you set the exception breakpoint?
got to breakpoint editor pane
click on the x in the bottom left corner
choose add exception breakpoint
Now you should see a stacktrace if an exception occurs. And Xcode should be at the line where the crash happens.
The second thing you should get familiar with is the zombie mode in Instruments.
You can find a good introduction to the zombi mode in this video.
In your case, you can see you have a EXC_BAD_ACCESS (SIGSEGV). This means you're trying to access something which isn't here, or at least was here but isn't anymore. If you can replicate the error, try using the Zombies mode of Instruments, it will tell will which thing it was expecting to access. The solution to this problem is often that you released the resource too early a resource you still need.
You might want to throw some NSLog statements in the methods just so you can have an idea of where things are going wrong. Sometimes those iOS messages can be a little cryptic.
I am developing an application to take photos and upload the photos to remote server.
I have customized camera view using overlay view. App allows to take more than 1 photos per time and photos will be saved to device just after taking photos. When I am taking photos app gives memory warning and then crash. Followings are the from crash report. I have talked with Apple support team and they said this is not due to memory issue. This is because of trying to send an action to one of your controller object that no longer exists.
OS Version: iPhone OS 4.3.3 (8J2)
Report Version: 104
Exception Type: EXC_BAD_ACCESS
(SIGSEGV) Exception Codes:
KERN_INVALID_ADDRESS at 0x73980000
Crashed Thread: 0
Thread 0 name: Dispatch queue:
com.apple.main-thread Thread 0
Crashed: 0 libobjc.A.dylib
0x34499c9a objc_msgSend + 18 1
UIKit
0x30a8bc1a
-[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 86 2 CoreFoundation
0x308f056a -[NSObject(NSObject)
performSelector:withObject:withObject:]
+ 18 3 UIKit 0x309feec2 -[UIApplication
sendAction:to:from:forEvent:] + 78 4
UIKit
0x309fee62 -[UIApplication
sendAction:toTarget:fromSender:forEvent:]
+ 26 5 UIKit 0x309fee34 -[UIControl
sendAction:to:forEvent:] + 32 6
UIKit
0x309feb86 -[UIControl(Internal)
_sendActionsForEvents:withEvent:] + 350 7 UIKit
0x309ff41c -[UIControl
touchesEnded:withEvent:] + 336 8
UIKit
0x309e452e
_UIGestureRecognizerSortAndSendDelayedTouches
+ 2194 9 UIKit 0x309e3bfa
_UIGestureRecognizerUpdateObserver + 690 10 CoreFoundation
0x30957a2e
CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION
+ 10 11 CoreFoundation 0x3095945e __CFRunLoopDoObservers +
406 12 CoreFoundation
0x3095a754 __CFRunLoopRun + 848 13
CoreFoundation
0x308eaebc CFRunLoopRunSpecific + 224
14 CoreFoundation
0x308eadc4 CFRunLoopRunInMode + 52 15
GraphicsServices
0x30269418 GSEventRunModal + 108 16
GraphicsServices
0x302694c4 GSEventRun + 56 17 UIKit
0x30a10d62 -[UIApplication _run] +
398 18 UIKit
0x30a0e800 UIApplicationMain + 664 19
hand-e-pix
0x000025a4 main (main.m:14) 20
hand-e-pix
0x0000254c start + 32
Can anyone please help me to identify what cause this problem?
Many Thanks
Regards
Chin
This could easily be related to a retain/release issue. Make sure you balance your reetain/release calls. Also make sure you do not reference any deallocated objects in your code.
You might want to take a look at enabling NSZombieEnabled in order to track this one down.
You can find information about how to enable it here.
I had two apps in xcode, which i wanted to combine, so i started a new project and attempted to put the two apps together in this new one. Was this a really stupid thing to do?
The app now crashes on start up and i have no idea why, i'm 99% the outlets are all connected. It uses xcdatamodel for storage and i've imported the right framework.
Can anyone think of any other things that could be going wrong?
I can attach a zip file with the project in if someone wouldn't mind having a look
Any help is massively appreciated!
Thanks
This is the stack trace:
2010-11-02 08:18:59.903 iStalker[34745:207] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIApplication 0x5b10e20> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key textField.'
*** Call stack at first throw:
(
0 CoreFoundation 0x0256f919 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x026bd5de objc_exception_throw + 47
2 CoreFoundation 0x0256f851 -[NSException raise] + 17
3 Foundation 0x0003bc2b _NSSetUsingKeyValueSetter + 135
4 Foundation 0x0003bb99 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285
5 UIKit 0x004b5d0a -[UIRuntimeOutletConnection connect] + 112
6 CoreFoundation 0x024e5b6f -[NSArray makeObjectsPerformSelector:] + 239
7 UIKit 0x004b4721 -[UINib instantiateWithOwner:options:] + 1041
8 UIKit 0x004b64b5 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
9 UIKit 0x002c59bb -[UIApplication _loadMainNibFile] + 172
10 UIKit 0x002c690d -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 198
11 UIKit 0x002d0452 -[UIApplication handleEvent:withNewEvent:] + 1958
12 UIKit 0x002c9074 -[UIApplication sendEvent:] + 71
13 UIKit 0x002cdac4 _UIApplicationHandleEvent + 7495
14 GraphicsServices 0x02dd5afa PurpleEventCallback + 1578
15 CoreFoundation 0x02550dc4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
16 CoreFoundation 0x024b1737 __CFRunLoopDoSource1 + 215
17 CoreFoundation 0x024ae9c3 __CFRunLoopRun + 979
18 CoreFoundation 0x024ae280 CFRunLoopRunSpecific + 208
19 CoreFoundation 0x024ae1a1 CFRunLoopRunInMode + 97
20 UIKit 0x002c6226 -[UIApplication _run] + 625
21 UIKit 0x002d1b58 UIApplicationMain + 1160
22 iStalker 0x00001b50 main + 102
23 iStalker 0x00001ae1 start + 53
)
terminate called after throwing an instance of 'NSException'
Looks like you have a text field connected to the application delegate in your main XIB. There is no such field defined on the real application delegate, which is why you’re getting the error.
Thats because you set main xib for app in info plist and set File Owner to appDelegate, while main xib file's owner is always UIApplication. Possible solution - add Object to .xib, set its class for appDelegate class and connect all unnecessary outlets. This worked for me.
My app crashes when I do [self.navigationController popViewControllerAnimated:YES].
It crashes more on Device than on Simulator. Please suggest how to fix this?
Date/Time: 2010-11-09 10:51:41.325 +0800
OS Version: iPhone OS 4.0.1 (8A306)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000000
Crashed Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x0000286e objc_msgSend + 18
1 CoreFoundation 0x00002c30 -[NSObject(NSObject) release] + 24
2 libobjc.A.dylib 0x00003c1a objc_setProperty + 114
3 UIKit 0x000693d4 -[UINavigationController setDisappearingViewController:] + 24
4 UIKit 0x0007d5c0 -[UINavigationController _clearLastOperation] + 40
5 UIKit 0x0007d4b4 -[UINavigationController navigationTransitionView:didEndTransition:fromView:toView:] + 556
6 UIKit 0x0007d248 -[UINavigationTransitionView _notifyDelegateTransitionDidStopWithContext:] + 204
7 UIKit 0x0007d0b6 -[UINavigationTransitionView _navigationTransitionDidStop] + 450
8 UIKit 0x00059974 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 184
9 UIKit 0x0005987e -[UIViewAnimationState animationDidStop:finished:] + 34
10 QuartzCore 0x000127ba run_animation_callbacks(double, void*) + 286
11 QuartzCore 0x0001265c CA::timer_callback(__CFRunLoopTimer*, void*) + 116
12 CoreFoundation 0x00071a54 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 8
13 CoreFoundation 0x00073ede __CFRunLoopDoTimer + 854
14 CoreFoundation 0x0007485e __CFRunLoopRun + 1082
15 CoreFoundation 0x0001d8e4 CFRunLoopRunSpecific + 224
16 CoreFoundation 0x0001d7ec CFRunLoopRunInMode + 52
17 GraphicsServices 0x000036e8 GSEventRunModal + 108
18 GraphicsServices 0x00003794 GSEventRun + 56
19 UIKit 0x000062a0 -[UIApplication _run] + 396
20 UIKit 0x00004e10 UIApplicationMain + 664
21 tenpay 0x00006124 main (main.m:13)
22 tenpay 0x00002324 start + 44
myviewcontroller = [[[MyViewController alloc]init]autorelease];
[self.navigationController pushViewController:myviewcontroller animated:YES];
[myviewcontroller release]; //This is my bug !!! I just fixed it.
This usually means you are sending a message to a released object which is a bad idea.
From the stack you can see that it is sending a release message to an object. I'd suggest that the object has already been released and thus hasa retain count of 0. Therefore a further release would be invalid.
I believe if you turn on a flag, I think it's called Zombie detection or something like that, then any message to a released object will generate a more descriptive message.
Perhaps a more experienced developer can jump in here with more details.
Yes, I believe Derek is pointing you in the right direction. Could you possibly list what kind of memory-related operations you are performing on the active controller before sending this release message (the release message is being sent implicitly when you try to pop it out). Please clarify if you are using autorelease for this controller,etc... Also it might be helpful to see what are the associated properties that you may have associated with this controller (ex: #property(nonatomic, retain, etc...)) if there are any.