ccgus / fmdb

A Cocoa / Objective-C wrapper around SQLite
Other
13.84k stars 2.77k forks source link

Crashed: fmdb.<FMDatabaseQueue: 0x28205def0> EXC_BREAKPOINT #754

Closed Daemonson closed 5 years ago

Daemonson commented 5 years ago

Some of our users encountered lots of crash in Fmdb queue. These devices iOS versions are iOS 12.4.0 and iOS 12.3.1. Device models are like iPhone 7, iPhone 7Plus and iPhone 6Plus. We found these users almost can't startup the app, cause the crash happened before the app launch. They try and try many times. But the crash still happened. I don't know if the crash is caused by Fmdb. And we can't reproduce this crash in our app. Please give me some clue about this crash. Thanks a lot.

# Date: 2019-08-30T01:44:00Z
# OS Version: 12.4.0 (16G77)
# Device: iPhone 7
# RAM Free: 4.5%
# Disk Free: 7%

#0. Crashed: fmdb.<FMDatabaseQueue: 0x280de8f90>
0  libsystem_platform.dylib       0x1c520b04c _os_unfair_lock_unowned_abort + 36
1  libsystem_platform.dylib       0x1c520c4f4 _os_unfair_lock_unlock_slow + 144
2  libsqlite3.dylib               0x1c59faf18 sqlite3_snprintf + 3188
3  libsqlite3.dylib               0x1c59fab18 sqlite3_snprintf + 2164
4  libsqlite3.dylib               0x1c5a19c2c sqlite3_finalize + 11372
5  libsqlite3.dylib               0x1c5a18b00 sqlite3_finalize + 6976
6  libsqlite3.dylib               0x1c5a37ee4 sqlite3_step + 13664
7  libsqlite3.dylib               0x1c5a34b40 sqlite3_step + 444
8  MyAppName                     0x104aecff4 -[FMDatabase executeUpdate:error:withArgumentsInArray:orDictionary:orVAList:] + 1131 (FMDatabase.m:1131)
9  MyAppName                     0x104aed3e0 -[FMDatabase executeUpdate:] + 1222 (FMDatabase.m:1222)
10 MyAppName                     0x104aeda1c -[FMDatabase beginTransaction] + 1346 (FMDatabase.m:1346)
11 MyAppName                     0x104af0008 __46-[FMDatabaseQueue beginTransaction:withBlock:]_block_invoke + 223 (FMDatabaseQueue.m:223)
12 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
13 libdispatch.dylib              0x1c4febc1c _dispatch_lane_barrier_sync_invoke_and_complete + 56
14 MyAppName                     0x104aeff20 -[FMDatabaseQueue beginTransaction:withBlock:] + 241 (FMDatabaseQueue.m:241)
15 MyAppName                     0x1038624d0 -[SQDCDBManager queryTotalCount:] + 95 (SQDCDBManager.m:95)
16 MyAppName                     0x103f45cec +[SQDataCenter saveLogs:] + 128 (SQDataCenter.m:128)
17 MyAppName                     0x103f456d4 +[SQDataCenter trackEvent:label:eventList:parameters:] + 39 (SQDataCenter.m:39)
18 MyAppName                     0x1035e09e0 -[AppDelegate application:didFinishLaunchingWithOptions:] + 41 (AppDelegate.m:41)
19 UIKitCore                      0x1f204d0f0 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 412
20 UIKitCore                      0x1f204e854 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3352
21 UIKitCore                      0x1f2053fe0 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1540
22 UIKitCore                      0x1f19172a4 __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 776
23 UIKitCore                      0x1f191f83c +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 160
24 UIKitCore                      0x1f1916f28 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 236
25 UIKitCore                      0x1f1917818 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 1064
26 UIKitCore                      0x1f1915b64 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 744
27 UIKitCore                      0x1f191582c -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 428
28 UIKitCore                      0x1f191a36c __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 220
29 UIKitCore                      0x1f191b150 _performActionsWithDelayForTransitionContext + 112
30 UIKitCore                      0x1f191a224 -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 244
31 UIKitCore                      0x1f191ef24 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 360
32 UIKitCore                      0x1f20525e8 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 540
33 UIKitCore                      0x1f1c4ee04 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 360
34 FrontBoardServices             0x1c7f7a9fc -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 440
35 FrontBoardServices             0x1c7f8440c __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 256
36 FrontBoardServices             0x1c7f83c14 __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 64
37 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
38 libdispatch.dylib              0x1c4fe25dc _dispatch_block_invoke_direct$VARIANT$mp + 224
39 FrontBoardServices             0x1c7fb5040 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 40
40 FrontBoardServices             0x1c7fb4cdc -[FBSSerialQueue _performNext] + 408
41 FrontBoardServices             0x1c7fb5294 -[FBSSerialQueue _performNextFromRunLoopSource] + 52
42 CoreFoundation                 0x1c5590728 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
43 CoreFoundation                 0x1c55906a8 __CFRunLoopDoSource0 + 88
44 CoreFoundation                 0x1c558ff90 __CFRunLoopDoSources0 + 176
45 CoreFoundation                 0x1c558aecc __CFRunLoopRun + 1004
46 CoreFoundation                 0x1c558a7c0 CFRunLoopRunSpecific + 436
47 GraphicsServices               0x1c778b79c GSEventRunModal + 104
48 UIKitCore                      0x1f2055c38 UIApplicationMain + 212
49 MyAppName                     0x1047b2580 main + 18 (main.m:18)
50 libdyld.dylib                  0x1c504e8e0 start + 4

--

#0. Crashed: fmdb.<FMDatabaseQueue: 0x280de8f90>
0  libsystem_platform.dylib       0x1c520b04c _os_unfair_lock_unowned_abort + 36
1  libsystem_platform.dylib       0x1c520c4f4 _os_unfair_lock_unlock_slow + 144
2  libsqlite3.dylib               0x1c59faf18 sqlite3_snprintf + 3188
3  libsqlite3.dylib               0x1c59fab18 sqlite3_snprintf + 2164
4  libsqlite3.dylib               0x1c5a19c2c sqlite3_finalize + 11372
5  libsqlite3.dylib               0x1c5a18b00 sqlite3_finalize + 6976
6  libsqlite3.dylib               0x1c5a37ee4 sqlite3_step + 13664
7  libsqlite3.dylib               0x1c5a34b40 sqlite3_step + 444
8  MyAppName                     0x104aecff4 -[FMDatabase executeUpdate:error:withArgumentsInArray:orDictionary:orVAList:] + 1131 (FMDatabase.m:1131)
9  MyAppName                     0x104aed3e0 -[FMDatabase executeUpdate:] + 1222 (FMDatabase.m:1222)
10 MyAppName                     0x104aeda1c -[FMDatabase beginTransaction] + 1346 (FMDatabase.m:1346)
11 MyAppName                     0x104af0008 __46-[FMDatabaseQueue beginTransaction:withBlock:]_block_invoke + 223 (FMDatabaseQueue.m:223)
12 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
13 libdispatch.dylib              0x1c4febc1c _dispatch_lane_barrier_sync_invoke_and_complete + 56
14 MyAppName                     0x104aeff20 -[FMDatabaseQueue beginTransaction:withBlock:] + 241 (FMDatabaseQueue.m:241)
15 MyAppName                     0x1038624d0 -[SQDCDBManager queryTotalCount:] + 95 (SQDCDBManager.m:95)
16 MyAppName                     0x103f45cec +[SQDataCenter saveLogs:] + 128 (SQDataCenter.m:128)
17 MyAppName                     0x103f456d4 +[SQDataCenter trackEvent:label:eventList:parameters:] + 39 (SQDataCenter.m:39)
18 MyAppName                     0x1035e09e0 -[AppDelegate application:didFinishLaunchingWithOptions:] + 41 (AppDelegate.m:41)
19 UIKitCore                      0x1f204d0f0 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 412
20 UIKitCore                      0x1f204e854 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3352
21 UIKitCore                      0x1f2053fe0 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1540
22 UIKitCore                      0x1f19172a4 __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 776
23 UIKitCore                      0x1f191f83c +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 160
24 UIKitCore                      0x1f1916f28 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 236
25 UIKitCore                      0x1f1917818 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 1064
26 UIKitCore                      0x1f1915b64 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 744
27 UIKitCore                      0x1f191582c -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 428
28 UIKitCore                      0x1f191a36c __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 220
29 UIKitCore                      0x1f191b150 _performActionsWithDelayForTransitionContext + 112
30 UIKitCore                      0x1f191a224 -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 244
31 UIKitCore                      0x1f191ef24 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 360
32 UIKitCore                      0x1f20525e8 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 540
33 UIKitCore                      0x1f1c4ee04 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 360
34 FrontBoardServices             0x1c7f7a9fc -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 440
35 FrontBoardServices             0x1c7f8440c __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 256
36 FrontBoardServices             0x1c7f83c14 __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 64
37 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
38 libdispatch.dylib              0x1c4fe25dc _dispatch_block_invoke_direct$VARIANT$mp + 224
39 FrontBoardServices             0x1c7fb5040 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 40
40 FrontBoardServices             0x1c7fb4cdc -[FBSSerialQueue _performNext] + 408
41 FrontBoardServices             0x1c7fb5294 -[FBSSerialQueue _performNextFromRunLoopSource] + 52
42 CoreFoundation                 0x1c5590728 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
43 CoreFoundation                 0x1c55906a8 __CFRunLoopDoSource0 + 88
44 CoreFoundation                 0x1c558ff90 __CFRunLoopDoSources0 + 176
45 CoreFoundation                 0x1c558aecc __CFRunLoopRun + 1004
46 CoreFoundation                 0x1c558a7c0 CFRunLoopRunSpecific + 436
47 GraphicsServices               0x1c778b79c GSEventRunModal + 104
48 UIKitCore                      0x1f2055c38 UIApplicationMain + 212
49 MyAppName                     0x1047b2580 main + 18 (main.m:18)
50 libdyld.dylib                  0x1c504e8e0 start + 4

