the-blue-alliance / the-blue-alliance-ios

An iOS app for accessing information about the FIRST Robotics Competition.
MIT License
76 stars 23 forks source link

`SearchService.refreshTeams` periodically crashing app #932

Open ZachOrr opened 2 years ago

ZachOrr commented 2 years ago

I'm unable to reproduce this in the simulator or when connected to a physical device with a debugger, but the SearchService.refreshTeams is crashing periodically while navigating the app.

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Codes: 0x0000000000000001, 0x0000000000000000
VM Region Info: 0 is not in any region.  Bytes before following region: 4304125952
      REGION TYPE                 START - END      [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  
      __TEXT                   1008bc000-1008c0000 [   16K] r-x/r-x SM=COW  ...Blue Alliance
Exception Note:  EXC_CORPSE_NOTIFY
Termination Reason: SIGNAL 11 Segmentation fault: 11
Terminating Process: exc handler [15095]

Triggered by Thread:  1

Thread 0 name:
Thread 0:
0   libsystem_kernel.dylib          0x00000001b828d42c _kernelrpc_mach_vm_purgable_control_trap + 8
1   libsystem_kernel.dylib          0x00000001b828df0c mach_vm_purgable_control + 40 (mach_vm.c:395)
2   libsqlite3.dylib                0x000000019f439ac0 purgeableCacheRetainChunk + 104 (sqlite3.c:58069)
3   libsqlite3.dylib                0x000000019f51e454 purgeableCachePagePin + 172 (sqlite3.c:58439)
4   libsqlite3.dylib                0x000000019f4395f0 purgeableCacheFetch + 108 (sqlite3.c:58807)
5   libsqlite3.dylib                0x000000019f4cf2e8 getPageNormal + 76 (sqlite3.c:55738)
6   libsqlite3.dylib                0x000000019f4d9db4 getAndInitPage + 96 (sqlite3.c:65531)
7   libsqlite3.dylib                0x000000019f4631d4 moveToRoot + 596 (sqlite3.c:77515)
8   libsqlite3.dylib                0x000000019f46d4a4 sqlite3BtreeMovetoUnpacked + 232 (sqlite3.c:77778)
9   libsqlite3.dylib                0x000000019f453f30 sqlite3VdbeExec + 2556 (sqlite3.c:98192)
10  libsqlite3.dylib                0x000000019f452594 sqlite3_step + 308 (sqlite3.c:92004)
11  CoreData                        0x00000001881c2774 _execute + 112 (NSSQLiteConnection.m:4524)
12  CoreData                        0x00000001881c3fc8 -[NSSQLiteConnection execute] + 2328 (NSSQLiteConnection.m:4963)
13  CoreData                        0x00000001881c8b58 newFetchedRowsForFetchPlan_MT + 644 (NSSQLPerformanceDefinitions.m:2456)
14  CoreData                        0x00000001881e21dc _executeNewValuesForRelationshipFaultRequest + 3116 (NSSQLCore_Functions.m:459)
15  CoreData                        0x0000000188208b00 -[NSSQLRelationshipFaultRequestContext executeRequestCore:] + 32 (NSSQLRelationshipFaultRequestContext.m:44)
16  CoreData                        0x00000001882891f8 -[NSSQLStoreRequestContext executeRequestUsingConnection:] + 224 (NSSQLStoreRequestContext.m:174)
17  CoreData                        0x00000001881e8eec __52-[NSSQLDefaultConnectionManager handleStoreRequest:]_block_invoke + 68 (NSSQLConnectionManager.m:301)
18  CoreData                        0x00000001881ba674 __37-[NSSQLiteConnection performAndWait:]_block_invoke + 48 (NSSQLiteConnection.m:734)
19  libdispatch.dylib               0x0000000180843670 _dispatch_client_callout + 20 (object.m:560)
20  libdispatch.dylib               0x00000001808528c4 _dispatch_lane_barrier_sync_invoke_and_complete + 56 (queue.c:1016)
21  CoreData                        0x00000001881b87b0 -[NSSQLiteConnection performAndWait:] + 176 (NSSQLiteConnection.m:731)
22  CoreData                        0x00000001881c57a4 -[NSSQLDefaultConnectionManager handleStoreRequest:] + 248 (NSSQLConnectionManager.m:296)
23  CoreData                        0x00000001881d85c0 -[NSSQLCoreDispatchManager routeStoreRequest:] + 252 (NSSQLCoreDispatchManager.m:60)
24  CoreData                        0x00000001881ce460 -[NSSQLCore dispatchRequest:withRetries:] + 188 (NSSQLCore.m:3889)
25  CoreData                        0x000000018823b3dc -[NSSQLCore _newValuesForRelationship:forObjectWithID:withContext:error:] + 400 (NSSQLCore.m:2180)
26  CoreData                        0x00000001882019a4 -[NSSQLCore newValueForRelationship:forObjectWithID:withContext:error:] + 36 (NSSQLCore.m:2208)
27  CoreData                        0x00000001881fdb1c __110-[NSPersistentStoreCoordinator(_NSInternalMethods) newValueForRelationship:forObjectWithID:withContext:error:]_block_invoke + 152 (NSPersistentStoreCoordinator.m:4160)
28  CoreData                        0x00000001881c32dc -[NSPersistentStoreCoordinator _routeLightweightBlock:toStore:] + 268 (NSPersistentStoreCoordinator.m:565)
29  CoreData                        0x000000018828f8e0 -[NSPersistentStoreCoordinator(_NSInternalMethods) newValueForRelationship:forObjectWithID:withContext:error:] + 372 (NSPersistentStoreCoordinator.m:4156)
30  CoreData                        0x00000001881f2034 -[NSFaultHandler retainedFulfillAggregateFaultForObject:andRelationship:withContext:] + 612 (NSFaultHandler.m:1124)
31  CoreData                        0x000000018825cf70 -[_NSFaultingMutableSet willReadWithContents:] + 424 (_NSFaultingMutableSet.m:146)
32  CoreData                        0x000000018824f4b8 -[_NSFaultingMutableSet valueForKeyPath:] + 36 (_NSFaultingMutableSet.m:545)
33  Foundation                      0x000000018237782c -[NSObject(NSKeyValueCoding) valueForKeyPath:] + 268 (NSKeyValueCoding.m:513)
34  Foundation                      0x00000001823c0ea4 -[NSFunctionExpression expressionValueWithObject:context:] + 1496 (NSFunctionExpression.m:378)
35  Foundation                      0x00000001823aa9fc -[NSComparisonPredicate evaluateWithObject:substitutionVariables:] + 216 (NSComparisonPredicate.m:299)
36  Foundation                      0x00000001823799e0 -[NSCompoundPredicateOperator evaluatePredicates:withObject:substitutionVariables:] + 456 (NSCompoundPredicateOperator.m:96)
37  Foundation                      0x000000018237d7e4 -[NSCompoundPredicate evaluateWithObject:substitutionVariables:] + 248 (NSCompoundPredicate.m:278)
38  CoreData                        0x00000001882bdb64 -[NSFetchedResultsController _preprocessUpdatedObjects:insertsInfo:deletesInfo:updatesInfo:sectionsWithDeletes:newSectionNames:treatAsRefreshes:] + 408 (NSFetchedResultsController.m:1729)
39  CoreData                        0x00000001882a4a4c __82-[NSFetchedResultsController(PrivateMethods) _core_managedObjectContextDidChange:]_block_invoke + 1720 (NSFetchedResultsController.m:2100)
40  CoreData                        0x00000001881b80b4 developerSubmittedBlockToNSManagedObjectContextPerform + 156 (NSManagedObjectContext.m:3942)
41  CoreData                        0x00000001881b82dc -[NSManagedObjectContext performBlockAndWait:] + 208 (NSManagedObjectContext.m:4053)
42  CoreData                        0x00000001881a2580 -[NSFetchedResultsController _core_managedObjectContextDidChange:] + 140 (NSFetchedResultsController.m:2343)
43  CoreFoundation                  0x0000000180b62f88 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 28 (CFNotificationCenter.c:652)
44  CoreFoundation                  0x0000000180bfec3c ___CFXRegistrationPost_block_invoke + 52 (CFNotificationCenter.c:173)
45  CoreFoundation                  0x0000000180bd1ff4 _CFXRegistrationPost + 456 (CFNotificationCenter.c:199)
46  CoreFoundation                  0x0000000180b78df4 _CFXNotificationPost + 716 (CFNotificationCenter.c:1147)
47  Foundation                      0x0000000182377f58 -[NSNotificationCenter postNotificationName:object:userInfo:] + 96 (NSNotification.m:560)
48  CoreData                        0x00000001881c13e4 -[NSManagedObjectContext _createAndPostChangeNotification:deletions:updates:refreshes:deferrals:wasMerge:] + 2288 (NSManagedObjectContext.m:8521)
49  CoreData                        0x00000001881b843c -[NSManagedObjectContext _postRefreshedObjectsNotificationAndClearList] + 200 (NSManagedObjectContext.m:7471)
50  CoreData                        0x00000001881b6ad0 -[NSManagedObjectContext _processRecentChanges:] + 108 (NSManagedObjectContext.m:7550)
51  CoreData                        0x000000018829765c -[NSManagedObjectContext _mergeChangesFromDidSaveDictionary:usingObjectIDs:] + 4492 (NSManagedObjectContext.m:3681)
52  CoreData                        0x00000001882e5bf4 -[NSManagedObjectContext mergeChangesFromContextDidSaveNotification:] + 472 (NSManagedObjectContext.m:3709)
53  CoreData                        0x00000001881b80b4 developerSubmittedBlockToNSManagedObjectContextPerform + 156 (NSManagedObjectContext.m:3942)
54  libdispatch.dylib               0x0000000180843670 _dispatch_client_callout + 20 (object.m:560)
55  libdispatch.dylib               0x0000000180851b70 _dispatch_main_queue_callback_4CF + 944 (inline_internal.h:2601)
56  CoreFoundation                  0x0000000180b89d84 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 (CFRunLoop.c:1795)
57  CoreFoundation                  0x0000000180b43f5c __CFRunLoopRun + 2540 (CFRunLoop.c:3144)
58  CoreFoundation                  0x0000000180b57468 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
59  GraphicsServices                0x000000019c6fb38c GSEventRunModal + 164 (GSEvent.c:2200)
60  UIKitCore                       0x00000001834fa5d0 -[UIApplication _run] + 1100 (UIApplication.m:3493)
61  UIKitCore                       0x0000000183278f74 UIApplicationMain + 364 (UIApplication.m:5047)
62  The Blue Alliance               0x00000001008c323c main + 196 (main.swift:9)
63  dyld                            0x0000000100c39aa4 start + 520 (dyldMain.cpp:879)

Thread 1 name:
Thread 1 Crashed:
0   ???                             0x0000000000000000 0x0 + 0
1   The Blue Alliance               0x0000000100922f4c specialized Set.subtracting(_:) + 264 (<compiler-generated>:0)
2   The Blue Alliance               0x000000010091e3e8 closure #1 in closure #1 in SearchService.refreshTeams(userInitiated:) + 1488 (SearchService.swift:0)
3   TBAData                         0x0000000101214f64 partial apply for closure #1 in NSManagedObjectContext.performChangesAndWait(_:saved:errorRecorder:) + 44 (NSManagedObjectContext+Extension.swift:55)
4   TBAData                         0x00000001011b0c10 thunk for @callee_guaranteed () -> () + 20 (<compiler-generated>:0)
5   TBAData                         0x00000001011b0c30 thunk for @escaping @callee_guaranteed () -> () + 20 (<compiler-generated>:0)
6   CoreData                        0x00000001881b80b4 developerSubmittedBlockToNSManagedObjectContextPerform + 156 (NSManagedObjectContext.m:3942)
7   libdispatch.dylib               0x0000000180843670 _dispatch_client_callout + 20 (object.m:560)
8   libdispatch.dylib               0x00000001808528c4 _dispatch_lane_barrier_sync_invoke_and_complete + 56 (queue.c:1016)
9   CoreData                        0x00000001881b8314 -[NSManagedObjectContext performBlockAndWait:] + 264 (NSManagedObjectContext.m:4059)
10  TBAData                         0x0000000101214b38 NSManagedObjectContext.performChangesAndWait(_:saved:errorRecorder:) + 284 (NSManagedObjectContext+Extension.swift:54)
11  The Blue Alliance               0x000000010091ddd8 closure #1 in SearchService.refresh(userInitiated:) + 312
12  The Blue Alliance               0x000000010092259c partial apply for closure #1 in SearchService.refreshTeams(userInitiated:) + 64 (<compiler-generated>:0)
13  TBAKit                          0x000000010126b170 specialized closure #1 in TBAKit.callArray<A>(method:completion:) + 912 (TBAKit.swift:151)
14  TBAKit                          0x0000000101281498 closure #1 in TBAKitOperation.init(tbaKit:method:completion:) + 1000 (TBAKitOperation.swift:32)
15  TBAKit                          0x0000000101281534 thunk for @escaping @callee_guaranteed (@guaranteed Data?, @guaranteed NSURLResponse?, @guaranteed Error?) -> () + 148 (<compiler-generated>:0)
16  FirebasePerformance             0x0000000100fb87d4 __InstrumentDataTaskWithRequestCompletionHandler_block_invoke_2 + 220 (FPRNSURLSessionInstrument.m:307)
17  CFNetwork                       0x0000000181375178 __40-[__NSURLSessionLocal taskForClassInfo:]_block_invoke + 540 (LocalSession.mm:675)
18  CFNetwork                       0x0000000181386120 __49-[__NSCFLocalSessionTask _task_onqueue_didFinish]_block_invoke_2 + 196 (LocalSessionTask.mm:543)
19  libdispatch.dylib               0x0000000180841924 _dispatch_call_block_and_release + 32 (init.c:1517)
20  libdispatch.dylib               0x0000000180843670 _dispatch_client_callout + 20 (object.m:560)
21  libdispatch.dylib               0x000000018084adf4 _dispatch_lane_serial_drain + 672 (inline_internal.h:2601)
22  libdispatch.dylib               0x000000018084b99c _dispatch_lane_invoke + 444 (queue.c:3937)
23  libdispatch.dylib               0x00000001808561b8 _dispatch_workloop_worker_thread + 656 (queue.c:6727)
24  libsystem_pthread.dylib         0x00000001f1f4b0f4 _pthread_wqthread + 288 (pthread.c:2599)
25  libsystem_pthread.dylib         0x00000001f1f4ae94 start_wqthread + 8

Thread 2 name:
Thread 2:
0   libsystem_kernel.dylib          0x00000001b828d504 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x00000001b828db9c mach_msg + 76 (mach_msg.c:119)
2   CoreFoundation                  0x0000000180b3f738 __CFRunLoopServiceMachPort + 372 (CFRunLoop.c:2646)
3   CoreFoundation                  0x0000000180b43a2c __CFRunLoopRun + 1212 (CFRunLoop.c:3000)
4   CoreFoundation                  0x0000000180b57468 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
5   Foundation                      0x0000000182375c84 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 236 (NSRunLoop.m:373)
6   Foundation                      0x00000001823b6db8 -[NSRunLoop(NSRunLoop) runUntilDate:] + 92 (NSRunLoop.m:420)
7   UIKitCore                       0x000000018347374c -[UIEventFetcher threadMain] + 524 (UIEventFetcher.m:1167)
8   Foundation                      0x00000001823c53fc __NSThread__start__ + 808 (NSThread.m:972)
9   libsystem_pthread.dylib         0x00000001f1f4b9a4 _pthread_start + 148 (pthread.c:891)
10  libsystem_pthread.dylib         0x00000001f1f4aea0 thread_start + 8

Thread 3:
0   libsystem_pthread.dylib         0x00000001f1f4ae8c start_wqthread + 0

Thread 4 name:
Thread 4:
0   libsystem_kernel.dylib          0x00000001b828d504 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x00000001b828db9c mach_msg + 76 (mach_msg.c:119)
2   FirebaseCrashlytics             0x0000000100ec5394 FIRCLSMachExceptionReply + 100 (FIRCLSMachException.c:258)
3   FirebaseCrashlytics             0x0000000100ec5394 FIRCLSMachExceptionServer + 940 (FIRCLSMachException.c:176)
4   libsystem_pthread.dylib         0x00000001f1f4b9a4 _pthread_start + 148 (pthread.c:891)
5   libsystem_pthread.dylib         0x00000001f1f4aea0 thread_start + 8

Thread 5 name:
Thread 5:
0   libsystem_kernel.dylib          0x00000001b828d504 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x00000001b828db9c mach_msg + 76 (mach_msg.c:119)
2   CoreFoundation                  0x0000000180b3f738 __CFRunLoopServiceMachPort + 372 (CFRunLoop.c:2646)
3   CoreFoundation                  0x0000000180b43a2c __CFRunLoopRun + 1212 (CFRunLoop.c:3000)
4   CoreFoundation                  0x0000000180b57468 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
5   CFNetwork                       0x00000001815cd510 +[__CFN_CoreSchedulingSetRunnable _run:] + 464 (CoreSchedulingSet.mm:1372)
6   Foundation                      0x00000001823c53fc __NSThread__start__ + 808 (NSThread.m:972)
7   libsystem_pthread.dylib         0x00000001f1f4b9a4 _pthread_start + 148 (pthread.c:891)
8   libsystem_pthread.dylib         0x00000001f1f4aea0 thread_start + 8

Thread 6 name:
Thread 6:
0   libsystem_kernel.dylib          0x00000001b828d504 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x00000001b828db9c mach_msg + 76 (mach_msg.c:119)
2   CoreFoundation                  0x0000000180b3f738 __CFRunLoopServiceMachPort + 372 (CFRunLoop.c:2646)
3   CoreFoundation                  0x0000000180b43a2c __CFRunLoopRun + 1212 (CFRunLoop.c:3000)
4   CoreFoundation                  0x0000000180b57468 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
5   AudioSession                    0x0000000189f72308 CADeprecated::GenericRunLoopThread::Entry(void*) + 164 (GenericRunLoopThread.h:95)
6   AudioSession                    0x0000000189f7bd64 CADeprecated::CAPThread::Entry(CADeprecated::CAPThread*) + 92 (CAPThread.cpp:324)
7   libsystem_pthread.dylib         0x00000001f1f4b9a4 _pthread_start + 148 (pthread.c:891)
8   libsystem_pthread.dylib         0x00000001f1f4aea0 thread_start + 8

Thread 7:
0   libsystem_pthread.dylib         0x00000001f1f4ae8c start_wqthread + 0

Thread 8:
0   libsystem_pthread.dylib         0x00000001f1f4ae8c start_wqthread + 0

Thread 9:
0   libsystem_pthread.dylib         0x00000001f1f4ae8c start_wqthread + 0

Thread 10:
0   libsystem_pthread.dylib         0x00000001f1f4ae8c start_wqthread + 0

Thread 11:
0   libsystem_pthread.dylib         0x00000001f1f4ae8c start_wqthread + 0

Thread 12:
0   libsystem_pthread.dylib         0x00000001f1f4ae8c start_wqthread + 0

Thread 1 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000800   x1: 0x0000000000000008   x2: 0x0000000281619ae0   x3: 0x0000000100b182d0
    x4: 0x0000000100b18898   x5: 0x0000000000000003   x6: 0x0000000000000000   x7: 0x0000000000000000
    x8: 0x000000000000403f   x9: 0x000000000000000e  x10: 0x0000000000000001  x11: 0x007f0001408dae00
   x12: 0x0000000000000029  x13: 0x00000001408db080  x14: 0x0000000000000000  x15: 0x0000000281eb12e0
   x16: 0x0000000000000000  x17: 0xae028281881f2cf8  x18: 0x0000000000000000  x19: 0x0000000145400000
   x20: 0x0000000000000100  x21: 0x0000000000000800  x22: 0x0000000000000001  x23: 0x0000000101220598
   x24: 0x0000000101220598  x25: 0x0000000000000874  x26: 0x0000000145eac038  x27: 0x0000000145eac000
   x28: 0x0000000000003fff   fp: 0x000000016f76dd90   lr: 0x0000000100922d24
    sp: 0x000000016f76dc90   pc: 0x0000000000000000 cpsr: 0x20001000
   esr: 0x82000006 (Instruction Abort) Translation fault