GPUImage index out of bounds crash - ios

I have a camera app on the app store that uses GPUImage to take pictures and record videos. I am getting crash reports that says its crashing for a lot of users with the error
Fatal Exception: NSRangeException
*** -[NSArray| objectAtIndex:]: index 0 beyond bounds for empty array
The crash report says the crash occurs in the GPUImageStillCamera.m class at line 283. Below is the crash report. I appreciate your help in advance.
Thread : Fatal Exception: NSRangeException
0 CoreFoundation 6484558552 __exceptionPreprocess
1 libobjc.A.dylib 6783221988 objc_exception_throw
2 CoreFoundation 6483393332 CFRunLoopRemoveTimer
3 Selfie 4297468448 -[GPUImageStillCamera capturePhotoProcessedUpToFilter:withImageOnGPUHandler:] (GPUImageStillCamera.m:283)
4 Selfie 4297465636 -[GPUImageStillCamera capturePhotoAsImageProcessedUpToFilter:withOrientation:withCompletionHandler:] (GPUImageStillCamera.m:171)
5 Selfie 4295826452 +[SEMediaCapture captureImageFromCamera:withFilter:completion:] (SEMediaCapture.m:39)
6 Selfie 4296216108 -[SEViewController takePicture] (SEViewController.m:595)
7 Selfie 4296201380 -[SEViewController tappedToTakeAPicture:] (SEViewController.m:216)
8 UIKit 6564311152 _UIGestureRecognizerSendActions
9 UIKit 6562842292 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:]
10 UIKit 6567498636 ___UIGestureRecognizerUpdate_block_invoke662
11 UIKit 6562595864 _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks
12 UIKit 6562588612 _UIGestureRecognizerUpdate
13 UIKit 6562834476 -[UIWindow _sendGesturesForEvent:]
14 UIKit 6562832100 -[UIWindow sendEvent:]
15 UIKit 6562648352 -[UIApplication sendEvent:]
16 UIKit 6565405368 _UIApplicationHandleEventFromQueueEvent
17 UIKit 6562641460 _UIApplicationHandleEventQueue
18 CoreFoundation 6484263488 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
19 CoreFoundation 6484260068 __CFRunLoopDoSources0
20 CoreFoundation 6484252052 __CFRunLoopRun
21 CoreFoundation 6483382996 CFRunLoopRunSpecific
22 GraphicsServices 6645217020 GSEventRunModal
23 UIKit 6563065664 UIApplicationMain
24 Selfie 4296168708 main (main.m:15)
25 libdyld.dylib 6790212104 start

Related

iOS crash: -[UITextView(LinkInteraction) startInteractionWithLinkAtPoint:]