#1. com.autonavi.servicesQueue
0  libsystem_kernel.dylib         0x1c51900f4 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x1c518f5a0 mach_msg + 72
2  libdispatch.dylib              0x1c4ff4884 _dispatch_mach_send_and_wait_for_reply + 500
3  libdispatch.dylib              0x1c4ff4d14 dispatch_mach_send_with_result_and_wait_for_reply$VARIANT$mp + 52
4  libxpc.dylib                   0x1c525491c xpc_connection_send_message_with_reply_sync + 204
5  Security                       0x1c626789c securityd_message_with_reply_sync + 96
6  Security                       0x1c6267e1c securityd_send_sync_and_do + 80
7  Security                       0x1c62bdec0 __SecItemCopyMatching_block_invoke_2 + 236
8  Security                       0x1c62bcda0 __SecItemAuthDoQuery_block_invoke + 312
9  Security                       0x1c62bb70c SecItemAuthDo + 124
10 Security                       0x1c62bc0a0 SecItemAuthDoQuery + 504
11 Security                       0x1c62bddc8 __SecItemCopyMatching_block_invoke + 104
12 Security                       0x1c62b9d30 SecOSStatusWith + 48
13 Security                       0x1c62bc488 SecItemCopyMatching + 332
14 MyAppName                     0x104e4766c -[AMapFoundationKeychainManager setObject:forKey:] + 529968
15 MyAppName                     0x104e24708 -[AMapADIUManager ADIU] + 386764
16 MyAppName                     0x104e30ed8 __20-[AMapServices init]_block_invoke + 437916
17 libdispatch.dylib              0x1c503ca38 _dispatch_call_block_and_release + 24
18 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
19 libdispatch.dylib              0x1c4fe6324 _dispatch_lane_serial_drain$VARIANT$mp + 592
20 libdispatch.dylib              0x1c4fe6e40 _dispatch_lane_invoke$VARIANT$mp + 428
21 libdispatch.dylib              0x1c4fef4ac _dispatch_workloop_worker_thread + 596
22 libsystem_pthread.dylib        0x1c521e114 _pthread_wqthread + 304
23 libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4

#2. com.apple.Pasteboard.notification-queue
0  libsystem_kernel.dylib         0x1c519aee4 __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x1c5215cf8 _pthread_cond_wait$VARIANT$mp + 636
2  Foundation                     0x1c5fc6908 -[__NSOperationInternal _waitUntilFinished:] + 772
3  Foundation                     0x1c5f813f4 -[__NSObserver _doit:] + 240
4  CoreFoundation                 0x1c556fa28 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
5  CoreFoundation                 0x1c556f9f4 ___CFXRegistrationPost_block_invoke + 64
6  CoreFoundation                 0x1c556eee8 _CFXRegistrationPost + 392
7  CoreFoundation                 0x1c556eb94 ___CFXNotificationPost_block_invoke + 96
8  CoreFoundation                 0x1c54e8474 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1496
9  CoreFoundation                 0x1c556e644 _CFXNotificationPost + 696
10 Foundation                     0x1c5f576f4 -[NSNotificationCenter postNotificationName:object:userInfo:] + 68
11 Pasteboard                     0x1da119c4c __67+[PBServerConnection beginListeningToPasteboardChangeNotifications]_block_invoke_2
12 libsystem_notify.dylib         0x1c52032f4 notify_register_mach_port + 7436
13 libdispatch.dylib              0x1c4feb7f4 _dispatch_block_async_invoke2 + 104
14 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
15 libdispatch.dylib              0x1c4fe6324 _dispatch_lane_serial_drain$VARIANT$mp + 592
16 libdispatch.dylib              0x1c4fe6e40 _dispatch_lane_invoke$VARIANT$mp + 428
17 libdispatch.dylib              0x1c4fef4ac _dispatch_workloop_worker_thread + 596
18 libsystem_pthread.dylib        0x1c521e114 _pthread_wqthread + 304
19 libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4

#3. com.tencent.bugly.operationQueue (QOS: UTILITY)
0  libsystem_kernel.dylib         0x1c519aee4 __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x1c5215cf8 _pthread_cond_wait$VARIANT$mp + 636
2  Foundation                     0x1c5fc6908 -[__NSOperationInternal _waitUntilFinished:] + 772
3  Foundation                     0x1c5f94ecc -[NSOperationQueue waitUntilAllOperationsAreFinished] + 248
4  MyAppName                     0x10549a268 -[BLYDataManager fetchObjFromFileWithFileName:persistenceType:] + 17264
5  MyAppName                     0x10549a0a8 -[BLYDataManager fetchObjWithKey:persistenceType:] + 16816
6  MyAppName                     0x1054861dc -[BLYAnalyticsLogic userInfoPackage] + 4591864
7  MyAppName                     0x105485a40 -[BLYAnalyticsLogic jceModel] + 4589916
8  MyAppName                     0x10548d810 -[BLYCommonUploadLogic main] + 4622124
9  Foundation                     0x1c5f6f7c8 -[__NSOperationInternal _start:] + 740
10 Foundation                     0x1c6065c4c __NSOQSchedule_f + 272
11 libdispatch.dylib              0x1c503ca38 _dispatch_call_block_and_release + 24
12 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
13 libdispatch.dylib              0x1c4fe201c _dispatch_continuation_pop$VARIANT$mp + 412
14 libdispatch.dylib              0x1c4fe16e0 _dispatch_async_redirect_invoke + 600
15 libdispatch.dylib              0x1c4fee030 _dispatch_root_queue_drain + 372
16 libdispatch.dylib              0x1c4fee8d4 _dispatch_worker_thread2 + 128
17 libsystem_pthread.dylib        0x1c521e1b4 _pthread_wqthread + 464
18 libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4

#4. com.apple.uikit.eventfetch-thread
0  libsystem_kernel.dylib         0x1c51900f4 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x1c518f5a0 mach_msg + 72
2  CoreFoundation                 0x1c5590120 __CFRunLoopServiceMachPort + 236
3  CoreFoundation                 0x1c558b030 __CFRunLoopRun + 1360
4  CoreFoundation                 0x1c558a7c0 CFRunLoopRunSpecific + 436
5  Foundation                     0x1c5f58eac -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 300
6  Foundation                     0x1c5f58d3c -[NSRunLoop(NSRunLoop) runUntilDate:] + 96
7  UIKitCore                      0x1f213b754 -[UIEventFetcher threadMain] + 136
8  Foundation                     0x1c6085674 __NSThread__start__ + 984
9  libsystem_pthread.dylib        0x1c521d2c0 _pthread_body + 128
10 libsystem_pthread.dylib        0x1c521d220 _pthread_start + 44
11 libsystem_pthread.dylib        0x1c5220cdc thread_start + 4

#5. Thread
0  libsystem_pthread.dylib        0x1c5220cd0 start_wqthread + 190

#6. JavaScriptCore bmalloc scavenger
0  libsystem_kernel.dylib         0x1c519aee4 __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x1c5215cf8 _pthread_cond_wait$VARIANT$mp + 636
2  libc++.1.dylib                 0x1c4771090 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 24
3  JavaScriptCore                 0x1cc81ede0 void std::__1::condition_variable_any::wait<std::__1::unique_lock<bmalloc::Mutex> >(std::__1::unique_lock<bmalloc::Mutex>&) + 108
4  JavaScriptCore                 0x1cc822dd4 bmalloc::Scavenger::threadRunLoop() + 176
5  JavaScriptCore                 0x1cc82254c bmalloc::Scavenger::Scavenger(std::__1::lock_guard<bmalloc::Mutex>&) + 10
6  JavaScriptCore                 0x1cc823f8c std::__1::__thread_specific_ptr<std::__1::__thread_struct>::set_pointer(std::__1::__thread_struct*) + 38
7  libsystem_pthread.dylib        0x1c521d2c0 _pthread_body + 128
8  libsystem_pthread.dylib        0x1c521d220 _pthread_start + 44
9  libsystem_pthread.dylib        0x1c5220cdc thread_start + 4

#7. WebThread
0  libsystem_kernel.dylib         0x1c519aee4 __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x1c5215cf8 _pthread_cond_wait$VARIANT$mp + 636
2  JavaScriptCore                 0x1cc7e588c WTF::ThreadCondition::timedWait(WTF::Mutex&, WTF::WallTime) + 80
3  JavaScriptCore                 0x1cc7cc514 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 2004
4  JavaScriptCore                 0x1cc7bc7b4 WTF::LockAlgorithm<unsigned char, (unsigned char)1, (unsigned char)2, WTF::EmptyLockHooks<unsigned char> >::lockSlow(WTF::Atomic<unsigned char>&) + 232
5  WebCore                        0x1ce27b66c _WebThreadLock() + 264
6  WebCore                        0x1ce27e1f0 WebRunLoopLock(__CFRunLoopObserver*, unsigned long, void*) + 44
7  CoreFoundation                 0x1c558fd08 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
8  CoreFoundation                 0x1c558aa30 __CFRunLoopDoObservers + 412
9  CoreFoundation                 0x1c558b190 __CFRunLoopRun + 1712
10 CoreFoundation                 0x1c558a7c0 CFRunLoopRunSpecific + 436
11 WebCore                        0x1ce27dfc4 RunWebThread(void*) + 600
12 libsystem_pthread.dylib        0x1c521d2c0 _pthread_body + 128
13 libsystem_pthread.dylib        0x1c521d220 _pthread_start + 44
14 libsystem_pthread.dylib        0x1c5220cdc thread_start + 4

#8. com.apple.NSURLConnectionLoader
0  libsystem_kernel.dylib         0x1c51900f4 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x1c518f5a0 mach_msg + 72
2  CoreFoundation                 0x1c5590120 __CFRunLoopServiceMachPort + 236
3  CoreFoundation                 0x1c558b030 __CFRunLoopRun + 1360
4  CoreFoundation                 0x1c558a7c0 CFRunLoopRunSpecific + 436
5  CFNetwork                      0x1c5ba474c -[__CoreSchedulingSetRunnable runForever] + 216
6  Foundation                     0x1c6085674 __NSThread__start__ + 984
7  libsystem_pthread.dylib        0x1c521d2c0 _pthread_body + 128
8  libsystem_pthread.dylib        0x1c521d220 _pthread_start + 44
9  libsystem_pthread.dylib        0x1c5220cdc thread_start + 4

#9. com.tencent.bugly.persistenceQueue (QOS: UTILITY)
0  CoreFoundation                 0x1c55c92b8 __CFStrConvertBytesToUnicode + 16
1  CoreFoundation                 0x1c55b00a8 _CFStringCheckAndGetCharacters + 216
2  CoreFoundation                 0x1c54f0cdc -[__NSCFString getCharacters:range:] + 48
3  Foundation                     0x1c5f7eb34 -[NSString(NSPathUtilities) lastPathComponent] + 168
4  Foundation                     0x1c606a848 _NSCreateTemporaryFile_Protected + 776
5  Foundation                     0x1c606ad3c _NSWriteDataToFileWithExtendedAttributes + 272
6  MyAppName                     0x10549aa6c __77-[BLYDataManager persistData:ofType:enableNotifications:withCompletionBlock:]_block_invoke + 19316
7  Foundation                     0x1c6063ec8 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 16
8  Foundation                     0x1c5f702e0 -[NSBlockOperation main] + 72
9  Foundation                     0x1c5f6f7c8 -[__NSOperationInternal _start:] + 740
10 Foundation                     0x1c6065c4c __NSOQSchedule_f + 272
11 libdispatch.dylib              0x1c503ca38 _dispatch_call_block_and_release + 24
12 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
13 libdispatch.dylib              0x1c4fe201c _dispatch_continuation_pop$VARIANT$mp + 412
14 libdispatch.dylib              0x1c4fe16e0 _dispatch_async_redirect_invoke + 600
15 libdispatch.dylib              0x1c4fee030 _dispatch_root_queue_drain + 372
16 libdispatch.dylib              0x1c4fee8d4 _dispatch_worker_thread2 + 128
17 libsystem_pthread.dylib        0x1c521e1b4 _pthread_wqthread + 464
18 libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4

