Anyone have any idea about the crash
Crashed: com.apple.main-thread
0 0x7ac30 specialized AppDelegate.updateUserSubscriptionStatus() + 4374539312 (AppDelegate.swift:4374539312)
1 0xb4a9c closure #1 in SubscribeViewController.handlePurchase(purchase:) + 4374776476 (<compiler-generated>:4374776476)
2 0x58310 thunk for #escaping #callee_guaranteed () -> () + 4374397712 (<compiler-generated>:4374397712)
3 libdispatch.dylib 0x1e6c _dispatch_call_block_and_release + 32
4 libdispatch.dylib 0x3a30 _dispatch_client_callout + 20
5 libdispatch.dylib 0x11f48 _dispatch_main_queue_drain + 928
6 libdispatch.dylib 0x11b98 _dispatch_main_queue_callback_4CF + 44
7 CoreFoundation 0x51800 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
8 CoreFoundation 0xb704 __CFRunLoopRun + 2532
9 CoreFoundation 0x1ebc8 CFRunLoopRunSpecific + 600
10 GraphicsServices 0x1374 GSEventRunModal + 164
11 UIKitCore 0x514b58 -[UIApplication _run] + 1100
12 UIKitCore 0x296090 UIApplicationMain + 364
13 0x14ad4 main + 47 (AppDelegate.swift:47)
14 ??? 0x10129dda4 (Missing)
We are getting this crash on multiple devices but cannot figure out where it originates from. The main thread is crashing.
Stack trace:
Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x193dfd58c object_getMethodImplementation + 20
1 CoreFoundation 0x1940f6928 _NSIsNSSet + 40
2 CoreFoundation 0x193fc2c04 -[NSMutableSet unionSet:] + 112
3 CoreData 0x198abe014 -[_NSFaultingMutableSet willReadWithContents:] + 668
4 CoreData 0x198ae4280 -[_NSFaultingMutableSet count] + 32
5 CoreData 0x198be1bb4 __107-[NSManagedObjectContext(_NestedContextSupport) newValueForRelationship:forObjectWithID:withContext:error:]_block_invoke + 360
6 CoreData 0x198be2e70 internalBlockToNSManagedObjectContextPerform + 104
7 libdispatch.dylib 0x193d8b5ac _dispatch_client_callout + 20
8 libdispatch.dylib 0x193d9843c _dispatch_async_and_wait_invoke + 96
9 libdispatch.dylib 0x193d8b5ac _dispatch_client_callout + 20
10 libdispatch.dylib 0x193d977d4 _dispatch_main_queue_callback_4CF + 832
11 CoreFoundation 0x1940648d4 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
12 CoreFoundation 0x19405f58c __CFRunLoopRun + 1692
13 CoreFoundation 0x19405ebc8 CFRunLoopRunSpecific + 480
14 GraphicsServices 0x19e4475cc GSEventRunModal + 164
15 UIKitCore 0x198211744 UIApplicationMain + 1936
16 My App 0x100b37324 main + 16 (main.m:16)
17 libdyld.dylib 0x193edb384 start + 4
At the same time, a background thread operating in a PrivateQueue ManagedObjectContext is busy accessing a ManagedObject via awakeFromFetch, stack trace of this thread:
NSManagedObjectContext 0x28066c700
0 libsystem_kernel.dylib 0x1b09617e4 __ulock_wait + 8
1 libdispatch.dylib 0x1b081bf48 _dlock_wait + 56
2 libdispatch.dylib 0x1b081bcf4 _dispatch_thread_event_wait_slow + 56
3 libdispatch.dylib 0x1b0828618 __DISPATCH_WAIT_FOR_QUEUE__ + 336
4 libdispatch.dylib 0x1b0828204 _dispatch_sync_f_slow + 144
5 CoreData 0x1b56686cc _perform + 200
6 CoreData 0x1b558e2c4 -[NSManagedObjectContext(_NestedContextSupport) newValueForRelationship:forObjectWithID:withContext:error:] + 156
7 CoreData 0x1b555033c -[NSFaultHandler retainedFulfillAggregateFaultForObject:andRelationship:withContext:] + 428
8 CoreData 0x1b554df10 -[_NSFaultingMutableSet willReadWithContents:] + 408
9 CoreData 0x1b55ea5bc -[_NSFaultingMutableSet allObjects] + 32
10 My App 0x1044fdc3c PSUser.isAdmin.getter + 286 (PSUser.swift:286)
11 My App 0x1044fdb04 #objc PSUser.isAdmin.getter + 4309900036 (<compiler-generated>:4309900036)
12 My App 0x1044fc694 PSUser.initCurrentTeam() + 212 (PSUser.swift:212)
13 My App 0x1044fcbc0 #objc PSUser.initCurrentTeam() + 4309896128 (<compiler-generated>:4309896128)
14 My App 0x1044fc658 #objc PSUser.awakeFromFetch() + 4309894744 (<compiler-generated>:4309894744)
15 CoreData 0x1b56520e4 _PFFaultHandlerFulfillFault + 3168
16 CoreData 0x1b5650ab0 _PFFaultHandlerLookupRow + 908
17 CoreData 0x1b56527fc _PF_FulfillDeferredFault + 260
18 CoreData 0x1b5666a2c _pvfk_header + 120
19 CoreData 0x1b5663218 _sharedIMPL_pvfk_core + 32
20 My App 0x10438918c +[PSAppSettings isAutoPilotAllowed:] + 97 (PSAppSettings.m:97)
21 My App 0x1043fbb9c LocationTracker.updateTrackingState(user:) + 1120 (LocationTracker.swift:1120)
22 My App 0x104413b4c partial apply for closure #1 in LocationTracker.store(filteredLocations:) + 1275 (LocationTracker.swift:1275)
23 My App 0x1043bae3c thunk for #escaping #callee_guaranteed () -> () + 4308577852 (<compiler-generated>:4308577852)
24 CoreData 0x1b566b650 developerSubmittedBlockToNSManagedObjectContextPerform + 164
25 libdispatch.dylib 0x1b081b5ac _dispatch_client_callout + 20
26 libdispatch.dylib 0x1b0821a64 _dispatch_lane_serial_drain + 568
27 libdispatch.dylib 0x1b0822498 _dispatch_lane_invoke + 400
28 libdispatch.dylib 0x1b082ba5c _dispatch_workloop_worker_thread + 584
29 libsystem_pthread.dylib 0x1b0881718 _pthread_wqthread + 276
30 libsystem_pthread.dylib 0x1b08879c8 start_wqthread + 8
I am not certain if the two stacks are related, or if the background thread is dispatching anything to the main thread (why should it?), but the call newValueForRelationship:forObjectWithID:withContext:error does appear in both stack traces.
The method for awakeFromFetch is initializing a calculated object property currentTeam via the initCurrentTeam() method. This method accesses the teams relationship on that object. Here is the relevant code:
#objc extension PSUser {
override open func awakeFromFetch() {
super.awakeFromFetch()
initCurrentTeam()
}
/**
This method sets the currentTeam by picking
the appropriate team from the `teams` set.
*/
func initCurrentTeam() {
if (isAdmin || isManager), !isEmployee,
var teams = teams?.allObjects as? [PSTeam],
currentTeam == nil {
...
currentTeam = teams.first
}
}
...
}
Enabled com.apple.CoreData.ConcurrencyDebug in Xcode Scheme but Xcode console does not complain. I have not been able to reproduce this issue while debugging in Xcode. The issue is only reported via Crashlytics in production environment.
Any ideas what might be causing this?
I have a concerning amount of crashes for my iOS app. When I look at the stacktrace I can follow the flow of the stacktrace up until the 3d line 'fetchDeezerTracks(forAlbum)'. When inspecting my code it should be impossible for this line to be even called. the ApplePlayerManager.play method calls the ApplePlayerManager.fetchTrackIds method which calls a NetworkManager's 'fetchAppleMusicTracks' and this method has a networkRequestResponseHandler to deal with the fetched data, but NEVER ever should/could the 'fetchDeezerTracks' method be called.
My question is the following: Is it possible for Crashlytics to give incorrect reports maybe when the device's free RAM is insufficient? Maybe due to memory leaks or something... I just can't make sense out of the crash report so it would help me a lot to know if something else is at play. Some of the free RAM values of the multiple reports (of the same crash) are the following:
233MB (iPad Air 2), 8MB (iPAad 5th gen), 198MB (iPad Mini 2), 332MB (iPad Mini), 71MB (iPad Air 2), 174MB (iPad 5th gen), 223MB (iPad Air 2), 130MB (iPhone6+), 58MB (iPhoneXR), 381MB (iPhoneXSMax), etc.
Are these normal values?
If these are normal values and crashlytics reports are never "corrupted" then I need to make sense of the stacktrace. I'll add my networking code for reference.
Any help very much appreciated! This is driving me mad and crashes keep on piling up.
Crashed: com.apple.root.background-qos
0 MyApp 0x10045da40 closure #2 in ApplePlayerManager.play(album:withTrack:) + 4302494272 (<compiler-generated>:4302494272)
1 MyApp 0x10045d884 closure #1 in closure #1 in ApplePlayerManager.fetchTrackIds(forAlbum:completionHandler:) + 4302493828 (<compiler-generated>:4302493828)
2 MyApp 0x1004da218 specialized NetworkManager.networkRequestResponseHandler(withResponse:completionHandler:retryHandler:) + 4303004184 (<compiler-generated>:4303004184)
3 MyApp 0x1004d9404 closure #1 in NetworkManager.fetchDeezerTracks(forAlbum:withAccessToken:withCompletionHandler:) + 4303000580
4 MyApp 0x1004d8294 closure #1 in NetworkManager.fetchAppleMusicTracks(forAlbumID:withAccessToken:withCompletionHandler:) + 4302996116
5 Alamofire 0x100a73e64 $s9Alamofire15DownloadRequestC8response5queue0D10Serializer17completionHandlerACXDSo012OS_dispatch_E0CSg_xyAA0B8ResponseVy16SerializedObjectQzGctAA0bkF8ProtocolRzlFyycfU_yycfU_AA0bkF0VyypG_Tg5Tm + 132
6 Alamofire 0x100a79d08 $s9Alamofire15DownloadRequestC8response5queue0D10Serializer17completionHandlerACXDSo012OS_dispatch_E0CSg_xyAA0B8ResponseVy16SerializedObjectQzGctAA0bkF8ProtocolRzlFyycfU_yycfU_AA0bkF0VyypG_Tg5TATm + 36
7 Alamofire 0x100a5b3b0 $sIeg_IeyB_TR + 28
8 libdispatch.dylib 0x18f0eb9a8 _dispatch_call_block_and_release + 24
9 libdispatch.dylib 0x18f0ec524 _dispatch_client_callout + 16
10 libdispatch.dylib 0x18f0a156c _dispatch_root_queue_drain + 684
11 libdispatch.dylib 0x18f0a1bf8 _dispatch_worker_thread2 + 124
12 libsystem_pthread.dylib 0x18f13db38 _pthread_wqthread + 212
13 libsystem_pthread.dylib 0x18f140740 start_wqthread + 8
How I fetch my trackIds (NetworkManager)
func fetchAppleMusicTracks(forAlbumID albumID:String,
withAccessToken accessToken:String,
withCompletionHandler completionHandler:#escaping(JSON?)->Void) {
let url = kAppleMusicAlbumURL + albumID
guard let encodedURL = url.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) else { return completionHandler(nil) }
let headers = [kAppleMusicAuthoritationKey : kAppleMusicBearerKey + accessToken]
Alamofire.request(encodedURL,
method: .get,
parameters: nil,
encoding: URLEncoding.default,
headers: headers).responseJSON(queue: backgroundQueue) {
[weak self]
response in
guard let self = self else { completionHandler(nil); return }
self.networkRequestResponseHandler(withResponse:response,
completionHandler:completionHandler) {
self.fetchAppleMusicTracks(forAlbumID: albumID,
withAccessToken: accessToken,
withCompletionHandler: completionHandler)
}
}
}
my network request handler (NetworkManager):
func networkRequestResponseHandler(withResponse response:DataResponse<Any>,
completionHandler: #escaping(JSON?)->Void,
retryHandler: #escaping()->Void) {
switch response.result {
case .success(let value):
completionHandler(JSON(value))
case .failure(let error):
if self.noConnectionValidator(forError: error, withRetryHandler:retryHandler) { return completionHandler(nil) }
if let status = response.response?.statusCode {
let message = BackendManager.sharedInstance.APIErrorMessageHandler(status: status)
AlertsManager.sharedInstance.displayAlertWithOKButton(forTitle: kGenericErrorTitle,
message: message,
buttonTitle: "Ok")
} else {
AlertsManager.sharedInstance.displayNetworkErrorMessage(withError: error)
}
completionHandler(nil)
}
}
method to fetch tracks (ApplePlayerManager):
private func fetchTrackIds(forAlbum album:String, completionHandler:#escaping([String]?)->Void) {
retrieveAccessToken {
accessToken in
guard let accessToken = accessToken else { completionHandler(nil); return }
NetworkManager.sharedInstance.fetchAppleMusicTracks(forAlbumID: album, withAccessToken: accessToken) {
JSON in
guard let JSON = JSON else {
completionHandler(nil)
return
}
if let tracks = JSON[kAppleMusicDataKey].array?[0][kAppleMusicRelationshipsKey][kAppleMusicTracksKey][kAppleMusicDataKey].array {
let trackIds = tracks.map{ $0[kAppleMusicTrackIdentifierKey].string }.compactMap{ $0 }
completionHandler(trackIds)
} else {
//AlertsManager.sharedInstance.displayAppleMusicCouldNotFetchTracks()
completionHandler(nil)
}
}
}
}
entry-point -> method to play an Apple track (ApplePlayerManager):
override public func play(album:String, withTrack track:Int) {
super.play(album: album, withTrack: track)
guard let streamingManager = streamingManager else { return setup { self.play(album: album, withTrack: track) } }
indexOfLastPlayingItem = track
fetchTrackIds(forAlbum: album) {
[weak self]
trackIds in
guard let self = self else { return }
guard let trackIds = trackIds else {
return //AlertsManager.sharedInstance.displayAppleMusicTracksFetchFailed()
}
self.loadedAlbumTrackIDs = trackIds
if let remainingTracks = self.calculateRemainingTrackList(fromCurrentTrack: track) {
ThreadManager.sharedInstance.executeOnMainThread {
self.play(forStreamingManager: streamingManager, remainingTracks: remainingTracks)
}
}
}
}
EDIT - MORE INFO:
Since my app is using multiple services, I made an abstract PlayerManager singleton class with concrete singleton subclasses for every service. so the PlayerManager.play(track: trackId) will call the correct concrete class method on ApplePlayerManager if beforehand the PlayerManager.service is set to .Apple
I know it looks like somewhere in code the singleton has incorrectly changed service, but again it would not make any sense + I can not reproduce it nor getting a breakpoint hit.
EDIT PART II - ALL THREADS STACKTRACES:
I am getting the suspicion that this might be thread related? Here are all the threads:
Crashed: com.apple.root.background-qos
EXC_BREAKPOINT 0x0000000104cd5a40
Crashed: com.apple.root.background-qos
0 MyApp 0x104cd5a40 closure #2 in ApplePlayerManager.play(album:withTrack:) + 4376304192 (<compiler-generated>:4376304192)
1 MyApp 0x104cd5884 closure #1 in closure #1 in ApplePlayerManager.fetchTrackIds(forAlbum:completionHandler:) + 4376303748 (<compiler-generated>:4376303748)
2 MyApp 0x104d52218 specialized NetworkManager.networkRequestResponseHandler(withResponse:completionHandler:retryHandler:) + 4376814104 (<compiler-generated>:4376814104)
3 MyApp 0x104d51404 closure #1 in NetworkManager.fetchDeezerTracks(forAlbum:withAccessToken:withCompletionHandler:) + 4376810500
4 MyApp 0x104d50294 closure #1 in NetworkManager.fetchAppleMusicTracks(forAlbumID:withAccessToken:withCompletionHandler:) + 4376806036
5 Alamofire 0x105313e64 $s9Alamofire15DownloadRequestC8response5queue0D10Serializer17completionHandlerACXDSo012OS_dispatch_E0CSg_xyAA0B8ResponseVy16SerializedObjectQzGctAA0bkF8ProtocolRzlFyycfU_yycfU_AA0bkF0VyypG_Tg5Tm + 132
6 Alamofire 0x105319d08 $s9Alamofire15DownloadRequestC8response5queue0D10Serializer17completionHandlerACXDSo012OS_dispatch_E0CSg_xyAA0B8ResponseVy16SerializedObjectQzGctAA0bkF8ProtocolRzlFyycfU_yycfU_AA0bkF0VyypG_Tg5TATm + 36
7 Alamofire 0x1052fb3b0 $sIeg_IeyB_TR + 28
8 libdispatch.dylib 0x1b2e9a9a8 _dispatch_call_block_and_release + 24
9 libdispatch.dylib 0x1b2e9b524 _dispatch_client_callout + 16
10 libdispatch.dylib 0x1b2e8165c _dispatch_root_queue_drain + 640
11 libdispatch.dylib 0x1b2e81cd0 _dispatch_worker_thread2 + 112
12 libsystem_pthread.dylib 0x1b2eecb38 _pthread_wqthread + 212
13 libsystem_pthread.dylib 0x1b2eef740 start_wqthread + 8
com.apple.main-thread
com.apple.main-thread
0 libsystem_kernel.dylib 0x1b2fa9198 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x1b2fa860c mach_msg + 72
2 CoreFoundation 0x1b31533b4 __CFRunLoopServiceMachPort + 148
3 CoreFoundation 0x1b314e3e8 __CFRunLoopRun + 1160
4 CoreFoundation 0x1b314dc34 CFRunLoopRunSpecific + 424
5 GraphicsServices 0x1bd29738c GSEventRunModal + 160
6 UIKitCore 0x1b728022c UIApplicationMain + 1932
7 MyApp 0x104cd1060 main + 12 (AppDelegate.swift:12)
8 libdyld.dylib 0x1b2fd5800 start + 4
com.apple.uikit.eventfetch-thread
com.apple.uikit.eventfetch-thread
0 libsystem_kernel.dylib 0x1b2fa9198 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x1b2fa860c mach_msg + 72
2 CoreFoundation 0x1b31533b4 __CFRunLoopServiceMachPort + 148
3 CoreFoundation 0x1b314e3e8 __CFRunLoopRun + 1160
4 CoreFoundation 0x1b314dc34 CFRunLoopRunSpecific + 424
5 Foundation 0x1b3490bcc -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 228
6 Foundation 0x1b3490aac -[NSRunLoop(NSRunLoop) runUntilDate:] + 88
7 UIKitCore 0x1b7322160 -[UIEventFetcher threadMain] + 152
8 Foundation 0x1b35bf9d0 __NSThread__start__ + 848
9 libsystem_pthread.dylib 0x1b2eebd98 _pthread_start + 156
10 libsystem_pthread.dylib 0x1b2eef74c thread_start + 8
com.twitter.crashlytics.ios.MachExceptionServer
com.twitter.crashlytics.ios.MachExceptionServer
0 MyApp 0x104d7b448 CLSProcessRecordAllThreads + 4376982600
1 MyApp 0x104d7b830 CLSProcessRecordAllThreads + 4376983600
2 MyApp 0x104d6b09c CLSHandler + 4376916124
3 MyApp 0x104d66ac4 CLSMachExceptionServer + 4376898244
4 libsystem_pthread.dylib 0x1b2eebd98 _pthread_start + 156
5 libsystem_pthread.dylib 0x1b2eef74c thread_start + 8
com.apple.root.background-qos
com.apple.root.background-qos
0 libsystem_malloc.dylib 0x1b2ec6154 calloc + 98
1 CoreFoundation 0x1b31e23c4 __CFAllocateObject + 20
2 CoreFoundation 0x1b3205b38 __NSDictionaryM_new + 128
3 Foundation 0x1b3586e68 _encodeObject + 964
4 Foundation 0x1b34a2334 -[NSKeyedArchiver _encodeArrayOfObjects:forKey:] + 360
5 Foundation 0x1b3586f58 _encodeObject + 1204
6 MyApp 0x104d372f8 Album.encode(with:) + 4376703736 (<compiler-generated>:4376703736)
7 MyApp 0x104d37354 #objc Album.encode(with:) + 4376703828 (<compiler-generated>:4376703828)
8 Foundation 0x1b3586f58 _encodeObject + 1204
9 Foundation 0x1b34a2334 -[NSKeyedArchiver _encodeArrayOfObjects:forKey:] + 360
10 Foundation 0x1b3586f58 _encodeObject + 1204
11 MyApp 0x104cec884 Series.encode(with:) + 4376397956 (<compiler-generated>:4376397956)
12 MyApp 0x104cec93c #objc Series.encode(with:) + 4376398140 (<compiler-generated>:4376398140)
13 Foundation 0x1b3586f58 _encodeObject + 1204
14 Foundation 0x1b34a2334 -[NSKeyedArchiver _encodeArrayOfObjects:forKey:] + 360
15 Foundation 0x1b3586f58 _encodeObject + 1204
16 MyApp 0x104cfcaf0 User.encode(with:) + 4376464112 (<compiler-generated>:4376464112)
17 MyApp 0x104cfcc64 #objc User.encode(with:) + 4376464484 (<compiler-generated>:4376464484)
18 Foundation 0x1b3586f58 _encodeObject + 1204
19 Foundation 0x1b34a2334 -[NSKeyedArchiver _encodeArrayOfObjects:forKey:] + 360
20 Foundation 0x1b34ccea0 -[NSDictionary(NSDictionary) encodeWithCoder:] + 876
21 Foundation 0x1b3586f58 _encodeObject + 1204
22 Foundation 0x1b34ed5c8 +[NSKeyedArchiver archivedDataWithRootObject:] + 124
23 SwiftyUserDefaults 0x105c9b8c4 $sSo14NSUserDefaultsC010SwiftyUserB0E7archiveyyAC0B3KeyCyxSgG_AGtlF + 292
24 MyApp 0x104d3a7f8 closure #1 in UserManager._cachedSavedUsers.didset + 4376717304 (<compiler-generated>:4376717304)
25 MyApp 0x104d05e10 partial apply for closure #1 in ThreadManager.executeOnMainThread(afterSeconds:withBlock:) + 4376501776 (<compiler-generated>:4376501776)
26 MyApp 0x104d5fc98 thunk for #escaping #callee_guaranteed () -> () + 4376870040 (<compiler-generated>:4376870040)
27 libdispatch.dylib 0x1b2e9a9a8 _dispatch_call_block_and_release + 24
28 libdispatch.dylib 0x1b2e9b524 _dispatch_client_callout + 16
29 libdispatch.dylib 0x1b2e8165c _dispatch_root_queue_drain + 640
30 libdispatch.dylib 0x1b2e81cd0 _dispatch_worker_thread2 + 112
31 libsystem_pthread.dylib 0x1b2eecb38 _pthread_wqthread + 212
32 libsystem_pthread.dylib 0x1b2eef740 start_wqthread + 8
com.apple.NSURLConnectionLoader
com.apple.NSURLConnectionLoader
0 libsystem_kernel.dylib 0x1b2fa9198 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x1b2fa860c mach_msg + 72
2 CoreFoundation 0x1b31533b4 __CFRunLoopServiceMachPort + 148
3 CoreFoundation 0x1b314e3e8 __CFRunLoopRun + 1160
4 CoreFoundation 0x1b314dc34 CFRunLoopRunSpecific + 424
5 CFNetwork 0x1b6412c44 (Missing)
6 Foundation 0x1b35bf9d0 __NSThread__start__ + 848
7 libsystem_pthread.dylib 0x1b2eebd98 _pthread_start + 156
8 libsystem_pthread.dylib 0x1b2eef74c thread_start + 8
com.apple.root.background-qos
com.apple.root.background-qos
0 libsystem_platform.dylib 0x1b2edd948 _platform_memmove + 88
1 libsystem_malloc.dylib 0x1b2ebc628 szone_realloc + 544
2 libsystem_malloc.dylib 0x1b2ec5a9c malloc_zone_realloc + 168
3 libsystem_malloc.dylib 0x1b2ec625c realloc + 196
4 CoreFoundation 0x1b30f3948 __CFSafelyReallocate + 28
5 Foundation 0x1b3555ea0 _NSMutableDataGrowBytes + 344
6 Foundation 0x1b34a2a34 -[NSConcreteMutableData appendBytes:length:] + 340
7 CoreFoundation 0x1b30fcfac writeBytes + 164
8 CoreFoundation 0x1b30fa01c bufferWrite + 320
9 CoreFoundation 0x1b30fd144 _appendString + 264
10 CoreFoundation 0x1b30fa1b8 _appendObject + 348
11 CoreFoundation 0x1b30f99fc __CFBinaryPlistWriteOrPresize + 528
12 Foundation 0x1b34a27d0 -[NSKeyedArchiver finishEncoding] + 528
13 Foundation 0x1b34ed5d8 +[NSKeyedArchiver archivedDataWithRootObject:] + 140
14 SwiftyUserDefaults 0x105c9b8c4 $sSo14NSUserDefaultsC010SwiftyUserB0E7archiveyyAC0B3KeyCyxSgG_AGtlF + 292
15 MyApp 0x104d3a3bc closure #1 in UserManager._cachedActiveUser.didset + 4376716220 (<compiler-generated>:4376716220)
16 MyApp 0x104d05e10 partial apply for closure #1 in ThreadManager.executeOnMainThread(afterSeconds:withBlock:) + 4376501776 (<compiler-generated>:4376501776)
17 MyApp 0x104d5fc98 thunk for #escaping #callee_guaranteed () -> () + 4376870040 (<compiler-generated>:4376870040)
18 libdispatch.dylib 0x1b2e9a9a8 _dispatch_call_block_and_release + 24
19 libdispatch.dylib 0x1b2e9b524 _dispatch_client_callout + 16
20 libdispatch.dylib 0x1b2e8165c _dispatch_root_queue_drain + 640
21 libdispatch.dylib 0x1b2e81cd0 _dispatch_worker_thread2 + 112
22 libsystem_pthread.dylib 0x1b2eecb38 _pthread_wqthread + 212
23 libsystem_pthread.dylib 0x1b2eef740 start_wqthread + 8
AVAudioSession Notify Thread
AVAudioSession Notify Thread
0 libsystem_kernel.dylib 0x1b2fa9198 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x1b2fa860c mach_msg + 72
2 CoreFoundation 0x1b31533b4 __CFRunLoopServiceMachPort + 148
3 CoreFoundation 0x1b314e3e8 __CFRunLoopRun + 1160
4 CoreFoundation 0x1b314dc34 CFRunLoopRunSpecific + 424
5 AVFAudio 0x1bfef65dc GenericRunLoopThread::Entry(void*) + 156
6 AVFAudio 0x1bff47300 CAPThread::Entry(CAPThread*) + 204
7 libsystem_pthread.dylib 0x1b2eebd98 _pthread_start + 156
8 libsystem_pthread.dylib 0x1b2eef74c thread_start + 8
Thread #1
Thread
0 libsystem_kernel.dylib 0x1b2fcb940 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x1b2eecbc0 _pthread_wqthread + 348
2 libsystem_pthread.dylib 0x1b2eef740 start_wqthread + 8
Thread #2
Thread
0 libsystem_pthread.dylib 0x1b2eef738 start_wqthread + 190
com.apple.root.background-qos
com.apple.root.background-qos
0 CoreFoundation 0x1b3206828 mdict_rehashd + 244
1 CoreFoundation 0x1b30b8f00 -[__NSDictionaryM __setObject:forKey:] + 888
2 Foundation 0x1b35876d8 addValueToTopContainerE + 128
3 Foundation 0x1b3587180 _encodeObject + 1756
4 Foundation 0x1b34a2334 -[NSKeyedArchiver _encodeArrayOfObjects:forKey:] + 360
5 Foundation 0x1b3586f58 _encodeObject + 1204
6 MyApp 0x104d372f8 Album.encode(with:) + 4376703736 (<compiler-generated>:4376703736)
7 MyApp 0x104d37354 #objc Album.encode(with:) + 4376703828 (<compiler-generated>:4376703828)
8 Foundation 0x1b3586f58 _encodeObject + 1204
9 Foundation 0x1b34a2334 -[NSKeyedArchiver _encodeArrayOfObjects:forKey:] + 360
10 Foundation 0x1b3586f58 _encodeObject + 1204
11 MyApp 0x104cec884 Series.encode(with:) + 4376397956 (<compiler-generated>:4376397956)
12 MyApp 0x104cec93c #objc Series.encode(with:) + 4376398140 (<compiler-generated>:4376398140)
13 Foundation 0x1b3586f58 _encodeObject + 1204
14 Foundation 0x1b34a2334 -[NSKeyedArchiver _encodeArrayOfObjects:forKey:] + 360
15 Foundation 0x1b3586f58 _encodeObject + 1204
16 MyApp 0x104cfcaf0 User.encode(with:) + 4376464112 (<compiler-generated>:4376464112)
17 MyApp 0x104cfcc64 #objc User.encode(with:) + 4376464484 (<compiler-generated>:4376464484)
18 Foundation 0x1b3586f58 _encodeObject + 1204
19 Foundation 0x1b34a2334 -[NSKeyedArchiver _encodeArrayOfObjects:forKey:] + 360
20 Foundation 0x1b34ccea0 -[NSDictionary(NSDictionary) encodeWithCoder:] + 876
21 Foundation 0x1b3586f58 _encodeObject + 1204
22 Foundation 0x1b34ed5c8 +[NSKeyedArchiver archivedDataWithRootObject:] + 124
23 SwiftyUserDefaults 0x105c9b8c4 $sSo14NSUserDefaultsC010SwiftyUserB0E7archiveyyAC0B3KeyCyxSgG_AGtlF + 292
24 MyApp 0x104d3a7f8 closure #1 in UserManager._cachedSavedUsers.didset + 4376717304 (<compiler-generated>:4376717304)
25 MyApp 0x104d05e10 partial apply for closure #1 in ThreadManager.executeOnMainThread(afterSeconds:withBlock:) + 4376501776 (<compiler-generated>:4376501776)
26 MyApp 0x104d5fc98 thunk for #escaping #callee_guaranteed () -> () + 4376870040 (<compiler-generated>:4376870040)
27 libdispatch.dylib 0x1b2e9a9a8 _dispatch_call_block_and_release + 24
28 libdispatch.dylib 0x1b2e9b524 _dispatch_client_callout + 16
29 libdispatch.dylib 0x1b2e8165c _dispatch_root_queue_drain + 640
30 libdispatch.dylib 0x1b2e81cd0 _dispatch_worker_thread2 + 112
31 libsystem_pthread.dylib 0x1b2eecb38 _pthread_wqthread + 212
32 libsystem_pthread.dylib 0x1b2eef740 start_wqthread + 8
com.apple.root.background-qos
com.apple.root.background-qos
0 libobjc.A.dylib 0x1b2f12aa8 objc_release + 24
1 libswiftCore.dylib 0x1c0914680 swift_arrayDestroy + 68
2 libswiftCore.dylib 0x1c06d38c8 _DictionaryStorage.deinit + 360
3 libswiftCore.dylib 0x1c06d394c _DictionaryStorage.__deallocating_deinit + 12
4 libswiftCore.dylib 0x1c091e320 _swift_release_dealloc + 28
5 SwiftyJSON 0x105c396d0 $s10SwiftyJSON6unwrap33_4625CC38AABF536BB76490A35D7233C9LLyypypF + 1400
6 SwiftyJSON 0x105c394a4 $s10SwiftyJSON6unwrap33_4625CC38AABF536BB76490A35D7233C9LLyypypF + 844
7 SwiftyJSON 0x105c395d8 $s10SwiftyJSON6unwrap33_4625CC38AABF536BB76490A35D7233C9LLyypypF + 1152
8 SwiftyJSON 0x105c394a4 $s10SwiftyJSON6unwrap33_4625CC38AABF536BB76490A35D7233C9LLyypypF + 844
9 SwiftyJSON 0x105c394a4 $s10SwiftyJSON6unwrap33_4625CC38AABF536BB76490A35D7233C9LLyypypF + 844
10 SwiftyJSON 0x105c394a4 $s10SwiftyJSON6unwrap33_4625CC38AABF536BB76490A35D7233C9LLyypypF + 844
11 SwiftyJSON 0x105c395d8 $s10SwiftyJSON6unwrap33_4625CC38AABF536BB76490A35D7233C9LLyypypF + 1152
12 SwiftyJSON 0x105c394a4 $s10SwiftyJSON6unwrap33_4625CC38AABF536BB76490A35D7233C9LLyypypF + 844
13 SwiftyJSON 0x105c383e4 $s10SwiftyJSON0B0V6objectypvs + 44
14 SwiftyJSON 0x105c49ccc $s10SwiftyJSON0B0V10jsonObjectACyp_tc33_4625CC38AABF536BB76490A35D7233C9LlfCTf4nd_n + 164
15 SwiftyJSON 0x105c49f00 $s10SwiftyJSON0B0VyACypcfCTf4nd_n + 152
16 SwiftyJSON 0x105c381ac $s10SwiftyJSON0B0VyACypcfC + 28
17 MyApp 0x104d521e4 specialized NetworkManager.networkRequestResponseHandler(withResponse:completionHandler:retryHandler:) + 51 (NetworkManager.swift:51)
18 MyApp 0x104d51404 closure #1 in NetworkManager.fetchDeezerTracks(forAlbum:withAccessToken:withCompletionHandler:) + 4376810500
19 MyApp 0x104d50294 closure #1 in NetworkManager.fetchAppleMusicTracks(forAlbumID:withAccessToken:withCompletionHandler:) + 4376806036
20 Alamofire 0x105313e64 $s9Alamofire15DownloadRequestC8response5queue0D10Serializer17completionHandlerACXDSo012OS_dispatch_E0CSg_xyAA0B8ResponseVy16SerializedObjectQzGctAA0bkF8ProtocolRzlFyycfU_yycfU_AA0bkF0VyypG_Tg5Tm + 132
21 Alamofire 0x105319d08 $s9Alamofire15DownloadRequestC8response5queue0D10Serializer17completionHandlerACXDSo012OS_dispatch_E0CSg_xyAA0B8ResponseVy16SerializedObjectQzGctAA0bkF8ProtocolRzlFyycfU_yycfU_AA0bkF0VyypG_Tg5TATm + 36
22 Alamofire 0x1052fb3b0 $sIeg_IeyB_TR + 28
23 libdispatch.dylib 0x1b2e9a9a8 _dispatch_call_block_and_release + 24
24 libdispatch.dylib 0x1b2e9b524 _dispatch_client_callout + 16
25 libdispatch.dylib 0x1b2e8165c _dispatch_root_queue_drain + 640
26 libdispatch.dylib 0x1b2e81cd0 _dispatch_worker_thread2 + 112
27 libsystem_pthread.dylib 0x1b2eecb38 _pthread_wqthread + 212
28 libsystem_pthread.dylib 0x1b2eef740 start_wqthread + 8
com.google.fira.worker
com.google.fira.worker
0 libsqlite3.dylib 0x1b4df32a8 sqlite3_exec + 26552
1 libsqlite3.dylib 0x1b4dee810 sqlite3_exec + 7456
2 libsqlite3.dylib 0x1b4ded6fc sqlite3_exec + 3084
3 libsqlite3.dylib 0x1b4decc3c sqlite3_exec + 332
4 MyApp 0x104e1d0cc -[APMSqliteStore beginTransaction] + 4377645260
5 MyApp 0x104e1cf18 -[APMSqliteStore performTransactionWithError:block:] + 4377644824
6 MyApp 0x104dd9444 -[APMDatabase performTransaction:] + 4377367620
7 MyApp 0x104df2a5c -[APMMeasurement writeEventOnWorkerQueue:] + 4377471580
8 MyApp 0x104df2280 -[APMMeasurement handleEventOnWorkerQueue:] + 4377469568
9 MyApp 0x104df1500 __27-[APMMeasurement logEvent:]_block_invoke + 4377466112
10 MyApp 0x104e06f50 __51-[APMScheduler scheduleOnWorkerQueueBlockID:block:]_block_invoke + 4377554768
11 libdispatch.dylib 0x1b2e9a9a8 _dispatch_call_block_and_release + 24
12 libdispatch.dylib 0x1b2e9b524 _dispatch_client_callout + 16
13 libdispatch.dylib 0x1b2e78b3c _dispatch_lane_serial_drain$VARIANT$armv81 + 564
14 libdispatch.dylib 0x1b2e7954c _dispatch_lane_invoke$VARIANT$armv81 + 396
15 libdispatch.dylib 0x1b2e8284c _dispatch_workloop_worker_thread + 580
16 libsystem_pthread.dylib 0x1b2eecb74 _pthread_wqthread + 272
17 libsystem_pthread.dylib 0x1b2eef740 start_wqthread + 8
(Just a guess)
This reeks of threading issues (you can get odd threading cashes if you try and access/manipulate the same object from different threads, and looking at your code you have escaping closures on escaping closures all over the place), looking through your crash log maybe it has something to do with the UserManager seeing: this UserManager._cachedSavedUsers.didset twice and UserManager._cachedActiveUser.didset too, always followed by some writes.
Even shows up on the thread labeled com.twitter.crashlytics.ios.MachExceptionServer but that could be for any reason, just suspicious given all this other stuff too and that crashlytics is your crash reporting tool..
App will definitely crash (intermittently) if there's some encoding / property manipulation happening on this user manager / an app-wide cache and its not being accessed in a thread safe way
I got a crash report, which is about unrecognized selector sent to instance when saving MKMapItem into Data Store. According to MKMapItem documents(MKMapItem Document), it conforms to NSSecureCoding, which means that it should have no problem to save it into an NSManagedObject instance. it looks fine on ios 11 version, as i didn't receive crash report from the device with this version. Also, I walkthrough the feature that possibly saving MKMapItem on my phone. the context does save the NKMapItem into data store and the feature is working. Since my phone is running IOS 11, so I am thinking it could be about the version system??
Please correct me if misunderstand something.
Here is the crash report.
OS Version: iPhone OS 10.3.3 (14G60)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x181646fe0 __exceptionPreprocess + 124 (NSException.m:165)
1 libobjc.A.dylib 0x1800a8538 objc_exception_throw + 56 (objc-exception.mm:521)
2 CoreFoundation 0x18164def4 -[NSObject(NSObject) doesNotRecognizeSelector:] + 140 (NSObject.m:328)
3 CoreFoundation 0x18164af54 ___forwarding___ + 916 (NSForwarding.m:3126)
4 CoreFoundation 0x181546d4c _CF_forwarding_prep_0 + 92
5 Foundation 0x18209afd4 _encodeObject + 1176 (NSKeyedArchiver.m:873)
6 Foundation 0x1820a1e9c +[NSKeyedArchiver archivedDataWithRootObject:] + 168 (NSKeyedArchiver.m:421)
7 CoreData 0x18391ae28 -[NSSQLiteConnection execute] + 1952 (NSSQLiteConnection.m:4165)
8 CoreData 0x1839520e4 -[NSSQLiteConnection insertRow:] + 456 (NSSQLiteConnection.m:2966)
9 CoreData 0x183ae3df8 _writeChangesForSaveRequest + 824 (NSSQLCore_Functions.m:1561)
10 CoreData 0x183ae5584 _executeSaveChangesRequest + 388 (NSSQLCore_Functions.m:1622)
11 CoreData 0x183adb5f0 -[NSSQLSaveChangesRequestContext executeRequestUsingConnection:] + 44 (NSSQLSaveChangesRequestContext.m:103)
12 CoreData 0x1839f30c4 __52-[NSSQLDefaultConnectionManager handleStoreRequest:]_block_invoke + 256 (NSSQLConnectionManager.m:305)
13 libdispatch.dylib 0x1804fe9a0 _dispatch_client_callout + 16 (object.m:473)
14 libdispatch.dylib 0x18050bee0 _dispatch_barrier_sync_f_invoke + 84 (queue.c:3446)
15 CoreData 0x1839f2f64 -[NSSQLDefaultConnectionManager handleStoreRequest:] + 208 (NSSQLConnectionManager.m:290)
16 CoreData 0x183ab5824 -[NSSQLCoreDispatchManager routeStoreRequest:] + 272 (NSSQLCoreDispatchManager.m:56)
17 CoreData 0x183a2075c -[NSSQLCore dispatchRequest:withRetries:] + 236 (NSSQLCore.m:2726)
18 CoreData 0x183a1c578 -[NSSQLCore processSaveChanges:forContext:] + 200 (NSSQLCore.m:1569)
19 CoreData 0x183920f10 -[NSSQLCore executeRequest:withContext:error:] + 724 (NSSQLCore.m:1923)
20 CoreData 0x1839ff84c __65-[NSPersistentStoreCoordinator executeRequest:withContext:error:]_block_invoke + 3492 (NSPersistentStoreCoordinator.m:2820)
21 CoreData 0x1839f80f0 -[NSPersistentStoreCoordinator _routeHeavyweightBlock:] + 276 (NSPersistentStoreCoordinator.m:586)
22 CoreData 0x183920adc -[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 408 (NSPersistentStoreCoordinator.m:2706)
23 CoreData 0x18394197c -[NSManagedObjectContext save:] + 2548 (NSManagedObjectContext.m:1419)
24 myappName 0x10009421c coreDataManager.saveContext() + 92 (coreDataManager.swift:514)
25 myappName 0x1000b5970 closure #1 in eventUpdateManager.observeValue(forKeyPath:of:change:context:) + 64 (eventUpdateManager.swift:138)
26 myappName 0x100124924 thunk for #escaping #callee_guaranteed () -> () + 36 (customAnimationController.swift:0)
27 libdispatch.dylib 0x1804fe9e0 _dispatch_call_block_and_release + 24 (init.c:963)
28 libdispatch.dylib 0x1804fe9a0 _dispatch_client_callout + 16 (object.m:473)
29 libdispatch.dylib 0x1805035e8 _dispatch_main_queue_callback_4CF + 996 (inline_internal.h:2431)
30 CoreFoundation 0x1815f50c8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12 (CFRunLoop.c:1793)
31 CoreFoundation 0x1815f2ce4 __CFRunLoopRun + 1572 (CFRunLoop.c:3004)
32 CoreFoundation 0x181522da4 CFRunLoopRunSpecific + 424 (CFRunLoop.c:3113)
33 GraphicsServices 0x182f8d074 GSEventRunModal + 100 (GSEvent.c:2245)
34 UIKit 0x1877ddc9c UIApplicationMain + 208 (UIApplication.m:4089)
35 myappName 0x10005da1c main + 56 (receiptCollectionViewCell.swift:18)
36 libdyld.dylib 0x18053159c start + 4
Thread 0 name:
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x0000000180641014 __pthread_kill + 8
1 libsystem_pthread.dylib 0x000000018070b264 pthread_kill + 112 (pthread.c:1366)
2 libsystem_c.dylib 0x00000001805b59c4 abort + 140 (abort.c:91)
3 myappName 0x0000000100170ac8 uncaught_exception_handler + 72
4 CoreFoundation 0x0000000181647354 __handleUncaughtException + 628 (NSException.m:218)
5 libobjc.A.dylib 0x00000001800a8814 _objc_terminate() + 112 (objc-exception.mm:656)
6 myappName 0x0000000100155408 MSCrashesUncaughtCXXTerminateHandler() + 732 (MSCrashesCXXExceptionHandler.mm:171)
7 libc++abi.dylib 0x00000001800975d4 std::__terminate(void (*)()) + 16 (cxa_handlers.cpp:68)
8 libc++abi.dylib 0x00000001800971a8 __cxa_rethrow + 144 (cxa_exception.cpp:584)
9 libobjc.A.dylib 0x00000001800a86f8 objc_exception_rethrow + 44 (objc-exception.mm:559)
10 CoreData 0x0000000183941cb0 -[NSManagedObjectContext save:] + 3368 (NSManagedObjectContext.m:1548)
11 myappName 0x000000010009421c coreDataManager.saveContext() + 92 (coreDataManager.swift:514)
12 myappName 0x00000001000b5970 closure #1 in eventUpdateManager.observeValue(forKeyPath:of:change:context:) + 64 (eventUpdateManager.swift:138)
13 myappName 0x0000000100124924 thunk for #escaping #callee_guaranteed () -> () + 36 (customAnimationController.swift:0)
14 libdispatch.dylib 0x00000001804fe9e0 _dispatch_call_block_and_release + 24 (init.c:963)
15 libdispatch.dylib 0x00000001804fe9a0 _dispatch_client_callout + 16 (object.m:473)
16 libdispatch.dylib 0x00000001805035e8 _dispatch_main_queue_callback_4CF + 996 (inline_internal.h:2431)
17 CoreFoundation 0x00000001815f50c8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12 (CFRunLoop.c:1793)
18 CoreFoundation 0x00000001815f2ce4 __CFRunLoopRun + 1572 (CFRunLoop.c:3004)
19 CoreFoundation 0x0000000181522da4 CFRunLoopRunSpecific + 424 (CFRunLoop.c:3113)
20 GraphicsServices 0x0000000182f8d074 GSEventRunModal + 100 (GSEvent.c:2245)
21 UIKit 0x00000001877ddc9c UIApplicationMain + 208 (UIApplication.m:4089)
22 myappName 0x000000010005da1c main + 56 (receiptCollectionViewCell.swift:18)
23 libdyld.dylib 0x000000018053159c start + 4
In my application I am saving data to coredata in the main thread\queue and immediately after save, I fetch all the records to make sure I have not exceeded the size of my local store.
All happens on synchronously on the main thread.
I get random crashes:
[NSManagedObjectContext(_NSInternalChangeProcessing) _processRecentChanges:] + 2284
The core data has attributes indexed and I am wondering if the index generation happens after save returns and fetch catches the database during indexing and fails?
Also I see another thread NSPersistentStoreCoordinator.
What does this mean? I specifically send the coredata operations to be executed in main thread. Does coredata internally send it to another thread?
What could be causing the crash here? Would appreciate any help!
The stack trace looks like this:
Thread : Crashed: com.apple.main-thread
0 CoreFoundation 0x000000018214602c __CFBasicHashDrain + 196
1 CoreFoundation 0x0000000182145f9c __CFBasicHashDrain + 52
2 CoreData 0x0000000181de28c8 -[NSManagedObjectContext(_NSInternalChangeProcessing) _processRecentChanges:] + 2284
3 CoreData 0x0000000181ddadc4 _performRunLoopAction + 384
4 CoreFoundation 0x00000001820cc2a4 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
5 CoreFoundation 0x00000001820c9230 __CFRunLoopDoObservers + 360
6 CoreFoundation 0x00000001820c9610 __CFRunLoopRun + 836
7 CoreFoundation 0x0000000181ff52d4 CFRunLoopRunSpecific + 396
8 GraphicsServices 0x000000018b80b6fc GSEventRunModal + 168
9 UIKit 0x0000000186bbafac UIApplicationMain + 1488
10 MyApp 0x000000010002ba88 main (main.m:16)
11 libdyld.dylib 0x0000000193fb6a08 start + 4
Thread : NSPersistentStoreCoordinator 0x170666900
0 libsystem_platform.dylib 0x00000001941616a4 OSAtomicCompareAndSwap64Barrier + 12
1 libsystem_pthread.dylib 0x0000000194169428 _pthread_mutex_lock + 312
2 libsqlite3.dylib 0x0000000193c89d0c (null) + 20676
3 libsqlite3.dylib 0x0000000193cb30ec (null) + 20388
4 libsqlite3.dylib 0x0000000193cb27ac (null) + 18020
5 libsqlite3.dylib 0x0000000193cb255c (null) + 17428
6 libsqlite3.dylib 0x0000000193c85688 (null) + 2624
7 libsqlite3.dylib 0x0000000193caccf0 (null) + 56216
8 libsqlite3.dylib 0x0000000193c9f368 sqlite3_step + 528
9 CoreData 0x0000000181db47e8 _execute + 124
10 CoreData 0x0000000181dc5574 -[NSSQLiteConnection fetchResultSet:usingFetchPlan:] + 1664
11 CoreData 0x0000000181ec48f4 newFetchedRowsForFetchPlan_MT + 1544
12 CoreData 0x0000000181dcf4bc -[NSSQLCore fetchRowForObjectID:] + 1080
13 CoreData 0x0000000181dcedc0 -[NSSQLCore newValuesForObjectWithID:withContext:error:] + 280
14 CoreData 0x0000000181e89524 __95-[NSPersistentStoreCoordinator(_NSInternalMethods) newValuesForObjectWithID:withContext:error:]_block_invoke + 76
15 CoreData 0x0000000181e90028 gutsOfBlockToNSPersistentStoreCoordinatorPerform + 184
16 libdispatch.dylib 0x0000000193f89954 _dispatch_client_callout + 16
17 libdispatch.dylib 0x0000000193f931e4 _dispatch_barrier_sync_f_invoke + 76
18 CoreData 0x0000000181e81e98 _perform + 180
19 CoreData 0x0000000181dcebf0 -[NSPersistentStoreCoordinator(_NSInternalMethods) newValuesForObjectWithID:withContext:error:] + 160
20 CoreData 0x0000000181dce210 _PFFaultHandlerLookupRow + 352
21 CoreData 0x0000000181dcdc84 _PF_FulfillDeferredFault + 252
22 CoreData 0x0000000181dcda70 _sharedIMPL_pvfk_core + 116
23 CoreData 0x0000000181dde638 _PF_Handler_Public_GetProperty + 176
24 Foundation 0x0000000182f2c7c4 _sortedObjectsUsingDescriptors + 384
25 Foundation 0x0000000182f6a94c -[NSArray(NSKeyValueSorting) sortedArrayUsingDescriptors:] + 608
26 CoreData 0x0000000181dba32c -[NSManagedObjectContext executeFetchRequest:error:] + 3796
27 MyApp 0x00000001001b2b2c static MyApp.CacheHelper.fetchCacheEntriesInAscendingOrderByAccess (MyApp.CacheHelper.Type)(Swift.String) -> Swift.Optional<Swift.Array<Swift.AnyObject>> (CacheHelper.swift:155)
28 MyApp 0x0000000100145ee8 function signature specialization <Arg[0] = Owned To Guaranteed> of MyApp.Base.controlCapacity (MyApp.Base)() -> () (Base.swift:45)
29 MyApp 0x00000001001450a0 MyApp.Base.controlCapacity (MyApp.Base)() -> () (Base.swift)
30 MyApp 0x0000000100145c74 MyApp.Base.setCacheEntryInternal (MyApp.Base)(MyApp.CacheEntry) -> () (Base.swift:120)
31 libdispatch.dylib 0x0000000193f89994 _dispatch_call_block_and_release + 24
32 libdispatch.dylib 0x0000000193f89954 _dispatch_client_callout + 16
33 libdispatch.dylib 0x0000000193f940a4 _dispatch_queue_drain + 1448
34 libdispatch.dylib 0x0000000193f8ca5c _dispatch_queue_invoke + 132
35 libdispatch.dylib 0x0000000193f96318 _dispatch_root_queue_drain + 720
36 libdispatch.dylib 0x0000000193f97c4c _dispatch_worker_thread3 + 108
37 libsystem_pthread.dylib 0x000000019416922c _pthread_wqthread + 816`