According to crashlytics, a few users are experiencing crashes on the following line
-[UITextView(LinkInteraction) startInteractionWithLinkAtPoint:]
I can't replicate it at all. This might be an iOS 11 issue because that seems to be version it is crashing on.
Here is the complete crash log.
Fatal Exception: NSInternalInconsistencyException
0 CoreFoundation 0x1849fed8c __exceptionPreprocess
1 libobjc.A.dylib 0x183bb85ec objc_exception_throw
2 CoreFoundation 0x1849febf8 +[NSException raise:format:]
3 Foundation 0x1853eefa0 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]
4 UIKit 0x18f2daf3c -[UITextView(LinkInteraction) startInteractionWithLinkAtPoint:]
5 UIKit 0x18ed4597c -[UITextGestureClusterLinkInteract smallDelayRecognizer:]
6 UIKit 0x18e7ea6e8 -[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:]
7 UIKit 0x18ed573b4 _UIGestureRecognizerSendTargetActions
8 UIKit 0x18e94ce38 _UIGestureRecognizerSendActions
9 UIKit 0x18e7e9720 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:]
10 UIKit 0x18ed48bd4 _UIGestureEnvironmentUpdate
11 UIKit 0x18e7e34d8 -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:]
12 UIKit 0x18e7e3010 -[UIGestureEnvironment _updateGesturesForEvent:window:]
13 UIKit 0x18e7e2874 -[UIWindow sendEvent:]
14 UIKit 0x18e7e11d0 -[UIApplication sendEvent:]
15 UIKit 0x18efc2d1c __dispatchPreprocessedEventFromEventQueue
16 UIKit 0x18efc52c8 __handleEventQueueInternal
17 UIKit 0x18efbe368 __handleHIDEventFetcherDrain
18 CoreFoundation 0x1849a7404 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
19 CoreFoundation 0x1849a6c2c __CFRunLoopDoSources0
20 CoreFoundation 0x1849a479c __CFRunLoopRun
21 CoreFoundation 0x1848c4da8 CFRunLoopRunSpecific
22 GraphicsServices 0x1868a9020 GSEventRunModal
23 UIKit 0x18e8e1758 UIApplicationMain
24 MyApp 0x10441cc88 main (main.m:14)
25 libdyld.dylib 0x184355fc0 start
I've seen this stackoverflow post
UITextView startInteractionWithLinkAtPoint crash iOS 11 only
However, I don't want to disable drag and drop. Should I wait until Apple fixes this issue because this seems to be a bug on Apple's end.

PLNotifyImagePickerOfImageAvailability crash

UIImagePickerController crash on image capture.
Refer to logs captured by crashlytics:
*** setObjectForKey: object cannot be nil (key: UIImagePickerControllerOriginalImage)
Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0x182ec81c0 __exceptionPreprocess
1 libobjc.A.dylib 0x18190055c objc_exception_throw
2 CoreFoundation 0x182da979c -[__NSCFNumber hash]
3 PhotoLibrary 0x18f9e5974 __CreateInfoForImage
4 PhotoLibrary 0x18f9e564c PLNotifyImagePickerOfImageAvailability
5 CameraUI 0x198443d14 -[CAMImagePickerCameraViewController _handleCapturedImagePickerPhotoWithCropOverlayOutput:]
6 CameraUI 0x198443628 -[CAMImagePickerCameraViewController cropOverlayWasOKed:]
7 UIKit 0x188d467b0 -[UIApplication sendAction:to:from:forEvent:]
8 UIKit 0x188d46730 -[UIControl sendAction:to:forEvent:]
9 UIKit 0x188d30be4 -[UIControl _sendActionsForEvents:withEvent:]
10 UIKit 0x188d4601c -[UIControl touchesEnded:withEvent:]
11 UIKit 0x188d45b44 -[UIWindow _sendTouchesForEvent:]
12 UIKit 0x188d40d8c -[UIWindow sendEvent:]
13 UIKit 0x188d11858 -[UIApplication sendEvent:]
14 UIKit 0x1894fecb8 __dispatchPreprocessedEventFromEventQueue
15 UIKit 0x1894f8720 __handleEventQueue
16 CoreFoundation 0x182e76278 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
17 CoreFoundation 0x182e75bc0 __CFRunLoopDoSources0
18 CoreFoundation 0x182e737c0 __CFRunLoopRun
19 CoreFoundation 0x182da2048 CFRunLoopRunSpecific
20 GraphicsServices 0x184825198 GSEventRunModal
21 UIKit 0x188d7c628 -[UIApplication _run]
22 UIKit 0x188d77360 UIApplicationMain
23 newbe 0x1002a2a60 main (AppDelegate.swift:22)
24 libdispatch.dylib 0x181d845b8 (Missing)

-[_NSObserverList setCursorPosition:]