#10. Thread
0  libsystem_pthread.dylib        0x1c5220cd0 start_wqthread + 190

#11. MainRunloopMonitor
0  libsystem_kernel.dylib         0x1c5190148 semaphore_timedwait_trap + 8
1  libdispatch.dylib              0x1c4fdf888 _dispatch_sema4_timedwait$VARIANT$mp + 64
2  libdispatch.dylib              0x1c4fe01dc _dispatch_semaphore_wait_slow + 72
3  MyAppName                     0x1054a10cc -[BLYMainRunloopMonitorManager monitorThreadRun] + 45524
4  Foundation                     0x1c6085674 __NSThread__start__ + 984
5  libsystem_pthread.dylib        0x1c521d2c0 _pthread_body + 128
6  libsystem_pthread.dylib        0x1c521d220 _pthread_start + 44
7  libsystem_pthread.dylib        0x1c5220cdc thread_start + 4

#12. com.twitter.crashlytics.ios.MachExceptionServer
0  MyAppName                     0x1054f1d98 CLSProcessRecordAllThreads + 376480
1  MyAppName                     0x1054f2180 CLSProcessRecordAllThreads + 377480
2  MyAppName                     0x1054e19f8 CLSHandler + 310016
3  MyAppName                     0x1054dcdd8 CLSMachExceptionServer + 290528
4  libsystem_pthread.dylib        0x1c521d2c0 _pthread_body + 128
5  libsystem_pthread.dylib        0x1c521d220 _pthread_start + 44
6  libsystem_pthread.dylib        0x1c5220cdc thread_start + 4

#13. com.apple.root.default-qos
0  libsystem_kernel.dylib         0x1c519c8f4 kevent + 8
1  libsystem_info.dylib           0x1c514d190 _mdns_search_ex + 1972
2  libsystem_info.dylib           0x1c514c8f0 _mdns_search + 128
3  libsystem_info.dylib           0x1c514be94 mdns_addrinfo + 896
4  libsystem_info.dylib           0x1c5151be0 search_addrinfo + 264
5  libsystem_info.dylib           0x1c5155be8 si_addrinfo + 1652
6  libsystem_info.dylib           0x1c5149598 _getaddrinfo_internal + 196
7  libsystem_info.dylib           0x1c51494c8 getaddrinfo + 52
8  MyAppName                     0x104cf4e28 +[WXOMTAGCDAsyncSocket lookupHost:port:error:] + 4408299048
9  MyAppName                     0x104ce9220 __76-[WXOMTAGCDAsyncSocket connectToHost:onPort:viaInterface:withTimeout:error:]_block_invoke_2 + 4408250912
10 libdispatch.dylib              0x1c503ca38 _dispatch_call_block_and_release + 24
11 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
12 libdispatch.dylib              0x1c4fe1c80 _dispatch_queue_override_invoke + 684
13 libdispatch.dylib              0x1c4fee030 _dispatch_root_queue_drain + 372
14 libdispatch.dylib              0x1c4fee8d4 _dispatch_worker_thread2 + 128
15 libsystem_pthread.dylib        0x1c521e1b4 _pthread_wqthread + 464
16 libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4

#14. NSOperationQueue 0x2803dfd60 (QOS: UNSPECIFIED)
0  libsystem_kernel.dylib         0x1c51900f4 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x1c518f5a0 mach_msg + 72
2  CoreFoundation                 0x1c5590120 __CFRunLoopServiceMachPort + 236
3  CoreFoundation                 0x1c558b030 __CFRunLoopRun + 1360
4  CoreFoundation                 0x1c558a7c0 CFRunLoopRunSpecific + 436
5  Foundation                     0x1c5f58eac -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 300
6  MyAppName                     0x104e3d4a0 -[AMapMacFinderPingOperation start] + 488548
7  Foundation                     0x1c6065c4c __NSOQSchedule_f + 272
8  libdispatch.dylib              0x1c503ca38 _dispatch_call_block_and_release + 24
9  libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
10 libdispatch.dylib              0x1c4fe201c _dispatch_continuation_pop$VARIANT$mp + 412
11 libdispatch.dylib              0x1c4fe16e0 _dispatch_async_redirect_invoke + 600
12 libdispatch.dylib              0x1c4fee030 _dispatch_root_queue_drain + 372
13 libdispatch.dylib              0x1c4fee8d4 _dispatch_worker_thread2 + 128
14 libsystem_pthread.dylib        0x1c521e1b4 _pthread_wqthread + 464
15 libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4

#15. com.analysys.serialQueue
0  libsystem_kernel.dylib         0x1c519b9d4 __ulock_wait + 8
1  libdispatch.dylib              0x1c4fdfa5c _dispatch_ulock_wait + 56
2  libdispatch.dylib              0x1c4fdfb94 _dispatch_thread_event_wait_slow$VARIANT$mp + 48
3  libdispatch.dylib              0x1c4febec0 __DISPATCH_WAIT_FOR_QUEUE__ + 328
4  libdispatch.dylib              0x1c4febad8 _dispatch_sync_f_slow + 140
5  MyAppName                     0x105c31844 +[NSThread(ANSHelper) AnsRunOnMainThread:] + 1285324
6  MyAppName                     0x105c41564 +[ANSFileManager saveUserDefaultWithKey:value:] + 1350124
7  MyAppName                     0x105c2d280 -[AnalysysSDK isAppKeyChanged:] + 1267464
8  MyAppName                     0x105c291a8 __31-[AnalysysSDK startWithConfig:]_block_invoke_2 + 1250864
9  libdispatch.dylib              0x1c503ca38 _dispatch_call_block_and_release + 24
10 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
11 libdispatch.dylib              0x1c4fe6324 _dispatch_lane_serial_drain$VARIANT$mp + 592
12 libdispatch.dylib              0x1c4fe6e40 _dispatch_lane_invoke$VARIANT$mp + 428
13 libdispatch.dylib              0x1c4fef4ac _dispatch_workloop_worker_thread + 596
14 libsystem_pthread.dylib        0x1c521e114 _pthread_wqthread + 304
15 libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4

#16. com.apple.CFSocket.private
0  libsystem_kernel.dylib         0x1c519b328 __select + 8
1  CoreFoundation                 0x1c5598e04 __CFSocketManager + 620
2  libsystem_pthread.dylib        0x1c521d2c0 _pthread_body + 128
3  libsystem_pthread.dylib        0x1c521d220 _pthread_start + 44
4  libsystem_pthread.dylib        0x1c5220cdc thread_start + 4

#17. Thread
0  libsystem_pthread.dylib        0x1c5220cd0 start_wqthread + 190

#18. Thread
0  libsystem_pthread.dylib        0x1c5220cd0 start_wqthread + 190

Another stack trace:


# Date: 2019-08-30T02:36:00Z
# OS Version: 12.4.0 (16G77)
# Device: iPhone 7
# RAM Free: 5.1%
# Disk Free: 7%

#0. Crashed: fmdb.<FMDatabaseQueue: 0x28205def0>
0  libsystem_platform.dylib       0x1c520b04c _os_unfair_lock_unowned_abort + 36
1  libsystem_platform.dylib       0x1c520c4f4 _os_unfair_lock_unlock_slow + 144
2  libsqlite3.dylib               0x1c59faf18 sqlite3_snprintf + 3188
3  libsqlite3.dylib               0x1c59fab18 sqlite3_snprintf + 2164
4  libsqlite3.dylib               0x1c5a19c2c sqlite3_finalize + 11372
5  libsqlite3.dylib               0x1c5a18b00 sqlite3_finalize + 6976
6  libsqlite3.dylib               0x1c5a37ee4 sqlite3_step + 13664
7  libsqlite3.dylib               0x1c5a34b40 sqlite3_step + 444
8  MyAppName                     0x106230ff4 -[FMDatabase executeUpdate:error:withArgumentsInArray:orDictionary:orVAList:] + 1131 (FMDatabase.m:1131)
9  MyAppName                     0x1062313e0 -[FMDatabase executeUpdate:] + 1222 (FMDatabase.m:1222)
10 MyAppName                     0x106231a1c -[FMDatabase beginTransaction] + 1346 (FMDatabase.m:1346)
11 MyAppName                     0x106234008 __46-[FMDatabaseQueue beginTransaction:withBlock:]_block_invoke + 223 (FMDatabaseQueue.m:223)
12 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
13 libdispatch.dylib              0x1c4febc1c _dispatch_lane_barrier_sync_invoke_and_complete + 56
14 MyAppName                     0x106233f20 -[FMDatabaseQueue beginTransaction:withBlock:] + 241 (FMDatabaseQueue.m:241)
15 MyAppName                     0x104fa64d0 -[SQDCDBManager queryTotalCount:] + 95 (SQDCDBManager.m:95)
16 MyAppName                     0x105689cec +[SQDataCenter saveLogs:] + 128 (SQDataCenter.m:128)
17 MyAppName                     0x1056896d4 +[SQDataCenter trackEvent:label:eventList:parameters:] + 39 (SQDataCenter.m:39)
18 MyAppName                     0x105ca7cb8 -[UIViewController(SQDataCenter) sqdc_viewDidAppear:] + 42 (UIViewController+SQDataCenter.m:42)
19 MyAppName                     0x107377bfc ans_swizzledMethod_3_bool + 1294468
20 UIKitCore                      0x1f1ab1a20 -[UIViewController _setViewAppearState:isAnimating:] + 808
21 UIKitCore                      0x1f1ab4354 __64-[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:]_block_invoke + 44
22 UIKitCore                      0x1f1ab29c0 -[UIViewController _executeAfterAppearanceBlock] + 88
23 UIKitCore                      0x1f20611b8 _runAfterCACommitDeferredBlocks + 564
24 UIKitCore                      0x1f204fbfc _cleanUpAfterCAFlushAndRunDeferredBlocks + 352
25 UIKitCore                      0x1f206e868 __34-[UIApplication _firstCommitBlock]_block_invoke_2 + 136
26 CoreFoundation                 0x1c5590578 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 20
27 CoreFoundation                 0x1c558fe7c __CFRunLoopDoBlocks + 272
28 CoreFoundation                 0x1c558aee0 __CFRunLoopRun + 1024
29 CoreFoundation                 0x1c558a7c0 CFRunLoopRunSpecific + 436
30 GraphicsServices               0x1c778b79c GSEventRunModal + 104
31 UIKitCore                      0x1f2055c38 UIApplicationMain + 212
32 MyAppName                     0x105ef6580 main + 18 (main.m:18)
33 libdyld.dylib                  0x1c504e8e0 start + 4

