I have a crash in
-[__NSArrayM removeObjectAtIndex:] + 262
However my code does not use removeObjectAtIndex:. Are there any other functions which might call removeObjectAtIndex: internally?
My guess is replaceObjectAtIndex: which I use.
Also, is there some documentation source where I can get information like this?
here is the complete stack trace:
Thread : Fatal Exception: NSRangeException
0 CoreFoundation 0x00000001860fe59c __exceptionPreprocess + 132
1 libobjc.A.dylib 0x000000019685c0e4 objc_exception_throw + 60
2 CoreFoundation 0x0000000185fe362c -[__NSArrayM removeObjectAtIndex:]
3 Musixmatch 0x0000000100b9da24 +[MyController updateMessage:] + 1011504
4 Musixmatch 0x0000000100b95dc8 -[MyAPICalls sendNewMessage:] + 979668
5 libdispatch.dylib 0x0000000196ea13ac _dispatch_call_block_and_release + 24
6 libdispatch.dylib 0x0000000196ea136c _dispatch_client_callout + 16
7 libdispatch.dylib 0x0000000196eab4c0 _dispatch_queue_drain + 1216
8 libdispatch.dylib 0x0000000196ea4474 _dispatch_queue_invoke + 132
9 libdispatch.dylib 0x0000000196ead224 _dispatch_root_queue_drain + 664
10 libdispatch.dylib 0x0000000196eae75c _dispatch_worker_thread3 + 108
11 libsystem_pthread.dylib 0x000000019707d2e4 _pthread_wqthread + 816
12 libsystem_pthread.dylib 0x000000019707cfa8 start_wqthread + 4
So the last method called from the app is updateMessage:. Update message itself only has a objectAtIndex:. It then makes a call to two methods in other classes. But if they were causing the crash, I believe they should have been included in the stack trace.
Related
Our app is crash online, not in debug mode.
We cannot reproduce the crash.
Here is the crash log which caught with bugly.
Anyone could help or some clue , Please!
#43 Thread
SIGSEGV
SEGV_ACCERR
0 libobjc.A.dylib objc_msgSend + 16
1 CoreFoundation ___CFPropertyListIsValidAux + 56
2 CoreFoundation ___CFPropertyListIsDictPlistAux + 188
3 CoreFoundation ___CFDictionaryApplyFunction_block_invoke + 24
4 CoreFoundation _CFBasicHashApply + 132
5 CoreFoundation CFDictionaryApplyFunction + 180
6 CoreFoundation ___CFPropertyListIsValidAux + 388
7 CoreFoundation CFPropertyListIsValid + 28
8 CFNetwork ___ZN12__CFURLCache23CreateAndStoreCacheNodeEP16__CFURLCacheNodePK20_CFCachedURLResponsePK10__CFStringPK13_CFURLRequestPKvbRb_block_invoke + 148
9 libdispatch.dylib __dispatch_call_block_and_release + 24
10 libdispatch.dylib __dispatch_client_callout + 16
11 libdispatch.dylib __dispatch_lane_serial_drain$VARIANT$mp + 592
12 libdispatch.dylib __dispatch_lane_invoke$VARIANT$mp + 432
13 libdispatch.dylib __dispatch_workloop_worker_thread + 600
14 libsystem_pthread.dylib _pthread_wqthread + 312
My app crash with a NSInternalInconsistencyException like this
Exception reason:NSInternalInconsistencyException
Exception name:Can't cancel on a touch that isn't already active!
Exception stack:(
0 CoreFoundation 0x0000000191a4d1d0 <redacted> + 148
1 libobjc.A.dylib 0x000000019048455c objc_exception_throw + 56
2 CoreFoundation 0x0000000191a4d08c <redacted> + 0
3 Foundation 0x000000019250502c <redacted> + 112
4 UIKit 0x0000000197fd1960 <redacted> + 404
5 UIKit 0x0000000197fcf970 <redacted> + 1648
6 libdispatch.dylib 0x00000001908d61fc <redacted> + 24
7 libdispatch.dylib 0x00000001908d61bc <redacted> + 16
8 libdispatch.dylib 0x00000001908e43dc <redacted> + 928
9 libdispatch.dylib 0x00000001908d99a4 <redacted> + 652
10 libdispatch.dylib 0x00000001908e634c <redacted> + 572
11 libdispatch.dylib 0x00000001908e60ac <redacted> + 124
12 libsystem_pthread.dylib 0x0000000190adf2a0 _pthread_wqthread + 1288
13 libsystem_pthread.dylib 0x0000000190aded8c start_wqthread + 4
)
How do i analyse the log? Like What do those number tags mean,"+ 148" "+ 56"...? How to detect the code that have invoked this exception.
Is this a crash from a release build of the app, or do you have it in Xcode? If in Xcode please provide the code causing the crash?
Looking at your report, the line
Can't cancel on a touch that isn't already active!
seems very telling. I would look through your code for anywhere you are interacting with a UITouch object, or perhaps a UIGestureRecognizer. My guess would be that somewhere you are manually calling to cancel an interaction that you should not be, and there is a race condition where that can sometimes happen after the system has already cancelled the touch (or vice versa, I guess).
I can see from the Crashlytics that some of my app users are getting the following crashes. I have never seen these myself and don't know how to reproduce them as they don't have my code in the stack trace. I have read about OpenGL that some crashes are possible when trying to update the surface while the app is in the background. Not sure if that is the case here because the crashes didn't occur before iOS 9.
I have several annotations on the map, custom MKAnnotationView derived views, some custom overlays and a MKTileOverlay derived tile source. The map handling code and overlays are Objective-C, but my app has also some Swift code.
Does anybody have any ideas what could be the reason for the crashes?
1)
Thread : Crashed: com.apple.maps.geogl.renderQueue
0 VectorKit 0x18c82a894 ___ZN3ggl10GLRenderer5frameEPNS_12RenderTargetEPNS_11RenderQueueE_block_invoke_2 + 876
1 VectorKit 0x18c82a47c ___ZN3ggl10GLRenderer5frameEPNS_12RenderTargetEPNS_11RenderQueueE_block_invoke + 212
2 libdispatch.dylib 0x182625630 _dispatch_call_block_and_release + 24
3 libdispatch.dylib 0x1826255f0 _dispatch_client_callout + 16
4 libdispatch.dylib 0x182631634 _dispatch_queue_drain + 864
2)
Thread : Crashed: com.apple.mapdisplay.stylesheetLoadQueue
0 libdispatch.dylib 0x183ec2a90 dispatch_async + 76
1 libdispatch.dylib 0x183ec2a88 dispatch_async + 68
2 VectorKit 0x18df501c4 std::__1::__function::__func<-[VKTileSetBackedTileSource setStyleManager:]::$_0, std::__1::allocator<-[VKTileSetBackedTileSource setStyleManager:]::$_0>, void (std::__1::shared_ptr<gss::StyleManager>, bool)>::operator()(std::__1::shared_ptr<gss::StyleManager>&&, bool&&) + 176
3 VectorKit 0x18e11533c std::__1::__function::__func<gss::StyleManager::addFinishedDecodingGlobalPropertiesCallback(std::__1::function<void (std::__1::shared_ptr<gss::StyleManager>, bool)>)::$_0, std::__1::allocator<gss::StyleManager::addFinishedDecodingGlobalPropertiesCallback(std::__1::function<void (std::__1::shared_ptr<gss::StyleManager>, bool)>)::$_0>, void (bool)>::operator()(bool&&) + 88
4 VectorKit 0x18e10c248 ___ZN3gss10StyleSheet43addFinishedDecodingGlobalPropertiesCallbackENSt3__18functionIFvbEEE_block_invoke + 56
5 libdispatch.dylib 0x183ec1630 _dispatch_call_block_and_release + 24
6 libdispatch.dylib 0x183ec15f0 _dispatch_client_callout + 16
7 libdispatch.dylib 0x183ecd634 _dispatch_queue_drain + 864
8 libdispatch.dylib 0x183ec50f4 _dispatch_queue_invoke + 464
9 libdispatch.dylib 0x183ecf504 _dispatch_root_queue_drain + 728
10 libdispatch.dylib 0x183ecf224 _dispatch_worker_thread3 + 112
11 libsystem_pthread.dylib 0x1840d5470 _pthread_wqthread + 1092
12 libsystem_pthread.dylib 0x1840d5020 start_wqthread + 4
3)
Thread : Fatal Exception: NSGenericException
0 CoreFoundation 0x23f6a2eb __exceptionPreprocess
1 libobjc.A.dylib 0x23736dff objc_exception_throw
2 CoreFoundation 0x23f69d6d -[NSException name]
3 VectorKit 0x2c923af9 -[VKRasterOverlayTileSource _queueDraw:]
4 VectorKit 0x2c5e74ad -[VKTileSource fetchTileForKey:]
5 VectorKit 0x2c7c512d -[VKTileProvider dirtyTilesFromTileSource:]
6 libdispatch.dylib 0x23b07dd7 _dispatch_call_block_and_release
7 libdispatch.dylib 0x23b07dc3 _dispatch_client_callout
8 libdispatch.dylib 0x23b0c671 _dispatch_main_queue_callback_4CF
9 CoreFoundation 0x23f2cfc5 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
10 CoreFoundation 0x23f2b4bf __CFRunLoopRun
11 CoreFoundation 0x23e7dbb9 CFRunLoopRunSpecific
12 CoreFoundation 0x23e7d9ad CFRunLoopRunInMode
13 GraphicsServices 0x250f7af9 GSEventRunModal
14 UIKit 0x28169fb5 UIApplicationMain
15 MyApp 0x252d44 main (main.swift:12)
16 libdispatch.dylib 0x23b30873 (Missing)
A similar crashlog from my app as the following. From the thread name "com.apple.maps.geogl.renderQueue", I guess that is related with usage of the MapKit framework.
I found the "gpus_ReturnNotPermittedKillClient" in the Technical QA:
"How to fix OpenGL ES application crashes when moving to the background"
https://developer.apple.com/library/archive/qa/qa1766/_index.html
Crashed: com.apple.maps.geogl.renderQueue
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000001
0 libGPUSupportMercury.dylib 0x190a45f08 gpus_ReturnNotPermittedKillClient
1 libGPUSupportMercury.dylib 0x190a46ec4 gpusSubmitDataBuffers
2 VectorKit 0x18c7d1a0c ___ZN3ggl10GLRenderer5frameEPNS_12RenderTargetEPNS_11RenderQueueE_block_invoke + 212
3 libdispatch.dylib 0x181ec94bc _dispatch_call_block_and_release + 24
4 libdispatch.dylib 0x181ec947c _dispatch_client_callout + 16
5 libdispatch.dylib 0x181ed54c0 _dispatch_queue_drain + 864
6 libdispatch.dylib 0x181eccf80 _dispatch_queue_invoke + 464
7 libdispatch.dylib 0x181ed7390 _dispatch_root_queue_drain + 728
8 libdispatch.dylib 0x181ed9934 _dispatch_worker_thread + 124
9 libsystem_pthread.dylib 0x1820e3b28 _pthread_body + 156
10 libsystem_pthread.dylib 0x1820e3a8c _pthread_body + 154
11 libsystem_pthread.dylib 0x1820e1028 thread_start + 4
I have an application setup using Parse. Recently, I started getting the following error when my app starts up.
[Error]: Caught "NSInternalInconsistencyException" with reason "Tried to save an object with a new, unsaved child."
The app doesn't crash, as the exception is caught. However, I am unable to discern the cause of the exception. Below is the stack trace that is printed to the console:
(
0 CoreFoundation 0x0000000185f802f4 <redacted> + 160
1 libobjc.A.dylib 0x0000000197c4c0e4 objc_exception_throw + 60
2 CoreFoundation 0x0000000185f80218 <redacted> + 0
3 STSI 0x0000000100305e4c -[PFPointerObjectEncoder encodeParseObject:] + 116
4 STSI 0x000000010030528c -[PFEncoder encodeObject:] + 148
5 STSI 0x00000001002d0254 __129+[PFRESTQueryCommand findCommandParametersWithOrder:conditions:selectedKeys:includedKeys:limit:skip:extraOptions:tracingEnabled:]_block_invoke97 + 1752
6 CoreFoundation 0x0000000185ed47a4 <redacted> + 88
7 CoreFoundation 0x0000000185ec1cec <redacted> + 240
8 STSI 0x00000001002cfa9c +[PFRESTQueryCommand findCommandParametersWithOrder:conditions:selectedKeys:includedKeys:limit:skip:extraOptions:tracingEnabled:] + 936
9 STSI 0x00000001002cf69c +[PFRESTQueryCommand findCommandParametersForQueryState:] + 348
10 STSI 0x00000001002cf074 +[PFRESTQueryCommand findCommandForQueryState:withSessionToken:] + 84
11 STSI 0x00000001002dccdc __78-[PFQueryController findObjectsAsyncForQueryState:withCancellationToken:user:]_block_invoke + 116
12 STSI 0x000000010034f9ec __55-[BFTask continueWithExecutor:block:cancellationToken:]_block_invoke_2 + 96
13 libdispatch.dylib 0x0000000100c38fd4 _dispatch_call_block_and_release + 24
14 libdispatch.dylib 0x0000000100c38f94 _dispatch_client_callout + 16
15 libdispatch.dylib 0x0000000100c46b54 _dispatch_root_queue_drain + 2180
16 libdispatch.dylib 0x0000000100c48248 _dispatch_worker_thread3 + 132
17 libsystem_pthread.dylib 0x00000001984a922c _pthread_wqthread + 816
18 libsystem_pthread.dylib 0x00000001984a8ef0 start_wqthread + 4
).
I'm quite clueless as to what this stack trace is implying. Additionally, in the debugger, I can see many stacks of BFTasks being allocated.
What is the reason behind the exception being raised?
This is a bit of a weird one.
In my code, I have this line:
NSMutableArray *unresolvedPlayers = [NSMutableArray arrayWithCapacity:3];
This seems like a perfectly valid line. I crashed on this line with this stack trace (I have replaced my app name with xxxxxxxxx):
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0xc158f710
Triggered by Thread: 7
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 libsystem_kernel.dylib 0x3870d648 syscall_thread_switch + 8
1 libsystem_platform.dylib 0x3879a79a _os_lock_handoff_lock_slow + 74
2 libsystem_malloc.dylib 0x38748ece szone_malloc_should_clear + 50
3 libsystem_malloc.dylib 0x3874c444 malloc_zone_calloc + 92
4 libsystem_malloc.dylib 0x3874c3d2 calloc + 46
5 libobjc.A.dylib 0x380c8414 class_createInstance + 36
6 CoreFoundation 0x2a5773d0 __CFAllocateObject2 + 8
7 CoreFoundation 0x2a48c86a +[__NSArrayM __new:::::] + 38
8 CoreFoundation 0x2a48fd7c -[__NSPlaceholderArray initWithCapacity:] + 100
9 CoreFoundation 0x2a497e88 +[NSMutableArray arrayWithCapacity:] + 36
10 xxxxxxxxxx 0x001730f4 -[HostManager setHost:timestamp:] (HostManager.m:703)
11 xxxxxxxxxx 0x0016ff10 -[HostManager initSessionFromInvitation:] (HostManager.m:46)
12 xxxxxxxxxx 0x000ea68e -[NetworkController updateWithMatch:] (NetworkController.m:894)
13 xxxxxxxxxx 0x000ea418 __72-[NetworkController invitePlayersToMatch:playerGroup:completionHandler:]_block_invoke544 (NetworkController.m:844)
14 GameCenterFoundation 0x31263936 __72-[GKMatchmaker invitePlayersWithRequest:serverHosted:completionHandler:]_block_invoke601 + 42
15 libdispatch.dylib 0x38620420 _dispatch_call_block_and_release + 8
16 libdispatch.dylib 0x3862040c _dispatch_client_callout + 20
17 libdispatch.dylib 0x3862b1b0 _dispatch_main_queue_callback_4CF$VARIANT$mp + 708
18 CoreFoundation 0x2a53762c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 4
19 CoreFoundation 0x2a535d4c __CFRunLoopRun + 1508
20 CoreFoundation 0x2a482b2c CFRunLoopRunSpecific + 472
21 CoreFoundation 0x2a48293e CFRunLoopRunInMode + 102
22 GraphicsServices 0x3183904c GSEventRunModal + 132
23 UIKit 0x2da786ec UIApplicationMain + 1436
24 xxxxxxxxxx 0x000503b2 main (main.m:16)
25 libdyld.dylib 0x3865baac start + 0
How is it possible that my memory has gotten corrupted up to this point that allocating a new NSMutableArray would cause this to happen? I'm not even sure where to start with debugging this one. I am not sure this is easily reproducible.
As a side note, it happened when inviting nearby players to a realtime GameCenter match.
EDIT: I just realized this is crashing on Thread 7. This is what Thread 7 looks like:
Thread 7 name: Dispatch queue: com.apple.root.default-qos
Thread 7 Crashed:
0 libobjc.A.dylib 0x380cbf66 objc_msgSend + 6
1 GameCenterFoundation 0x31285efc -[GKMatchmaker(Nearby) inviteAnyNearbyPlayersWithRequest:] + 960
2 GameCenterFoundation 0x312636a8 __72-[GKMatchmaker invitePlayersWithRequest:serverHosted:completionHandler:]_block_invoke + 256
3 GameCenterFoundation 0x3129ae92 __39-[GKDispatchGroup notifyOnQueue:block:]_block_invoke44 + 10
4 libdispatch.dylib 0x38620420 _dispatch_call_block_and_release + 8
5 libdispatch.dylib 0x3862c2d6 _dispatch_root_queue_drain + 846
6 libdispatch.dylib 0x3862d1f6 _dispatch_worker_thread3 + 102
7 libsystem_pthread.dylib 0x3879de22 _pthread_wqthread + 666
8 libsystem_pthread.dylib 0x3879db74 start_wqthread + 4
So, this is probably a bug with GameCenter.
Crash in objc_msgSend can indicate that message destination object is deallocated already. Try to enable zombie objects and keep your eyes on logs.