Cryptic crash in iOS app applicationWillTerminate method - ios

Getting a lot of crashes from crash reporting in an iOS app with the following stack trace. I've not been able to reproduce this. My questions are:
Is this happening when the app terminates and therefore I shouldn't worry too much about it?
If not how can I figure out where this is coming from if I can't reproduce it locally?
0 libobjc.A.dylib (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 313
1 libobjc.A.dylib objc_object::sidetable_release(bool) + 94
2 CoreFoundation _CFAutoreleasePoolPop + 16
3 Foundation -[NSAutoreleasePool release] + 120
4 SmartRoam
MyAppDelegate.m line 95
-[MyAppDelegate applicationWillTerminate:]
5 UIKit -[UIApplication _terminateWithStatus:] + 152
6 UIKit -[UIApplication _handleApplicationSuspend:eventInfo:] + 2474
7 UIKit -[UIApplication handleEvent:withNewEvent:] + 774
8 UIKit -[UIApplication sendEvent:] + 72
9 UIKit _UIApplicationHandleEvent + 664
10 GraphicsServices _PurpleEventCallback + 608
11 GraphicsServices PurpleEventCallback + 34
12 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
13 CoreFoundation __CFRunLoopDoSource1 + 346
14 CoreFoundation __CFRunLoopRun + 1406
15 CoreFoundation CFRunLoopRunSpecific + 524
16 CoreFoundation CFRunLoopRunInMode + 106
17 GraphicsServices GSEventRunModal + 138
18 UIKit UIApplicationMain + 1136
19 SmartRoam
main.m line 41
main
Is this happening when the app terminates and therefore I shouldn't worry too much about it?
How can I figure out where this is coming from if I can't reproduce it locally and it never touches my application code.

Related

Crash on rotation with modal segues

I have view controllers 1, 2 and 3 chained like this, 2 and 3 are presented with modal segues:
When the user has been in landscape mode for a little while (inconsistent time), unwinds to the parent view, and then rotates the phone back to portrait, the app crashes with these symbolicated crash reports:
3 unwinds to 2:
Terminating app due to an uncaught exception
'NSInvalidArgumentException', reason: '-[NSConcreteMutableData
rotatesOnDeviceRotation]: unrecognized selector sent to instance
0x19360600'
Last Exception Backtrace
0 CoreFoundation 0x297a1fef __exceptionPreprocess + 127
1 libobjc.A.dylib 0x37a53c8b objc_exception_throw + 39
2 CoreFoundation 0x297a7409 __methodDescriptionForSelector + 1
3 CoreFoundation 0x297a5327 ___forwarding___ + 715
4 CoreFoundation 0x296d4e78 __forwarding_prep_0___ + 24
5 Retrostock v2 0x28b293 0x28b28f
6 CoreFoundation 0x29759e09 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 13
7 CoreFoundation 0x296b4515 _CFXNotificationPost + 1785
8 Foundation 0x2a415749 -[NSNotificationCenter postNotificationName:object:userInfo:] + 73
9 UIKit 0x2cdf78b7 -[UIDevice setOrientation:animated:] + 319
10 UIKit 0x2cdf766b -[UIApplication handleEvent:withNewEvent:] + 1599
11 UIKit 0x2cdf6f69 -[UIApplication sendEvent:] + 73
12 Retrostock v2 0x1ef675 -[IBGMethodSwizzler sendEvent:] (IBGMethodSwizzler.m:103)
13 Retrostock v2 0x1a850b uvSendEvents (UVManager.m:162)
14 UIKit 0x2ce5cc81 _UIApplicationHandleEvent + 633
15 GraphicsServices 0x30f927d1 _PurpleEventCallback + 529
16 GraphicsServices 0x30f9241b PurpleEventCallback + 35
17 CoreFoundation 0x297677cb __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 35
18 CoreFoundation 0x29767767 __CFRunLoopDoSource1 + 347
19 CoreFoundation 0x29765d69 __CFRunLoopRun + 1609
20 CoreFoundation 0x296b2201 CFRunLoopRunSpecific + 477
21 CoreFoundation 0x296b2013 CFRunLoopRunInMode + 107
22 GraphicsServices 0x30f91201 GSEventRunModal + 137
23 UIKit 0x2ce56a59 UIApplicationMain + 1441
24 Retrostock v2 0x169690 main () (AppDelegate.swift:14)
25 libdyld.dylib 0x37fdfaaf start + 3
Crashed Thread 0 :
0 CoreFoundation 0x297a231f __handleUncaughtException + 631
1 libobjc.A.dylib 0x37a53f13 objc_terminate() + 175
2 libc++abi.dylib 0x37388de3 std::__terminate() + 79
3 libc++abi.dylib 0x373888af __cxa_rethrow + 103
4 libobjc.A.dylib 0x37a53dd3 objc_exception_rethrow + 43
5 CoreFoundation 0x296b229d CFRunLoopRunSpecific + 633
6 CoreFoundation 0x296b2013 CFRunLoopRunInMode + 107
7 GraphicsServices 0x30f91201 GSEventRunModal + 137
8 UIKit 0x2ce56a59 UIApplicationMain + 1441
9 Retrostock v2 0x169690 main () (AppDelegate.swift:14)
10 libdyld.dylib 0x37fdfaaf start + 3
2 unwinds to 1:
Application crashed with signal SIGSEGV
0 Retrostock v2 0x232293 0x23228f
1 CoreFoundation 0x29759e09 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 13
2 CoreFoundation 0x296b4515 _CFXNotificationPost + 1785
3 Foundation 0x2a415749 -[NSNotificationCenter postNotificationName:object:userInfo:] + 73
4 UIKit 0x2cdf78b7 -[UIDevice setOrientation:animated:] + 319
5 UIKit 0x2cdf766b -[UIApplication handleEvent:withNewEvent:] + 1599
6 UIKit 0x2cdf6f69 -[UIApplication sendEvent:] + 73
7 Retrostock v2 0x196675 -[IBGMethodSwizzler sendEvent:] (IBGMethodSwizzler.m:103)
8 Retrostock v2 0x14f50b uvSendEvents (UVManager.m:162)
9 UIKit 0x2ce5cc81 _UIApplicationHandleEvent + 633
10 GraphicsServices 0x30f927d1 _PurpleEventCallback + 529
11 GraphicsServices 0x30f9241b PurpleEventCallback + 35
12 CoreFoundation 0x297677cb __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 35
13 CoreFoundation 0x29767767 __CFRunLoopDoSource1 + 347
14 CoreFoundation 0x29765d69 __CFRunLoopRun + 1609
15 CoreFoundation 0x296b2201 CFRunLoopRunSpecific + 477
16 CoreFoundation 0x296b2013 CFRunLoopRunInMode + 107
17 GraphicsServices 0x30f91201 GSEventRunModal + 137
18 UIKit 0x2ce56a59 UIApplicationMain + 1441
19 Retrostock v2 0x110690 main () (AppDelegate.swift:14)
20 libdyld.dylib 0x37fdfaaf start + 3
I get these reports from Appsee, because the app is now in beta testing, and I can't seem to recreate the error on my own device, so I'm dependent on knowing what the error is before I update it.
It seems like the app "forgets" what view it's in, and don't know what to rotate to. I would really appreciate it if you have any ideas or have experienced anything like this in the past.
UPDATE 1:
v2/ShinobiCharts.framework/Headers/SChartBandSeries.h:42:57: Attribute
'readonly' of property 'orientation' restricts attribute 'readwrite'
of property inherited from 'SChartSeries'
If the view hierarchy is this simple then you may be better off just using either a push segue to navigate then unwind. Without seeing the code one would have to assume the reference to that 2nd controller is lost so the rotation crashes when trying to rotate it (although I haven't experienced this).
Or just pop back one or 2 views simply
self.presentingViewController?.dismissViewControllerAnimated(true, completion: nil)
// Or to pop back 2
self.presentingViewController?.presentingViewController?.dismissViewControllerAnimated(true, completion: nil)
UPDATE:
Your issue is Shonobicontrols specific.
https://www.shinobicontrols.com/forum/shinobicontrols/2014/3/app-terminated-on-rotation-in-[schartcanvas-viewabouttorotate]
We have recently fixed an issue relating to messages being sent to SChartCanvas after it is dealloced that looks very similar to the above issue.
Version ShinobiCharts 2.7.3.hotfix2 might be worth trying if you are seeing this issue. This is available for download from our Portal.
I hope that solves the problem you have been seeing, but don't hesitate to get in touch if the issue persists! :-)
Thanks
Ryan

iOS Crash with name SIGSEGV, reason main

I'm using Crittercism (SDK 4.1.2) crash reporting service to catch reports on my iOS app. i've been getting this crash many times and i've no idea why it's happening.
Name: SIGSEGV - Reason: Main
Crashed Thread
0 libobjc.A.dylib 0x397c4b26 objc_msgSend + 6
1 UIKit 0x31965a2d -[UIScrollView(UIScrollViewInternal) _scrollViewAnimationEnded:finished:] + 177
2 UIKit 0x31a0e4b3 -[UIAnimator stopAnimation:] + 471
3 UIKit 0x31a0de9d -[UIAnimator(Static) _advanceAnimationsOfType:withTimestamp:] + 285
4 UIKit 0x31a0dd7d -[UIAnimator(Static) _LCDHeartbeatCallback:] + 53
5 QuartzCore 0x315419cf _ZN2CA7Display15DisplayLinkItem8dispatchEv + 99
6 QuartzCore 0x31541779 _ZN2CA7Display11DisplayLink14dispatch_itemsEyyy + 345
7 IOMobileFramebuffer 0x3411b76d IOMobileFramebufferVsyncNotifyFunc + 105
8 IOKit 0x2fdd9a75 IODispatchCalloutFromCFMessage + 249
9 CoreFoundation 0x2f0b7e21 __CFMachPortPerform + 137
10 CoreFoundation 0x2f0c29df __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 35
11 CoreFoundation 0x2f0c297b __CFRunLoopDoSource1 + 347
12 CoreFoundation 0x2f0c114f __CFRunLoopRun + 1399
13 CoreFoundation 0x2f02bc27 CFRunLoopRunSpecific + 523
14 CoreFoundation 0x2f02ba0b CFRunLoopRunInMode + 107
15 GraphicsServices 0x33cff283 GSEventRunModal + 139
16 UIKit 0x318cf049 UIApplicationMain + 1137
17 AppName 0x000b1fef main + 67
Not sure if this is the case for you, but I've had a similar crash caused by a button in an UIView trying to invoke a callback method on a already released object. The UI was displayed, and then the object was released.

How to understand this crash? : SIGBUS BUS_ADRALN

Thats in the stack trace and i dont understand this error:
0 CoreFoundation 0x30f57648 ___CFBasicHashFindBucket_Linear_NoCollision + 92
1 CoreFoundation 0x30f59688 __CFBasicHashAddValue + 692
2 CoreFoundation 0x30eaff9f CFDictionarySetValue + 74
3 UIKit 0x35721a0b -[UITouchesEvent _gestureRecognizersForWindow:] + 282
4 UIKit 0x357215d5 -[UIWindow _sendGesturesForEvent:] + 28
5 UIKit 0x357214ab -[UIWindow sendEvent:] + 66
6 UIKit 0x3570a313 -[UIApplication sendEvent:] + 298
7 UIKit 0x35709c53 _UIApplicationHandleEvent + 5090
8 GraphicsServices 0x31a11e77 PurpleEventCallback + 666
9 CoreFoundation 0x30f1ba97 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 26
10 CoreFoundation 0x30f1d83f __CFRunLoopDoSource1 + 166
11 CoreFoundation 0x30f1e60d __CFRunLoopRun + 520
12 CoreFoundation 0x30eaeec3 CFRunLoopRunSpecific + 230
13 CoreFoundation 0x30eaedcb CFRunLoopRunInMode + 58
14 GraphicsServices 0x31a1141f GSEventRunModal + 114
15 GraphicsServices 0x31a114cb GSEventRun + 62
16 UIKit 0x35734d69 -[UIApplication _run] + 404
17 UIKit 0x35732807 UIApplicationMain + 670
18 AppName 0x00002e3b 0x1000 + 7739
The crash occurs sometimes, i dont know on what kind of action it occurs.
How can i understand this issue and can solve my problem?
I think the problem may be that you are re-using gesture objects for more than one UIView based object. They cannot be re-used. I have had similar problems in the past (not exactly the same crash). The documentation on it highlights the limitation. I suppose there is internal state (the hash table seen in the crash) which gets updated in conflicting ways for the different UI View based objects.
If you are not re-using them, try removing all of them temporarily just to confirm the system is otherwise stable.

ios crash [_UIBackgroundTaskInfo fireExpirationHandler]

Got this crash report from crashlytics, any idea how to decipher this? I think it's related to some background task that I am doing. I am using restkit's background continue option. Crashlytics is also telling me that only 12% of user has the app in focus when this happens.
0 libobjc.A.dylib objc_msgSend + 15
1 UIKit ✭ -[_UIBackgroundTaskInfo fireExpirationHandler] + 48
2 UIKit -[UIApplication handleEvent:withNewEvent:] + 1288
3 UIKit -[UIApplication sendEvent:] + 54
4 UIKit _UIApplicationHandleEvent + 5826
5 GraphicsServices PurpleEventCallback + 882
6 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 38
7 CoreFoundation __CFRunLoopDoSource1 + 140
8 CoreFoundation __CFRunLoopRun + 1370
9 CoreFoundation CFRunLoopRunSpecific + 300
10 CoreFoundation CFRunLoopRunInMode + 104
11 GraphicsServices GSEventRunModal + 136
12 UIKit UIApplicationMain + 1080

iOS objc_msgSend crash, with no report or warning given

I am testing my app out, pushing it pretty hard, and I'm getting it to crash (black screen, image doesn't save, drops back to springboard). However, I get no crash reports logged in the console. When I test using profiler all I get is a message saying the target died, but it gives no clues.
In the organiser I got the device crash logs which gives me this which I believe is telling me I'm sending a message to something I've released (objc-msgSend + 22)? Am I on the right track here?
---
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x576e6f69
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x34f8ef7e objc_msgSend + 22
1 CoreFoundation 0x371d7e90 CFRetain + 76
2 CoreFoundation 0x371e1b74 +[__NSArrayI __new::] + 48
3 CoreFoundation 0x371e1a8e -[__NSPlaceholderArray initWithObjects:count:] + 294
4 CoreFoundation 0x371e9394 -[NSArray initWithArray:range:copyItems:] + 756
5 CoreFoundation 0x371fcd5a +[NSArray arrayWithArray:] + 66
6 AVFoundation 0x335da766 -[AVCaptureSession outputs] + 146
7 AVFoundation 0x335de26e -[AVCaptureSession _doDidStop:] + 38
8 AVFoundation 0x335dfaea -[AVCaptureSession _handleNotification:payload:] + 2002
9 AVFoundation 0x335d8af6 avcaptureSessionFigRecorderNotification + 1202
10 AVFoundation 0x335fafd8 AVCMNotificationDispatcherCallback + 184
11 CoreFoundation 0x3725b7c8 __CFNotificationCenterAddObserver_block_invoke_0 + 116
12 CoreFoundation 0x3725b540 ___CFXNotificationPost_block_invoke_0 + 64
13 CoreFoundation 0x371e7090 _CFXNotificationPost + 1400
14 CoreFoundation 0x371ef1c6 CFNotificationCenterPostNotification + 102
15 CoreMedia 0x366eeeb0 CMNotificationCenterPostNotification + 112
16 Celestial 0x374b08a2 FigRecorderRemoteCallbacksServer_NotificationIsPending + 478
17 Celestial 0x374b06ba _XNotificationIsPending + 54
18 Celestial 0x374b0678 figrecordercallbacks_server + 92
19 Celestial 0x374af642 remrec_ClientPortCallBack + 146
20 CoreFoundation 0x37258f0c __CFMachPortPerform + 356
21 CoreFoundation 0x3726351c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
22 CoreFoundation 0x372634be __CFRunLoopDoSource1 + 134
23 CoreFoundation 0x3726230c __CFRunLoopRun + 1364
24 CoreFoundation 0x371e549e CFRunLoopRunSpecific + 294
25 CoreFoundation 0x371e5366 CFRunLoopRunInMode + 98
26 AVFoundation 0x335ef4d0 -[AVRunLoopCondition _waitInMode:untilDate:] + 348
27 AVFoundation 0x335ef36c -[AVRunLoopCondition waitUntilDate:inMode:] + 20
28 AVFoundation 0x335dc13a -[AVCaptureSession _stopPreviewing] + 438
29 AVFoundation 0x335dc2d6 -[AVCaptureSession _setRunning:] + 166
30 AVFoundation 0x335dbe42 -[AVCaptureSession stopRunning] + 274
31 zApp 0x0007e1ce 0x79000 + 20942
32 UIKit 0x30fa5b8e -[UIViewController _setViewAppearState:isAnimating:] + 138
33 UIKit 0x30fff8a8 -[UIViewController beginAppearanceTransition:animated:] + 184
34 UIKit 0x310468be -[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:] + 4098
35 UIKit 0x31045360 -[UIViewController presentViewController:withTransition:completion:] + 3116
36 UIKit 0x310a06a0 -[UIViewController presentModalViewController:animated:] + 24
37 CoreFoundation 0x371e93f6 -[NSObject performSelector:withObject:withObject:] + 46
38 UIKit 0x30f7ee00 -[UIApplication sendAction:to:from:forEvent:] + 56
39 UIKit 0x30f7edbc -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 24
40 UIKit 0x30f7ed9a -[UIControl sendAction:to:forEvent:] + 38
41 UIKit 0x30f7eb0a -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 486
42 UIKit 0x30f7f442 -[UIControl touchesEnded:withEvent:] + 470
43 UIKit 0x30f7d924 -[UIWindow _sendTouchesForEvent:] + 312
44 UIKit 0x30f7d312 -[UIWindow sendEvent:] + 374
45 UIKit 0x30f6368e -[UIApplication sendEvent:] + 350
46 UIKit 0x30f62f34 _UIApplicationHandleEvent + 5820
47 GraphicsServices 0x339a5224 PurpleEventCallback + 876
48 CoreFoundation 0x3726351c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
49 CoreFoundation 0x372634be __CFRunLoopDoSource1 + 134
50 CoreFoundation 0x3726230c __CFRunLoopRun + 1364
51 CoreFoundation 0x371e549e CFRunLoopRunSpecific + 294
52 CoreFoundation 0x371e5366 CFRunLoopRunInMode + 98
53 GraphicsServices 0x339a4432 GSEventRunModal + 130
54 UIKit 0x30f91cce UIApplicationMain + 1074
55 zApp 0x0007ffa6 0x79000 + 28582
56 zApp 0x0007a680 0x79000 + 5760
If you suspect that you are overreleasing something, try running your app with NSZombie enabled. (how to enable NSZombie)
You can set exception breakpoint to print backtrace in console.
sometimes that happens when you set an object as an observer for notifications, like
[[NSNotificationCenter defaultCenter] addObserver //details
and don't remove it from the observers list when it's released.
the system tries to send a message to it, and the app crashes because it's not there.
try adding
[[NSNotificationCenter defaultCenter] removeObserver:self];
in the dealloc function. (even if you're working with arc, create a dealloc function, and write that in it).
good luck

Resources