--

#0. Crashed: fmdb.<FMDatabaseQueue: 0x28205def0>
0  libsystem_platform.dylib       0x1c520b04c _os_unfair_lock_unowned_abort + 36
1  libsystem_platform.dylib       0x1c520c4f4 _os_unfair_lock_unlock_slow + 144
2  libsqlite3.dylib               0x1c59faf18 sqlite3_snprintf + 3188
3  libsqlite3.dylib               0x1c59fab18 sqlite3_snprintf + 2164
4  libsqlite3.dylib               0x1c5a19c2c sqlite3_finalize + 11372
5  libsqlite3.dylib               0x1c5a18b00 sqlite3_finalize + 6976
6  libsqlite3.dylib               0x1c5a37ee4 sqlite3_step + 13664
7  libsqlite3.dylib               0x1c5a34b40 sqlite3_step + 444
8  MyAppName                     0x106230ff4 -[FMDatabase executeUpdate:error:withArgumentsInArray:orDictionary:orVAList:] + 1131 (FMDatabase.m:1131)
9  MyAppName                     0x1062313e0 -[FMDatabase executeUpdate:] + 1222 (FMDatabase.m:1222)
10 MyAppName                     0x106231a1c -[FMDatabase beginTransaction] + 1346 (FMDatabase.m:1346)
11 MyAppName                     0x106234008 __46-[FMDatabaseQueue beginTransaction:withBlock:]_block_invoke + 223 (FMDatabaseQueue.m:223)
12 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
13 libdispatch.dylib              0x1c4febc1c _dispatch_lane_barrier_sync_invoke_and_complete + 56
14 MyAppName                     0x106233f20 -[FMDatabaseQueue beginTransaction:withBlock:] + 241 (FMDatabaseQueue.m:241)
15 MyAppName                     0x104fa64d0 -[SQDCDBManager queryTotalCount:] + 95 (SQDCDBManager.m:95)
16 MyAppName                     0x105689cec +[SQDataCenter saveLogs:] + 128 (SQDataCenter.m:128)
17 MyAppName                     0x1056896d4 +[SQDataCenter trackEvent:label:eventList:parameters:] + 39 (SQDataCenter.m:39)
18 MyAppName                     0x105ca7cb8 -[UIViewController(SQDataCenter) sqdc_viewDidAppear:] + 42 (UIViewController+SQDataCenter.m:42)
19 MyAppName                     0x107377bfc ans_swizzledMethod_3_bool + 1294468
20 UIKitCore                      0x1f1ab1a20 -[UIViewController _setViewAppearState:isAnimating:] + 808
21 UIKitCore                      0x1f1ab4354 __64-[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:]_block_invoke + 44
22 UIKitCore                      0x1f1ab29c0 -[UIViewController _executeAfterAppearanceBlock] + 88
23 UIKitCore                      0x1f20611b8 _runAfterCACommitDeferredBlocks + 564
24 UIKitCore                      0x1f204fbfc _cleanUpAfterCAFlushAndRunDeferredBlocks + 352
25 UIKitCore                      0x1f206e868 __34-[UIApplication _firstCommitBlock]_block_invoke_2 + 136
26 CoreFoundation                 0x1c5590578 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 20
27 CoreFoundation                 0x1c558fe7c __CFRunLoopDoBlocks + 272
28 CoreFoundation                 0x1c558aee0 __CFRunLoopRun + 1024
29 CoreFoundation                 0x1c558a7c0 CFRunLoopRunSpecific + 436
30 GraphicsServices               0x1c778b79c GSEventRunModal + 104
31 UIKitCore                      0x1f2055c38 UIApplicationMain + 212
32 MyAppName                     0x105ef6580 main + 18 (main.m:18)
33 libdyld.dylib                  0x1c504e8e0 start + 4

#1. com.apple.Pasteboard.notification-queue
0  libsystem_kernel.dylib         0x1c519aee4 __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x1c5215cf8 _pthread_cond_wait$VARIANT$mp + 636
2  Foundation                     0x1c5fc6908 -[__NSOperationInternal _waitUntilFinished:] + 772
3  Foundation                     0x1c5f813f4 -[__NSObserver _doit:] + 240
4  CoreFoundation                 0x1c556fa28 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
5  CoreFoundation                 0x1c556f9f4 ___CFXRegistrationPost_block_invoke + 64
6  CoreFoundation                 0x1c556eee8 _CFXRegistrationPost + 392
7  CoreFoundation                 0x1c556eb94 ___CFXNotificationPost_block_invoke + 96
8  CoreFoundation                 0x1c54e8474 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1496
9  CoreFoundation                 0x1c556e644 _CFXNotificationPost + 696
10 Foundation                     0x1c5f576f4 -[NSNotificationCenter postNotificationName:object:userInfo:] + 68
11 Pasteboard                     0x1da119c4c __67+[PBServerConnection beginListeningToPasteboardChangeNotifications]_block_invoke_2
12 libsystem_notify.dylib         0x1c52032f4 notify_register_mach_port + 7436
13 libdispatch.dylib              0x1c4feb7f4 _dispatch_block_async_invoke2 + 104
14 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
15 libdispatch.dylib              0x1c4fe6324 _dispatch_lane_serial_drain$VARIANT$mp + 592
16 libdispatch.dylib              0x1c4fe6e40 _dispatch_lane_invoke$VARIANT$mp + 428
17 libdispatch.dylib              0x1c4fef4ac _dispatch_workloop_worker_thread + 596
18 libsystem_pthread.dylib        0x1c521e114 _pthread_wqthread + 304
19 libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4

#2. Thread
0  libsystem_pthread.dylib        0x1c5220cd0 start_wqthread + 190

#3. com.tencent.bugly.persistenceQueue (QOS: UTILITY)
0  libsystem_kernel.dylib         0x1c519c408 fsync + 8
1  Foundation                     0x1c606aeac _NSWriteDataToFileWithExtendedAttributes + 640
2  MyAppName                     0x106bdea6c __77-[BLYDataManager persistData:ofType:enableNotifications:withCompletionBlock:]_block_invoke + 19316
3  Foundation                     0x1c6063ec8 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 16
4  Foundation                     0x1c5f702e0 -[NSBlockOperation main] + 72
5  Foundation                     0x1c5f6f7c8 -[__NSOperationInternal _start:] + 740
6  Foundation                     0x1c6065c4c __NSOQSchedule_f + 272
7  libdispatch.dylib              0x1c503ca38 _dispatch_call_block_and_release + 24
8  libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
9  libdispatch.dylib              0x1c4fe201c _dispatch_continuation_pop$VARIANT$mp + 412
10 libdispatch.dylib              0x1c4fe16e0 _dispatch_async_redirect_invoke + 600
11 libdispatch.dylib              0x1c4fee030 _dispatch_root_queue_drain + 372
12 libdispatch.dylib              0x1c4fee8d4 _dispatch_worker_thread2 + 128
13 libsystem_pthread.dylib        0x1c521e1b4 _pthread_wqthread + 464
14 libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4

#4. com.apple.uikit.eventfetch-thread
0  libsystem_kernel.dylib         0x1c51900f4 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x1c518f5a0 mach_msg + 72
2  CoreFoundation                 0x1c5590120 __CFRunLoopServiceMachPort + 236
3  CoreFoundation                 0x1c558b030 __CFRunLoopRun + 1360
4  CoreFoundation                 0x1c558a7c0 CFRunLoopRunSpecific + 436
5  Foundation                     0x1c5f58eac -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 300
6  Foundation                     0x1c5f58d3c -[NSRunLoop(NSRunLoop) runUntilDate:] + 96
7  UIKitCore                      0x1f213b754 -[UIEventFetcher threadMain] + 136
8  Foundation                     0x1c6085674 __NSThread__start__ + 984
9  libsystem_pthread.dylib        0x1c521d2c0 _pthread_body + 128
10 libsystem_pthread.dylib        0x1c521d220 _pthread_start + 44
11 libsystem_pthread.dylib        0x1c5220cdc thread_start + 4

#5. com.apple.CoreLocation.0x1088542d0
0  libsystem_kernel.dylib         0x1c5190148 semaphore_timedwait_trap + 8
1  libdispatch.dylib              0x1c4fdf888 _dispatch_sema4_timedwait$VARIANT$mp + 64
2  libdispatch.dylib              0x1c4fe01dc _dispatch_semaphore_wait_slow + 72
3  CoreLocation                   0x1cc3a26cc CLClientInvalidate + 896
4  CoreLocation                   0x1cc3a77d4 CLClientStopVehicleHeadingUpdates + 1668
5  CoreLocation                   0x1cc400e4c CLGetControlPlaneStatusReport + 40940
6  CoreLocation                   0x1cc400d78 CLGetControlPlaneStatusReport + 40728
7  CoreLocation                   0x1cc3fbca4 CLGetControlPlaneStatusReport + 20036
8  CoreLocation                   0x1cc3fbb5c CLGetControlPlaneStatusReport + 19708
9  CoreLocation                   0x1cc3fde98 CLGetControlPlaneStatusReport + 28728
10 libxpc.dylib                   0x1c5255afc _xpc_connection_call_event_handler + 68
11 libxpc.dylib                   0x1c5255e60 _xpc_connection_mach_event + 856
12 libdispatch.dylib              0x1c503d894 _dispatch_client_callout4 + 16
13 libdispatch.dylib              0x1c4ff55c0 _dispatch_mach_msg_invoke$VARIANT$mp + 340
14 libdispatch.dylib              0x1c4fe61f0 _dispatch_lane_serial_drain$VARIANT$mp + 284
15 libdispatch.dylib              0x1c4ff61cc _dispatch_mach_invoke$VARIANT$mp + 476
16 libdispatch.dylib              0x1c4fe61f0 _dispatch_lane_serial_drain$VARIANT$mp + 284
17 libdispatch.dylib              0x1c4fe6e40 _dispatch_lane_invoke$VARIANT$mp + 428
18 libdispatch.dylib              0x1c4fef4ac _dispatch_workloop_worker_thread + 596
19 libsystem_pthread.dylib        0x1c521e114 _pthread_wqthread + 304
20 libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4