I am getting #560 NSInvalidArgumentException error as shown below;
-[_NSObserverList setCursorPosition:]: unrecognized selector sent to instance 0x1702a6ea0
CoreFoundation ___exceptionPreprocess
Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0x1854f21c0 __exceptionPreprocess
1 libobjc.A.dylib 0x183f2c55c objc_exception_throw
2 CoreFoundation 0x1854f9278 __methodDescriptionForSelector
3 CoreFoundation 0x1854f6278 ___forwarding___
4 CoreFoundation 0x1853f059c _CF_forwarding_prep_0
5 UIKit 0x18b830418 -[_UIKeyboardTextSelectionController selectTextWithGranularity:atPoint:executionContext:]
6 UIKit 0x18b8304b0 -[_UIKeyboardTextSelectionController selectTextWithGranularity:atPoint:completionHandler:]
7 UIKit 0x18b895928 -[_UIKeyboardBasedNonEditableTextSelectionGestureController oneFingerForcePan:]
8 UIKit 0x18b91b59c -[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:]
9 UIKit 0x18b91eca4 _UIGestureRecognizerSendTargetActions
10 UIKit 0x18b4e02e8 _UIGestureRecognizerSendActions
11 UIKit 0x18b37e828 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:]
12 UIKit 0x18b90ece8 _UIGestureEnvironmentUpdate
13 CoreFoundation 0x18549f7dc __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
14 CoreFoundation 0x18549d40c __CFRunLoopDoObservers
15 CoreFoundation 0x18549d89c __CFRunLoopRun
16 CoreFoundation 0x1853cc048 CFRunLoopRunSpecific
17 GraphicsServices 0x186e52198 GSEventRunModal
18 UIKit 0x18b3b82fc -[UIApplication _run]
19 UIKit 0x18b3b3034 UIApplicationMain
20 MyAppName 0x100050054 main (main.m:16)
21 libdispatch.dylib 0x1843b05b8 (Missing)
Can anyone please suggest me what can be the issue?
This kind of NSInvalidArgumentException, especially because it's on a private class, is probably due to a Zombie object. You are sending a message "setCursorPosition:" to an object that no longer exist, but another one is in it's place. In this case "_NSObserverList".
Try running with the "Zombie Objects" diagnostics objects to trace down which is the object that should receive that message but was gone. That option keeps the objects in memory when they are released, but marked as zombies.

iOS - Can't trace this crash error

I'm using Crashlytics 3.6.0 and I've been getting a couple of crash reports lately that I can't read/understand. They seem to only happen on iOS 8 (can't confirm this 100% though).
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x197fcfbd0 objc_msgSend + 16
1 UIKit 0x18c035c60 -[UIControl _sendActionsForEvents:withEvent:] + 124
2 UIKit 0x18c293e7c -[UISwitch _handleLongPressNL:] + 424
3 UIKit 0x18c1af508 _UIGestureRecognizerSendActions + 276
4 UIKit 0x18c048050 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 580
5 UIKit 0x18c4b420c ___UIGestureRecognizerUpdate_block_invoke662 + 60
6 UIKit 0x18c00c530 _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 292
7 UIKit 0x18c00a8dc _UIGestureRecognizerUpdate + 2504
8 UIKit 0x18c0461f8 -[UIWindow _sendGesturesForEvent:] + 1044
9 UIKit 0x18c045898 -[UIWindow sendEvent:] + 660
10 UIKit 0x18c018fa8 -[UIApplication sendEvent:] + 264
11 infinight 0x1003ebe00 -[IBGMethodSwizzler sendEvent:] (IBGMethodSwizzler.m:103)
12 UIKit 0x18c2b7f58 _UIApplicationHandleEventFromQueueEvent + 14992
13 UIKit 0x18c017510 _UIApplicationHandleEventQueue + 1616
14 CoreFoundation 0x18781e9ec __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
15 CoreFoundation 0x18781dc90 __CFRunLoopDoSources0 + 264
16 CoreFoundation 0x18781bd40 __CFRunLoopRun + 712
17 CoreFoundation 0x1877490a4 CFRunLoopRunSpecific + 396
18 GraphicsServices 0x1908eb5a4 GSEventRunModal + 168
19 UIKit 0x18c07e3c0 UIApplicationMain + 1488
20 infinight 0x10013af44 main (main.m:16)
21 libdyld.dylib 0x19862aa08 start + 4
Could anyone help me identify the error? I can't reproduce the error -- it doesn't happen on my device or on the simulator. But I've been getting a fair amount of crash reports like these in the last couple of days from test users.
This was an error that only occured on iOS 8. To reproduce the error, I downloaded the iOS 8.1 simulator and found the error. To get the exact error message, I went to Edit Scheme and Enabled Zombie Objects. That showed me the exact error message:
*** -[NamedUISwitch _sendActionsForEvents:withEvent:]: message sent to deallocated instance