#6. io.answers.EventQueue (QOS: BACKGROUND)
0  libsystem_kernel.dylib         0x1c519ca5c lstat + 8
1  Foundation                     0x1c602ccb4 _NSFileExistsAtPath + 192
2  Foundation                     0x1c5f7d320 -[NSFileManager fileExistsAtPath:isDirectory:] + 128
3  Foundation                     0x1c5f7d624 -[NSURL(NSURL) initFileURLWithPath:] + 276
4  Foundation                     0x1c5f7d4fc +[NSURL(NSURL) fileURLWithPath:] + 48
5  MyAppName                     0x106c4c1d4 -[ANSAnswersController generateNewLogPath] + 467676
6  MyAppName                     0x106c4ba88 __56-[ANSAnswersController initWithBetaToken:rootDirectory:]_block_invoke + 465808
7  Foundation                     0x1c6063ec8 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 16
8  Foundation                     0x1c5f702e0 -[NSBlockOperation main] + 72
9  Foundation                     0x1c5f6f7c8 -[__NSOperationInternal _start:] + 740
10 Foundation                     0x1c6065c4c __NSOQSchedule_f + 272
11 libdispatch.dylib              0x1c4feb7f4 _dispatch_block_async_invoke2 + 104
12 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
13 libdispatch.dylib              0x1c4fe201c _dispatch_continuation_pop$VARIANT$mp + 412
14 libdispatch.dylib              0x1c4fe16e0 _dispatch_async_redirect_invoke + 600
15 libdispatch.dylib              0x1c4fee030 _dispatch_root_queue_drain + 372
16 libdispatch.dylib              0x1c4fee8d4 _dispatch_worker_thread2 + 128
17 libsystem_pthread.dylib        0x1c521e1b4 _pthread_wqthread + 464
18 libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4

#7. com.apple.root.default-qos
0  libsystem_kernel.dylib         0x1c519c8f4 kevent + 8
1  libsystem_info.dylib           0x1c514d190 _mdns_search_ex + 1972
2  libsystem_info.dylib           0x1c514c8f0 _mdns_search + 128
3  libsystem_info.dylib           0x1c514be94 mdns_addrinfo + 896
4  libsystem_info.dylib           0x1c5151be0 search_addrinfo + 264
5  libsystem_info.dylib           0x1c5155be8 si_addrinfo + 1652
6  libsystem_info.dylib           0x1c5149598 _getaddrinfo_internal + 196
7  libsystem_info.dylib           0x1c51494c8 getaddrinfo + 52
8  MyAppName                     0x106438e28 +[WXOMTAGCDAsyncSocket lookupHost:port:error:] + 4404186664
9  MyAppName                     0x10642d220 __76-[WXOMTAGCDAsyncSocket connectToHost:onPort:viaInterface:withTimeout:error:]_block_invoke_2 + 4404138528
10 libdispatch.dylib              0x1c503ca38 _dispatch_call_block_and_release + 24
11 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
12 libdispatch.dylib              0x1c4fe1c80 _dispatch_queue_override_invoke + 684
13 libdispatch.dylib              0x1c4fee030 _dispatch_root_queue_drain + 372
14 libdispatch.dylib              0x1c4fee8d4 _dispatch_worker_thread2 + 128
15 libsystem_pthread.dylib        0x1c521e1b4 _pthread_wqthread + 464
16 libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4

#8. com.apple.NSURLConnectionLoader
0  libsystem_kernel.dylib         0x1c51900f4 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x1c518f5a0 mach_msg + 72
2  CoreFoundation                 0x1c5590120 __CFRunLoopServiceMachPort + 236
3  CoreFoundation                 0x1c558b030 __CFRunLoopRun + 1360
4  CoreFoundation                 0x1c558a7c0 CFRunLoopRunSpecific + 436
5  CFNetwork                      0x1c5ba474c -[__CoreSchedulingSetRunnable runForever] + 216
6  Foundation                     0x1c6085674 __NSThread__start__ + 984
7  libsystem_pthread.dylib        0x1c521d2c0 _pthread_body + 128
8  libsystem_pthread.dylib        0x1c521d220 _pthread_start + 44
9  libsystem_pthread.dylib        0x1c5220cdc thread_start + 4

#9. JavaScriptCore bmalloc scavenger
0  libsystem_kernel.dylib         0x1c519aee4 __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x1c5215cf8 _pthread_cond_wait$VARIANT$mp + 636
2  libc++.1.dylib                 0x1c4771090 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 24
3  JavaScriptCore                 0x1cc81ede0 void std::__1::condition_variable_any::wait<std::__1::unique_lock<bmalloc::Mutex> >(std::__1::unique_lock<bmalloc::Mutex>&) + 108
4  JavaScriptCore                 0x1cc822dd4 bmalloc::Scavenger::threadRunLoop() + 176
5  JavaScriptCore                 0x1cc82254c bmalloc::Scavenger::Scavenger(std::__1::lock_guard<bmalloc::Mutex>&) + 10
6  JavaScriptCore                 0x1cc823f8c std::__1::__thread_specific_ptr<std::__1::__thread_struct>::set_pointer(std::__1::__thread_struct*) + 38
7  libsystem_pthread.dylib        0x1c521d2c0 _pthread_body + 128
8  libsystem_pthread.dylib        0x1c521d220 _pthread_start + 44
9  libsystem_pthread.dylib        0x1c5220cdc thread_start + 4

#10. WebThread
0  libsystem_kernel.dylib         0x1c519aee4 __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x1c5215cf8 _pthread_cond_wait$VARIANT$mp + 636
2  JavaScriptCore                 0x1cc7e588c WTF::ThreadCondition::timedWait(WTF::Mutex&, WTF::WallTime) + 80
3  JavaScriptCore                 0x1cc7cc514 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 2004
4  JavaScriptCore                 0x1cc7bc7b4 WTF::LockAlgorithm<unsigned char, (unsigned char)1, (unsigned char)2, WTF::EmptyLockHooks<unsigned char> >::lockSlow(WTF::Atomic<unsigned char>&) + 232
5  WebCore                        0x1ce27b66c _WebThreadLock() + 264
6  WebCore                        0x1ce27e1f0 WebRunLoopLock(__CFRunLoopObserver*, unsigned long, void*) + 44
7  CoreFoundation                 0x1c558fd08 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
8  CoreFoundation                 0x1c558aa30 __CFRunLoopDoObservers + 412
9  CoreFoundation                 0x1c558b190 __CFRunLoopRun + 1712
10 CoreFoundation                 0x1c558a7c0 CFRunLoopRunSpecific + 436
11 WebCore                        0x1ce27dfc4 RunWebThread(void*) + 600
12 libsystem_pthread.dylib        0x1c521d2c0 _pthread_body + 128
13 libsystem_pthread.dylib        0x1c521d220 _pthread_start + 44
14 libsystem_pthread.dylib        0x1c5220cdc thread_start + 4

#11. MainRunloopMonitor
0  libsystem_kernel.dylib         0x1c5190148 semaphore_timedwait_trap + 8
1  libdispatch.dylib              0x1c4fdf888 _dispatch_sema4_timedwait$VARIANT$mp + 64
2  libdispatch.dylib              0x1c4fe01dc _dispatch_semaphore_wait_slow + 72
3  MyAppName                     0x106be50cc -[BLYMainRunloopMonitorManager monitorThreadRun] + 45524
4  Foundation                     0x1c6085674 __NSThread__start__ + 984
5  libsystem_pthread.dylib        0x1c521d2c0 _pthread_body + 128
6  libsystem_pthread.dylib        0x1c521d220 _pthread_start + 44
7  libsystem_pthread.dylib        0x1c5220cdc thread_start + 4

#12. com.twitter.crashlytics.ios.MachExceptionServer
0  MyAppName                     0x106c35d98 CLSProcessRecordAllThreads + 376480
1  MyAppName                     0x106c36180 CLSProcessRecordAllThreads + 377480
2  MyAppName                     0x106c259f8 CLSHandler + 310016
3  MyAppName                     0x106c20dd8 CLSMachExceptionServer + 290528
4  libsystem_pthread.dylib        0x1c521d2c0 _pthread_body + 128
5  libsystem_pthread.dylib        0x1c521d220 _pthread_start + 44
6  libsystem_pthread.dylib        0x1c5220cdc thread_start + 4

#13. Thread
0  libsystem_pthread.dylib        0x1c5220cd0 start_wqthread + 190

#14. NSOperationQueue 0x282e3e780 (QOS: UNSPECIFIED)
0  libsystem_kernel.dylib         0x1c51900f4 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x1c518f5a0 mach_msg + 72
2  CoreFoundation                 0x1c5590120 __CFRunLoopServiceMachPort + 236
3  CoreFoundation                 0x1c558b030 __CFRunLoopRun + 1360
4  CoreFoundation                 0x1c558a7c0 CFRunLoopRunSpecific + 436
5  Foundation                     0x1c5f58eac -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 300
6  MyAppName                     0x1065814a0 -[AMapMacFinderPingOperation start] + 488548
7  Foundation                     0x1c6065c4c __NSOQSchedule_f + 272
8  libdispatch.dylib              0x1c503ca38 _dispatch_call_block_and_release + 24
9  libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
10 libdispatch.dylib              0x1c4fe201c _dispatch_continuation_pop$VARIANT$mp + 412
11 libdispatch.dylib              0x1c4fe16e0 _dispatch_async_redirect_invoke + 600
12 libdispatch.dylib              0x1c4fee030 _dispatch_root_queue_drain + 372
13 libdispatch.dylib              0x1c4fee8d4 _dispatch_worker_thread2 + 128
14 libsystem_pthread.dylib        0x1c521e1b4 _pthread_wqthread + 464
15 libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4

#15. com.analysys.serialQueue
0  libsystem_kernel.dylib         0x1c519b9d4 __ulock_wait + 8
1  libdispatch.dylib              0x1c4fdfa5c _dispatch_ulock_wait + 56
2  libdispatch.dylib              0x1c4fdfb94 _dispatch_thread_event_wait_slow$VARIANT$mp + 48
3  libdispatch.dylib              0x1c4febec0 __DISPATCH_WAIT_FOR_QUEUE__ + 328
4  libdispatch.dylib              0x1c4febad8 _dispatch_sync_f_slow + 140
5  MyAppName                     0x107375844 +[NSThread(ANSHelper) AnsRunOnMainThread:] + 1285324
6  MyAppName                     0x107385564 +[ANSFileManager saveUserDefaultWithKey:value:] + 1350124
7  MyAppName                     0x107371280 -[AnalysysSDK isAppKeyChanged:] + 1267464
8  MyAppName                     0x10736d1a8 __31-[AnalysysSDK startWithConfig:]_block_invoke_2 + 1250864
9  libdispatch.dylib              0x1c503ca38 _dispatch_call_block_and_release + 24
10 libdispatch.dylib              0x1c503d7d4 _dispatch_client_callout + 16
11 libdispatch.dylib              0x1c4fe6324 _dispatch_lane_serial_drain$VARIANT$mp + 592
12 libdispatch.dylib              0x1c4fe6e40 _dispatch_lane_invoke$VARIANT$mp + 428
13 libdispatch.dylib              0x1c4fef4ac _dispatch_workloop_worker_thread + 596
14 libsystem_pthread.dylib        0x1c521e114 _pthread_wqthread + 304
15 libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4

#16. Thread
0  libsystem_kernel.dylib         0x1c519bb74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1c521e138 _pthread_wqthread + 340
2  libsystem_pthread.dylib        0x1c5220cd4 start_wqthread + 4

#17. com.apple.CFSocket.private
0  libsystem_kernel.dylib         0x1c519b328 __select + 8
1  CoreFoundation                 0x1c5598e04 __CFSocketManager + 620
2  libsystem_pthread.dylib        0x1c521d2c0 _pthread_body + 128
3  libsystem_pthread.dylib        0x1c521d220 _pthread_start + 44
4  libsystem_pthread.dylib        0x1c5220cdc thread_start + 4
robertmryan commented 5 years ago

What is the exception code? Sounds like a 0x8badf00d caused by some deadlock...

robertmryan commented 5 years ago

You misunderstand me. When I say “exception code”, I’m not talking about your source code, but rather the hexadecimal numeric code generated when the app crashed. It’s usually somewhere near the top of the crash report. See Understanding and Analyzing Application Crash Reports: Exception Information.

Daemonson commented 5 years ago

@robertmryan Thanks for your help. Here is my exception code:

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000001c520b04c
Triggered by Thread:  0
robertmryan commented 5 years ago

Ok. That’s not a deadlock. (I.e., it’s not one of those pre-defined codes outlined in that document, such as 0x8badf00d).

The EXC_BREAKPOINT is generally a sign that it’s trying to tell the debugger where the issue was. Not surprisingly, this is what happens if you’re using the debugger and there was some breakpoint. But in a release build running alone on a device, it’s generally the sign that some exception was thrown (and in the absence of a debugger, you get this crash log).

So what I do in these cases, is I backtrack in the stack trace of the crashed thread and look for the name of one of my methods. In your case, it looks like it’s in -[SQDCDBManager queryTotalCount:] (I’m assuming that’s some code that you or someone in your team wrote.) Take a look at that method (assuming I identified the right one) and see if there’s some edge case that could cause some catastrophic scenario.

Is that routine doing an executeUpdate? Can you share that with us?

Daemonson commented 5 years ago

@robertmryan I am very grateful for your analysis and help. Here are the codes of the function queryTotalCount. We use this function to get the data count from the DB. We have analyzed this function several times and no crash was caused by this function before.

- (void)queryTotalCount:(void(^)(NSUInteger count))block {
    __block int totalCount = 0;
    [self.fmDbQueue inTransaction:^(FMDatabase * _Nonnull db, BOOL * _Nonnull rollback) {
        NSString* sql = [NSString stringWithFormat:@"SELECT COUNT(*) FROM %@", @"BigData"];
        FMResultSet *s = [db executeQuery:sql];
        if ([s next]) {
            totalCount = [s intForColumnIndex:0];
        }
        dispatch_async(dispatch_get_main_queue(), ^{
            SQSafeBlock(block,totalCount);
        });
        if ([db hasOpenResultSets]) {
            [s close];
        }
    }];
}
ccgus commented 5 years ago

I don't see anything jumping out at me- but one thing I'd do is close the result set right after the totalCount = [s intForColumnIndex:0];. There's no need to check hasOpenResultSets, and if you're in a multithreaded environment then that might even cause problems.

Daemonson commented 5 years ago

I don't see anything jumping out at me- but one thing I'd do is close the result set right after the totalCount = [s intForColumnIndex:0];. There's no need to check hasOpenResultSets, and if you're in a multithreaded environment then that might even cause problems.

Thanks, I understand the problems you point out. I will correct my code and do some test. But what puzzles me is that once the user encounters this crash, they can no longer launch the app, and they will crash every time. Is it possible that the database was destroyed?

robertmryan commented 5 years ago

@Daemonson - Nothing is jumping out at me, either. I’m not sure why you’re using inTransaction, though, as you’re not doing any updates. I’d just use inDatabase. I can’t imagine that it would cause a problem, but seems unnecessary/inefficient. Admittedly, I’ve never tried doing a transaction and committing it when there weren’t any updates...

robertmryan commented 5 years ago

@ccgus - I’m a bit surprised to see executeUpdate in his stack trace, though. Do you know why that’s there? On the basis of the provided code snippet for queryTotalCount, I would have expected to see executeQuery, if anything...

ccgus commented 5 years ago

beginTransaction calls executeUpdate to run the begin exclusive transaction query. So the SELECT COUNT(*) is probably never even called.

I wonder if this is a case of the disk being locked or something along those lines?

Maybe try inDatabase?

robertmryan commented 5 years ago

... But what puzzles me is that once the user encounters this crash, they can no longer launch the app, and they will crash every time. Is it possible that the database was destroyed?

I wonder if it’s getting corrupted somehow. Do you have any lengthy updates that might leave the database in an inconsistent state if interrupted? Perhaps wrap those in a beginBackgroundTaskWithName:expirationHandler:?

(As an aside, @ccgus, should the inDatabase and inTransaction methods do that beginBackgroundTaskWithName themselves on iOS, to help minimize corruption?)

Daemonson commented 5 years ago

beginTransaction calls executeUpdate to run the begin exclusive transaction query. So the SELECT COUNT(*) is probably never even called.

I wonder if this is a case of the disk being locked or something along those lines?

Maybe try inDatabase?

Thanks,I will try it.

ccgus commented 5 years ago

@robertmryan I'm not sure what you're referring to with beginBackgroundTaskWithName? Do you mean those methods should call it automatically?

robertmryan commented 5 years ago

Yeah, I’m wondering whether inTransaction (and executeUpdate) should automatically call beginBackgroundTaskWithName when starting update, and call endBackgroundTask when done, as outlined in Extending Your App's Background Execution Time. It seems like a very simple way of mitigating potential database corruption.

Daemonson commented 5 years ago

@robertmryan The way that you said of mitigating potential database corruption is useful. In some cases, the process of performing the executeUpdate operation may be interrupted and may cause database corruption. But I want to know why the database is corrupted causing the user to crash at the code of the executeUpdate each time the app is launching. Should I use this function - (BOOL)executeUpdate:(NSString*)sql values:(NSArray *)values error:(NSError * __autoreleasing *)error to execute update and do something when capture an error? I wonder know what kind of error can cause database corruption and how to fix this kind of error. Delete the corrupted database or do something else?

The code of my executeUpdate:

- (void)saveReportData:(NSString *)data {
    [self.fmDbQueue inTransaction:^(FMDatabase * _Nonnull db, BOOL * _Nonnull rollback) {
        NSString *sql = [NSString stringWithFormat:@"insert into BigData (eventJson) values ('%@')", data];
        NSError * error;
        BOOL validate = [db validateSQL:sql error:&error];

        if ([db isOpen] && validate) {
            [db executeUpdate:sql];
        }
    }];
}

Exception Code:

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000001994af04c
Triggered by Thread:  0

Stack trace:

# Date: 2019-09-05T08:32:00Z
# OS Version: 12.4.0 (16G77)
# Device: iPhone 7 Plus
# RAM Free: 5.8%
# Disk Free: 23.9%

#0. Crashed: fmdb.<FMDatabaseQueue: 0x283dc9830>
0  libsystem_platform.dylib       0x20927f04c _os_unfair_lock_unowned_abort + 36
1  libsystem_platform.dylib       0x2092804f4 _os_unfair_lock_unlock_slow + 144
2  libsqlite3.dylib               0x209a6ef18 sqlite3_snprintf + 3188
3  libsqlite3.dylib               0x209a6eb18 sqlite3_snprintf + 2164
4  libsqlite3.dylib               0x209ad1c0c sqlite3_free_table + 49564
5  libsqlite3.dylib               0x209ad547c sqlite3_free_table + 64012
6  libsqlite3.dylib               0x209ad4c30 sqlite3_free_table + 61888
7  libsqlite3.dylib               0x209aafd00 sqlite3_step + 29564
8  libsqlite3.dylib               0x209aa8b40 sqlite3_step + 444
9  MyAppName                     0x1066a0ff4 -[FMDatabase executeUpdate:error:withArgumentsInArray:orDictionary:orVAList:] + 1131 (FMDatabase.m:1131)
10 MyAppName                     0x1066a13e0 -[FMDatabase executeUpdate:] + 1222 (FMDatabase.m:1222)
11 MyAppName                     0x105415f0c __32-[SQDCDBManager saveReportData:]_block_invoke + 63 (SQDCDBManager.m:63)
12 MyAppName                     0x1066a4048 __46-[FMDatabaseQueue beginTransaction:withBlock:]_block_invoke + 230 (FMDatabaseQueue.m:230)
13 libdispatch.dylib              0x2090b17d4 _dispatch_client_callout + 16
14 libdispatch.dylib              0x20905fc1c _dispatch_lane_barrier_sync_invoke_and_complete + 56
15 MyAppName                     0x1066a3f20 -[FMDatabaseQueue beginTransaction:withBlock:] + 241 (FMDatabaseQueue.m:241)
16 MyAppName                     0x105415e6c -[SQDCDBManager saveReportData:] + 61 (SQDCDBManager.m:61)
17 MyAppName                     0x105af9dcc __25+[SQDataCenter saveLogs:]_block_invoke + 146 (SQDataCenter.m:146)
18 libdispatch.dylib              0x2090b0a38 _dispatch_call_block_and_release + 24
19 libdispatch.dylib              0x2090b17d4 _dispatch_client_callout + 16
20 libdispatch.dylib              0x20905f008 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1068
21 CoreFoundation                 0x20960432c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
22 CoreFoundation                 0x2095ff264 __CFRunLoopRun + 1924
23 CoreFoundation                 0x2095fe7c0 CFRunLoopRunSpecific + 436
24 GraphicsServices               0x20b7ff79c GSEventRunModal + 104
25 UIKitCore                      0x2360fdc38 UIApplicationMain + 212
26 MyAppName                     0x106366580 main + 18 (main.m:18)
27 libdyld.dylib                  0x2090c28e0 start + 4

--