iOS app crashes on resume, no references to my code

iOS app crashes when resuming, no direct references to my app code
Recently, I started getting a rare crash on my iPad app when the app returns from the background after being suspended.
The only viable information in the crashed thread refers to system-level calls and I can’t seem to pinpoint root cause
especially considering it can take 50+ tries to reproduce. Here’s one hint: I know it only occurs on iOS 6.
Date/Time: 2014-08-14 09:37:03 +0000
OS Version: iPhone OS 6.1.2 (10B146)
Report Version: 104
Exception Type: SIGABRT
Exception Codes: #0 at 0x39827350
Crashed Thread: 0
Application Specific Information:
* Terminating app due to uncaught exception 'NSRangeException', reason: '* -[NSMutableArray removeObjectsInRange:]: range {1, 1} extends beyond bounds [0 .. 0]'
Last Exception Backtrace:
0 CoreFoundation 0x316423e7 __exceptionPreprocess + 163
1 libobjc.A.dylib 0x39333963 objc_exception_throw + 28
2 CoreFoundation 0x315d97cd -[NSMutableArray removeObjectsInRange:] + 250
3 UIKit 0x334de2df -[UINavigationController popToViewController:transition:] + 592
4 UIKit 0x3358a789 -[UITabBarController _tabBarItemClicked:] + 230
5 UIKit 0x3353c087 -[UIApplication sendAction:to:from:forEvent:] + 68
6 UIKit 0x3353c03b -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 28
7 UIKit 0x3358a679 -[UITabBar _sendAction:withEvent:] + 382
8 UIKit 0x3353c087 -[UIApplication sendAction:to:from:forEvent:] + 68
9 UIKit 0x3353c03b -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 28
10 UIKit 0x3353c015 -[UIControl sendAction:to:forEvent:] + 42
11 UIKit 0x3353b8cb -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 500
12 UIKit 0x3353c087 -[UIApplication sendAction:to:from:forEvent:] + 68
13 UIKit 0x3353c03b -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 28
14 UIKit 0x3353c015 -[UIControl sendAction:to:forEvent:] + 42
15 UIKit 0x3353b8cb -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 500
16 UIKit 0x3353bdb9 -[UIControl touchesEnded:withEvent:] + 486
17 UIKit 0x334645f9 -[UIWindow _sendTouchesForEvent:] + 522
18 UIKit 0x334518e1 -[UIApplication sendEvent:] + 378
19 UIKit 0x334511ef _UIApplicationHandleEvent + 6196
20 GraphicsServices 0x351685f7 _PurpleEventCallback + 588
21 GraphicsServices 0x35168227 PurpleEventCallback + 32
22 CoreFoundation 0x316173e7 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
23 CoreFoundation 0x3161738b __CFRunLoopDoSource1 + 136
24 CoreFoundation 0x3161620f __CFRunLoopRun + 1380
25 CoreFoundation 0x3158923d CFRunLoopRunSpecific + 354
26 CoreFoundation 0x315890c9 CFRunLoopRunInMode + 102
27 GraphicsServices 0x3516733b GSEventRunModal + 72
28 UIKit 0x334a52b9 UIApplicationMain + 1118
29 [my app name] 0x001e0917 main (main.m:14)
30 libdyld.dylib 0x39760b20 start + 2

Resources