#0. Crashed: fmdb.<FMDatabaseQueue: 0x283dc9830>
0  libsystem_platform.dylib       0x20927f04c _os_unfair_lock_unowned_abort + 36
1  libsystem_platform.dylib       0x2092804f4 _os_unfair_lock_unlock_slow + 144
2  libsqlite3.dylib               0x209a6ef18 sqlite3_snprintf + 3188
3  libsqlite3.dylib               0x209a6eb18 sqlite3_snprintf + 2164
4  libsqlite3.dylib               0x209ad1c0c sqlite3_free_table + 49564
5  libsqlite3.dylib               0x209ad547c sqlite3_free_table + 64012
6  libsqlite3.dylib               0x209ad4c30 sqlite3_free_table + 61888
7  libsqlite3.dylib               0x209aafd00 sqlite3_step + 29564
8  libsqlite3.dylib               0x209aa8b40 sqlite3_step + 444
9  MyAppName                     0x1066a0ff4 -[FMDatabase executeUpdate:error:withArgumentsInArray:orDictionary:orVAList:] + 1131 (FMDatabase.m:1131)
10 MyAppName                     0x1066a13e0 -[FMDatabase executeUpdate:] + 1222 (FMDatabase.m:1222)
11 MyAppName                     0x105415f0c __32-[SQDCDBManager saveReportData:]_block_invoke + 63 (SQDCDBManager.m:63)
12 MyAppName                     0x1066a4048 __46-[FMDatabaseQueue beginTransaction:withBlock:]_block_invoke + 230 (FMDatabaseQueue.m:230)
13 libdispatch.dylib              0x2090b17d4 _dispatch_client_callout + 16
14 libdispatch.dylib              0x20905fc1c _dispatch_lane_barrier_sync_invoke_and_complete + 56
15 MyAppName                     0x1066a3f20 -[FMDatabaseQueue beginTransaction:withBlock:] + 241 (FMDatabaseQueue.m:241)
16 MyAppName                     0x105415e6c -[SQDCDBManager saveReportData:] + 61 (SQDCDBManager.m:61)
17 MyAppName                     0x105af9dcc __25+[SQDataCenter saveLogs:]_block_invoke + 146 (SQDataCenter.m:146)
18 libdispatch.dylib              0x2090b0a38 _dispatch_call_block_and_release + 24
19 libdispatch.dylib              0x2090b17d4 _dispatch_client_callout + 16
20 libdispatch.dylib              0x20905f008 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1068
21 CoreFoundation                 0x20960432c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
22 CoreFoundation                 0x2095ff264 __CFRunLoopRun + 1924
23 CoreFoundation                 0x2095fe7c0 CFRunLoopRunSpecific + 436
24 GraphicsServices               0x20b7ff79c GSEventRunModal + 104
25 UIKitCore                      0x2360fdc38 UIApplicationMain + 212
26 MyAppName                     0x106366580 main + 18 (main.m:18)
27 libdyld.dylib                  0x2090c28e0 start + 4

#1. com.apple.root.default-qos
0  libsystem_kernel.dylib         0x2092108f4 kevent + 8
1  libsystem_info.dylib           0x2091c1190 _mdns_search_ex + 1972
2  libsystem_info.dylib           0x2091c08f0 _mdns_search + 128
3  libsystem_info.dylib           0x2091bfe94 mdns_addrinfo + 896
4  libsystem_info.dylib           0x2091c5be0 search_addrinfo + 264
5  libsystem_info.dylib           0x2091c9be8 si_addrinfo + 1652
6  libsystem_info.dylib           0x2091bd598 _getaddrinfo_internal + 196
7  libsystem_info.dylib           0x2091bd4c8 getaddrinfo + 52
8  MyAppName                     0x1068a8e28 +[WXOMTAGCDAsyncSocket lookupHost:port:error:] + 4333227560
9  MyAppName                     0x10689d220 __76-[WXOMTAGCDAsyncSocket connectToHost:onPort:viaInterface:withTimeout:error:]_block_invoke_2 + 4333179424
10 libdispatch.dylib              0x2090b0a38 _dispatch_call_block_and_release + 24
11 libdispatch.dylib              0x2090b17d4 _dispatch_client_callout + 16
12 libdispatch.dylib              0x209055c80 _dispatch_queue_override_invoke + 684
13 libdispatch.dylib              0x209062030 _dispatch_root_queue_drain + 372
14 libdispatch.dylib              0x2090628d4 _dispatch_worker_thread2 + 128
15 libsystem_pthread.dylib        0x2092921b4 _pthread_wqthread + 464
16 libsystem_pthread.dylib        0x209294cd4 start_wqthread + 4

#2. com.apple.Pasteboard.notification-queue
0  libsystem_kernel.dylib         0x20920eee4 __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x209289cf8 _pthread_cond_wait$VARIANT$mp + 636
2  Foundation                     0x20a03a908 -[__NSOperationInternal _waitUntilFinished:] + 772
3  Foundation                     0x209ff53f4 -[__NSObserver _doit:] + 240
4  CoreFoundation                 0x2095e3a28 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
5  CoreFoundation                 0x2095e39f4 ___CFXRegistrationPost_block_invoke + 64
6  CoreFoundation                 0x2095e2ee8 _CFXRegistrationPost + 392
7  CoreFoundation                 0x2095e2b94 ___CFXNotificationPost_block_invoke + 96
8  CoreFoundation                 0x20955c474 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1496
9  CoreFoundation                 0x2095e2644 _CFXNotificationPost + 696
10 Foundation                     0x209fcb6f4 -[NSNotificationCenter postNotificationName:object:userInfo:] + 68
11 Pasteboard                     0x21e18dc4c __67+[PBServerConnection beginListeningToPasteboardChangeNotifications]_block_invoke_2
12 libsystem_notify.dylib         0x2092772f4 notify_register_mach_port + 7436
13 libdispatch.dylib              0x20905f7f4 _dispatch_block_async_invoke2 + 104
14 libdispatch.dylib              0x2090b17d4 _dispatch_client_callout + 16
15 libdispatch.dylib              0x20905a324 _dispatch_lane_serial_drain$VARIANT$mp + 592
16 libdispatch.dylib              0x20905ae40 _dispatch_lane_invoke$VARIANT$mp + 428
17 libdispatch.dylib              0x2090634ac _dispatch_workloop_worker_thread + 596
18 libsystem_pthread.dylib        0x209292114 _pthread_wqthread + 304
19 libsystem_pthread.dylib        0x209294cd4 start_wqthread + 4

#3. Thread
0  libsystem_pthread.dylib        0x209294cd0 start_wqthread + 190

#4. com.apple.uikit.eventfetch-thread
0  libsystem_kernel.dylib         0x2092040f4 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x2092035a0 mach_msg + 72
2  CoreFoundation                 0x209604120 __CFRunLoopServiceMachPort + 236
3  CoreFoundation                 0x2095ff030 __CFRunLoopRun + 1360
4  CoreFoundation                 0x2095fe7c0 CFRunLoopRunSpecific + 436
5  Foundation                     0x209fcceac -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 300
6  Foundation                     0x209fccd3c -[NSRunLoop(NSRunLoop) runUntilDate:] + 96
7  UIKitCore                      0x2361e3754 -[UIEventFetcher threadMain] + 136
8  Foundation                     0x20a0f9674 __NSThread__start__ + 984
9  libsystem_pthread.dylib        0x2092912c0 _pthread_body + 128
10 libsystem_pthread.dylib        0x209291220 _pthread_start + 44
11 libsystem_pthread.dylib        0x209294cdc thread_start + 4

#5. Thread
0  libsystem_pthread.dylib        0x209294cd0 start_wqthread + 190

#6. Thread
0  libsystem_kernel.dylib         0x20920fb74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x2092921f8 _pthread_wqthread + 532
2  libsystem_pthread.dylib        0x209294cd4 start_wqthread + 4

#7. com.apple.NSURLConnectionLoader
0  libsystem_kernel.dylib         0x2092040f4 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x2092035a0 mach_msg + 72
2  CoreFoundation                 0x209604120 __CFRunLoopServiceMachPort + 236
3  CoreFoundation                 0x2095ff030 __CFRunLoopRun + 1360
4  CoreFoundation                 0x2095fe7c0 CFRunLoopRunSpecific + 436
5  CFNetwork                      0x209c1874c -[__CoreSchedulingSetRunnable runForever] + 216
6  Foundation                     0x20a0f9674 __NSThread__start__ + 984
7  libsystem_pthread.dylib        0x2092912c0 _pthread_body + 128
8  libsystem_pthread.dylib        0x209291220 _pthread_start + 44
9  libsystem_pthread.dylib        0x209294cdc thread_start + 4

#8. JavaScriptCore bmalloc scavenger
0  libsystem_kernel.dylib         0x20920eee4 __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x209289cf8 _pthread_cond_wait$VARIANT$mp + 636
2  libc++.1.dylib                 0x2087e5090 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 24
3  JavaScriptCore                 0x210892de0 void std::__1::condition_variable_any::wait<std::__1::unique_lock<bmalloc::Mutex> >(std::__1::unique_lock<bmalloc::Mutex>&) + 108
4  JavaScriptCore                 0x210896dd4 bmalloc::Scavenger::threadRunLoop() + 176
5  JavaScriptCore                 0x21089654c bmalloc::Scavenger::Scavenger(std::__1::lock_guard<bmalloc::Mutex>&) + 10
6  JavaScriptCore                 0x210897f8c std::__1::__thread_specific_ptr<std::__1::__thread_struct>::set_pointer(std::__1::__thread_struct*) + 38
7  libsystem_pthread.dylib        0x2092912c0 _pthread_body + 128
8  libsystem_pthread.dylib        0x209291220 _pthread_start + 44
9  libsystem_pthread.dylib        0x209294cdc thread_start + 4

#9. WebThread
0  libsystem_kernel.dylib         0x20920eee4 __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x209289cf8 _pthread_cond_wait$VARIANT$mp + 636
2  JavaScriptCore                 0x21085988c WTF::ThreadCondition::timedWait(WTF::Mutex&, WTF::WallTime) + 80
3  JavaScriptCore                 0x210840514 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 2004
4  JavaScriptCore                 0x2108307b4 WTF::LockAlgorithm<unsigned char, (unsigned char)1, (unsigned char)2, WTF::EmptyLockHooks<unsigned char> >::lockSlow(WTF::Atomic<unsigned char>&) + 232
5  WebCore                        0x2122ef66c _WebThreadLock() + 264
6  WebCore                        0x2122f21f0 WebRunLoopLock(__CFRunLoopObserver*, unsigned long, void*) + 44
7  CoreFoundation                 0x209603d08 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
8  CoreFoundation                 0x2095fea30 __CFRunLoopDoObservers + 412
9  CoreFoundation                 0x2095ff190 __CFRunLoopRun + 1712
10 CoreFoundation                 0x2095fe7c0 CFRunLoopRunSpecific + 436
11 WebCore                        0x2122f1fc4 RunWebThread(void*) + 600
12 libsystem_pthread.dylib        0x2092912c0 _pthread_body + 128
13 libsystem_pthread.dylib        0x209291220 _pthread_start + 44
14 libsystem_pthread.dylib        0x209294cdc thread_start + 4

#10. MainRunloopMonitor
0  libsystem_kernel.dylib         0x209204148 semaphore_timedwait_trap + 8
1  libdispatch.dylib              0x209053888 _dispatch_sema4_timedwait$VARIANT$mp + 64
2  libdispatch.dylib              0x2090541dc _dispatch_semaphore_wait_slow + 72
3  MyAppName                     0x1070550cc -[BLYMainRunloopMonitorManager monitorThreadRun] + 45524
4  Foundation                     0x20a0f9674 __NSThread__start__ + 984
5  libsystem_pthread.dylib        0x2092912c0 _pthread_body + 128
6  libsystem_pthread.dylib        0x209291220 _pthread_start + 44
7  libsystem_pthread.dylib        0x209294cdc thread_start + 4

#11. com.twitter.crashlytics.ios.MachExceptionServer
0  MyAppName                     0x1070a5d98 CLSProcessRecordAllThreads + 376480
1  MyAppName                     0x1070a6180 CLSProcessRecordAllThreads + 377480
2  MyAppName                     0x1070959f8 CLSHandler + 310016
3  MyAppName                     0x107090dd8 CLSMachExceptionServer + 290528
4  libsystem_pthread.dylib        0x2092912c0 _pthread_body + 128
5  libsystem_pthread.dylib        0x209291220 _pthread_start + 44
6  libsystem_pthread.dylib        0x209294cdc thread_start + 4

#12. NSOperationQueue 0x2833e9540 (QOS: UNSPECIFIED)
0  libsystem_kernel.dylib         0x2092040f4 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x2092035a0 mach_msg + 72
2  CoreFoundation                 0x209604120 __CFRunLoopServiceMachPort + 236
3  CoreFoundation                 0x2095ff030 __CFRunLoopRun + 1360
4  CoreFoundation                 0x2095fe7c0 CFRunLoopRunSpecific + 436
5  Foundation                     0x209fcceac -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 300
6  MyAppName                     0x1069f14a0 -[AMapMacFinderPingOperation start] + 488548
7  Foundation                     0x20a0d9c4c __NSOQSchedule_f + 272
8  libdispatch.dylib              0x2090b0a38 _dispatch_call_block_and_release + 24
9  libdispatch.dylib              0x2090b17d4 _dispatch_client_callout + 16
10 libdispatch.dylib              0x20905601c _dispatch_continuation_pop$VARIANT$mp + 412
11 libdispatch.dylib              0x2090556e0 _dispatch_async_redirect_invoke + 600
12 libdispatch.dylib              0x209062030 _dispatch_root_queue_drain + 372
13 libdispatch.dylib              0x2090628d4 _dispatch_worker_thread2 + 128
14 libsystem_pthread.dylib        0x2092921b4 _pthread_wqthread + 464
15 libsystem_pthread.dylib        0x209294cd4 start_wqthread + 4

#13. io.answers.EventQueue (QOS: BACKGROUND)
0  libsystem_kernel.dylib         0x209210a38 listxattr + 8
1  Foundation                     0x20a09f894 _attributesAtPath + 60
2  Foundation                     0x20a007158 +[NSFileAttributes _attributesAtPath:partialReturn:filterResourceFork:error:] + 336
3  MyAppName                     0x1070b3914 +[ANSFileUtils fileSizeAtURL:] + 432668
4  MyAppName                     0x1070bf8f8 -[ANSUploadOperation main] + 481792
5  Foundation                     0x209fe37c8 -[__NSOperationInternal _start:] + 740
6  Foundation                     0x20a0d9c4c __NSOQSchedule_f + 272
7  libdispatch.dylib              0x2090b0a38 _dispatch_call_block_and_release + 24
8  libdispatch.dylib              0x2090b17d4 _dispatch_client_callout + 16
9  libdispatch.dylib              0x20905601c _dispatch_continuation_pop$VARIANT$mp + 412
10 libdispatch.dylib              0x2090556e0 _dispatch_async_redirect_invoke + 600
11 libdispatch.dylib              0x209062030 _dispatch_root_queue_drain + 372
12 libdispatch.dylib              0x2090628d4 _dispatch_worker_thread2 + 128
13 libsystem_pthread.dylib        0x2092921b4 _pthread_wqthread + 464
14 libsystem_pthread.dylib        0x209294cd4 start_wqthread + 4

#14. com.apple.CoreLocation.0x155d44060
0  libsystem_kernel.dylib         0x209204148 semaphore_timedwait_trap + 8
1  libdispatch.dylib              0x209053888 _dispatch_sema4_timedwait$VARIANT$mp + 64
2  libdispatch.dylib              0x2090541dc _dispatch_semaphore_wait_slow + 72
3  CoreLocation                   0x2104166cc CLClientInvalidate + 896
4  CoreLocation                   0x21041b7d4 CLClientStopVehicleHeadingUpdates + 1668
5  CoreLocation                   0x210474e4c CLGetControlPlaneStatusReport + 40940
6  CoreLocation                   0x210474d78 CLGetControlPlaneStatusReport + 40728
7  CoreLocation                   0x21046fca4 CLGetControlPlaneStatusReport + 20036
8  CoreLocation                   0x21046fb5c CLGetControlPlaneStatusReport + 19708
9  CoreLocation                   0x210471e98 CLGetControlPlaneStatusReport + 28728
10 libxpc.dylib                   0x2092c9afc _xpc_connection_call_event_handler + 68
11 libxpc.dylib                   0x2092c9e60 _xpc_connection_mach_event + 856
12 libdispatch.dylib              0x2090b1894 _dispatch_client_callout4 + 16
13 libdispatch.dylib              0x2090695c0 _dispatch_mach_msg_invoke$VARIANT$mp + 340
14 libdispatch.dylib              0x20905a1f0 _dispatch_lane_serial_drain$VARIANT$mp + 284
15 libdispatch.dylib              0x20906a1cc _dispatch_mach_invoke$VARIANT$mp + 476
16 libdispatch.dylib              0x20905a1f0 _dispatch_lane_serial_drain$VARIANT$mp + 284
17 libdispatch.dylib              0x20905ae40 _dispatch_lane_invoke$VARIANT$mp + 428
18 libdispatch.dylib              0x2090634ac _dispatch_workloop_worker_thread + 596
19 libsystem_pthread.dylib        0x209292114 _pthread_wqthread + 304
20 libsystem_pthread.dylib        0x209294cd4 start_wqthread + 4

#15. Thread
0  libsystem_pthread.dylib        0x209294cd0 start_wqthread + 190

#16. Thread
0  libsystem_kernel.dylib         0x20920fb74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x2092921f8 _pthread_wqthread + 532
2  libsystem_pthread.dylib        0x209294cd4 start_wqthread + 4

#17. com.apple.CFSocket.private
0  libsystem_kernel.dylib         0x20920f328 __select + 8
1  CoreFoundation                 0x20960ce04 __CFSocketManager + 620
2  libsystem_pthread.dylib        0x2092912c0 _pthread_body + 128
3  libsystem_pthread.dylib        0x209291220 _pthread_start + 44
4  libsystem_pthread.dylib        0x209294cdc thread_start + 4

#18. com.analysys.serialQueue
0  libsystem_kernel.dylib         0x20920f9d4 __ulock_wait + 8
1  libdispatch.dylib              0x209053a5c _dispatch_ulock_wait + 56
2  libdispatch.dylib              0x209053b94 _dispatch_thread_event_wait_slow$VARIANT$mp + 48
3  libdispatch.dylib              0x20905fec0 __DISPATCH_WAIT_FOR_QUEUE__ + 328
4  libdispatch.dylib              0x20905fad8 _dispatch_sync_f_slow + 140
5  MyAppName                     0x1077e5844 +[NSThread(ANSHelper) AnsRunOnMainThread:] + 1285324
6  MyAppName                     0x1077f5564 +[ANSFileManager saveUserDefaultWithKey:value:] + 1350124
7  MyAppName                     0x1077e1280 -[AnalysysSDK isAppKeyChanged:] + 1267464
8  MyAppName                     0x1077dd1a8 __31-[AnalysysSDK startWithConfig:]_block_invoke_2 + 1250864
9  libdispatch.dylib              0x2090b0a38 _dispatch_call_block_and_release + 24
10 libdispatch.dylib              0x2090b17d4 _dispatch_client_callout + 16
11 libdispatch.dylib              0x20905a324 _dispatch_lane_serial_drain$VARIANT$mp + 592
12 libdispatch.dylib              0x20905ae40 _dispatch_lane_invoke$VARIANT$mp + 428
13 libdispatch.dylib              0x2090634ac _dispatch_workloop_worker_thread + 596
14 libsystem_pthread.dylib        0x209292114 _pthread_wqthread + 304
15 libsystem_pthread.dylib        0x209294cd4 start_wqthread + 4
ccgus commented 5 years ago

@Daemonson It'd be interesting to take a look at one of the corrupted databases if you can get ahold of it.

@robertmryan I'm on board with adding beginBackgroundTaskWithName.

How should we come up with the name, and what to use for expirationHandler? Should name just be a description of the database, or a UUID? Should it be configurable as a property on a database pool? Just thinking out loud.

GeekLee609 commented 5 years ago

I have the similar crash, can you tell me how to resolve it,The error like this

Crashed: io.growing 0 libsystem_platform.dylib 0x1b49c704c _os_unfair_lock_unowned_abort + 36 1 libsystem_platform.dylib 0x1b49c84f4 _os_unfair_lock_unlock_slow + 144 2 libsqlite3.dylib 0x1b51b6f18 sqlite3_snprintf + 3188 3 libsqlite3.dylib 0x1b51b6b18 sqlite3_snprintf + 2164 4 libsqlite3.dylib 0x1b51b4f88 sqlite3_vfs_find + 5548 5 libsqlite3.dylib 0x1b51b1844 sqlite3_open_v2 + 2656 6 SugarChat 0x1022a4408 -[FMG3Database open] + 138 (FMG3Database.m:138) 7 SugarChat 0x102298d44 -[GrowingEventDataBase performDataBaseBlock:] + 421 (GrowingEventDataBase.m:421) 8 SugarChat 0x1022998e4 -[GrowingEventDataBase flush] + 596 (GrowingEventDataBase.m:596) 9 SugarChat 0x102297b24 -[GrowingEventDataBase setValue:forKey:error:] + 276 (GrowingEventDataBase.m:276) 10 SugarChat 0x1022c4300 -[GrowingEventManager writeToDBWithEvent:] + 628 (GrowingEventManager.m:628) 11 SugarChat 0x1022c3dc4 __35-[GrowingEventManager handleEvent:]_block_invoke.351 + 576 (GrowingEventManager.m:576) 12 libdispatch.dylib 0x1b47f8a38 _dispatch_call_block_and_release + 24 13 libdispatch.dylib 0x1b47f97d4 _dispatch_client_callout + 16 14 libdispatch.dylib 0x1b47a2324 _dispatch_lane_serial_drain$VARIANT$mp + 592 15 libdispatch.dylib 0x1b47a2e40 _dispatch_lane_invoke$VARIANT$mp + 428 16 libdispatch.dylib 0x1b47ab4ac _dispatch_workloop_worker_thread + 596 17 libsystem_pthread.dylib 0x1b49da114 _pthread_wqthread + 304 18 libsystem_pthread.dylib 0x1b49dccd4 start_wqthread + 4

@Daemonson @ccgus @robertmryan