Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash: Unlock of an os_unfair_lock not owned by current thread in iOS12 #711

Open
dongfanggugu opened this issue Oct 16, 2018 · 19 comments
Open

Comments

@dongfanggugu
Copy link

dongfanggugu commented Oct 16, 2018

the iOS version is 12.0.0
the FMDatabaseQueue is the single instance in my app
i call as

dispatch_async(concurrencyQueue, ^{
     FMDatabaseQueue *queue = [[SMDataBaseManager sharedInstance] getDBQueue];
     [queue inTransaction:^(FMDatabase *db, BOOL *rollback) {
            //do something
     }];
});

sometimes, the app crashed, report "Unlock of an os_unfair_lock not owned by current thread"
call stack:

libsystem_platform.dylib | _os_unfair_lock_unowned_abort + 36
-- | --
1 | libsystem_platform.dylib | _os_unfair_lock_unlock_slow + 144
2 | libsqlite3.dylib | sqlite3_snprintf + 3296
3 | libsqlite3.dylib | sqlite3_snprintf + 2592
4 | libsqlite3.dylib | sqlite3_free_table + 48616
5 | libsqlite3.dylib | sqlite3_bind_int64 + 1356
6 | libsqlite3.dylib | sqlite3_free_table + 60928
7 | libsqlite3.dylib | sqlite3_step + 28796
8 | libsqlite3.dylib | sqlite3_step + 432
9 | FMDB | FMDatabase.m line 1073-[FMDatabase executeUpdate:error:withArgumentsInArray:orDictionary:orVAList:]
10 | FMDB | FMDatabase.m line 1158-[FMDatabase executeUpdate:]

the FMDB version is '2.6.2'

@Tomsocket
Copy link

the iOS version is 12.0.0
the FMDatabaseQueue is the single instance in my app

[logging] BUG IN CLIENT OF sqlite3.dylib: illegal multi-threaded access to database connection

@ccgus
Copy link
Owner

ccgus commented Oct 23, 2018

@Tomsocket Show a backtrace of all your threads please.

@wnk77521
Copy link

image
@ccgus hi i have the same crash , thinks

@Mr-yuwei
Copy link

me too

@ccgus
Copy link
Owner

ccgus commented Oct 24, 2018

Show a back trace of all your threads. Copy and paste them in here (no screenshots please)

@dongfanggugu
Copy link
Author

dongfanggugu commented Oct 25, 2018

//the crash trace

# Platform: ios
# Application: 
# Version: 7.2.1 (801809301648)
# Bundle Identifier: com.starmakerapp.thevoice
# Issue #: 61212
# Issue ID: 5a218d6161b02d480dab3557
# Session ID: 75c6687833ae489281474d0563036a71_DNE_0_v2
# Date: 2018-10-24T04:49:00Z
# OS Version: 12.0.0 (16A366)
# Device: iPhone 6
# RAM Free: 23.1%
# Disk Free: 14.7%

#9. Crashed: fmdb.<FMDatabaseQueue: 0x282ce4fc0>
0  libsystem_platform.dylib       0x1b3c16f3c _os_unfair_lock_unowned_abort + 36
1  libsystem_platform.dylib       0x1b3c18524 _os_unfair_lock_unlock_slow + 144
2  libsqlite3.dylib               0x1b440f604 sqlite3_snprintf + 3296
3  libsqlite3.dylib               0x1b440f344 sqlite3_snprintf + 2592
4  libsqlite3.dylib               0x1b4472610 sqlite3_free_table + 48616
5  libsqlite3.dylib               0x1b447d25c sqlite3_bind_int64 + 1356
6  libsqlite3.dylib               0x1b4475628 sqlite3_free_table + 60928
7  libsqlite3.dylib               0x1b4450330 sqlite3_step + 28796
8  libsqlite3.dylib               0x1b4449464 sqlite3_step + 432
9  FMDB                           0x1041d5cc4 -[FMDatabase executeUpdate:error:withArgumentsInArray:orDictionary:orVAList:] (FMDatabase.m:1073)
10 FMDB                           0x1041d608c -[FMDatabase executeUpdate:] (FMDatabase.m:1158)
11 StarMakerLite                  0x100f028b4 __32-[SMTrackDataBase insertEvents:]_block_invoke (SMTrackDataBase.m:58)
12 FMDB                           0x1041d9544 __46-[FMDatabaseQueue beginTransaction:withBlock:]_block_invoke (FMDatabaseQueue.m:192)
13 libdispatch.dylib              0x1b3a48484 _dispatch_client_callout + 16
14 libdispatch.dylib              0x1b39f5610 _dispatch_lane_barrier_sync_invoke_and_complete + 56
15 FMDB                           0x1041d9484 -[FMDatabaseQueue beginTransaction:withBlock:] (FMDatabaseQueue.m:203)
16 StarMakerLite                  0x100f024d0 -[SMTrackDataBase insertEvents:] (SMTrackDataBase.m:50)
17 StarMakerLite                  0x101a93330 __68-[SMEventTrackingManager(Main) notifyInsertLogsWithEvent:updateNow:]_block_invoke (SMEventTrackingManager+Main.m:909)
18 libdispatch.dylib              0x1b3a476c8 _dispatch_call_block_and_release + 24
19 libdispatch.dylib              0x1b3a48484 _dispatch_client_callout + 16
20 libdispatch.dylib              0x1b39efc18 _dispatch_lane_serial_drain$VARIANT$mp + 592
21 libdispatch.dylib              0x1b39f0760 _dispatch_lane_invoke$VARIANT$mp + 432
22 libdispatch.dylib              0x1b39f8f00 _dispatch_workloop_worker_thread + 600
23 libsystem_pthread.dylib        0x1b3c2a0f0 _pthread_wqthread + 312
24 libsystem_pthread.dylib        0x1b3c2cd00 start_wqthread + 4

--

#0. com.apple.main-thread
0  libsqlite3.dylib               0x1b445671c sqlite3_step + 54376
1  libsqlite3.dylib               0x1b4449464 sqlite3_step + 432
2  libsqlite3.dylib               0x1b4411cf0 sqlite3_exec + 336
3  libsqlite3.dylib               0x1b4427c4c sqlite3_exec + 90284
4  libsqlite3.dylib               0x1b445ed80 sqlite3_value_text + 15356
5  libsqlite3.dylib               0x1b443b39c sqlite3_log + 38828
6  libsqlite3.dylib               0x1b443ac48 sqlite3_log + 36952
7  libsqlite3.dylib               0x1b44e2c08 sqlite3_rekey + 151820
8  libsqlite3.dylib               0x1b4433a40 sqlite3_log + 7760
9  libsqlite3.dylib               0x1b44154d0 sqlite3_exec + 14640
10 libsqlite3.dylib               0x1b4413704 sqlite3_exec + 7012
11 libsqlite3.dylib               0x1b44128ac sqlite3_exec + 3340
12 StarMakerLite                  0x10225f878 RongCloud::CBizDB::prepareSQL(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int&) + 4337154168
13 StarMakerLite                  0x1022608d8 RongCloud::CBizDB::IsTableExist(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 4337158360
14 StarMakerLite                  0x1022601d0 RongCloud::CBizDB::GetDatabaseVersion() + 4337156560
15 StarMakerLite                  0x10225fb18 RongCloud::CBizDB::InitDir(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) + 4337154840
16 StarMakerLite                  0x1022465a4 RongCloud::RCloudClient::SetUserId(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) + 4337051044
17 StarMakerLite                  0x1022462d8 RongCloud::RCloudClient::Connect(char const*, RongCloud::collectionEntry const*, unsigned int, char const*, RongCloud::ConnectAckListener*, bool, bool, bool, char const*) + 4337050328
18 StarMakerLite                  0x10225b768 ConnectTo + 4337137512
19 StarMakerLite                  0x1021b02f8 -[RCIMClient connect:] + 4336435960
20 StarMakerLite                  0x1021af460 -[RCIMClient connect:success:error:tokenIncorrect:] + 4336432224
21 StarMakerLite                  0x1021ae654 __60-[RCIMClient connectWithToken:success:error:tokenIncorrect:]_block_invoke + 4336428628
22 StarMakerLite                  0x1021b406c -[RCIMClient syncProcessInMainThread:] + 4336451692
23 StarMakerLite                  0x1021ae4b0 -[RCIMClient connectWithToken:success:error:tokenIncorrect:] + 4336428208
24 StarMakerLite                  0x1009205e8 -[SMInstantMessagingManager connectWithToken:changeHandler:] (SMInstantMessagingManager.m:93)
25 StarMakerLite                  0x100984260 __40-[SMLaunchViewController viewDidAppear:]_block_invoke_2 (SMLaunchViewController.m:99)
26 StarMakerLite                  0x1013f926c __32-[SMLaunchManager load:failure:]_block_invoke (SMLaunchManager.m:31)
27 StarMakerLite                  0x101cab684 __35-[SMLaunchWebService load:failure:]_block_invoke (SMLaunchWebService.m:108)
28 StarMakerLite                  0x101b81b18 __83+[SMNetworking dataTaskWithURL:method:header:parameters:isCache:completionHandler:]_block_invoke (SMNetworking.m:197)
29 StarMakerLite                  0x101b82634 __54+[SMNetworking dataTaskWithRequest:completionHandler:]_block_invoke (SMNetworking.m:269)
30 AFNetworking                   0x103efd730 __72-[AFURLSessionManagerTaskDelegate URLSession:task:didCompleteWithError:]_block_invoke_2.151 (AFURLSessionManager.m:308)
31 libdispatch.dylib              0x1b3a476c8 _dispatch_call_block_and_release + 24
32 libdispatch.dylib              0x1b3a48484 _dispatch_client_callout + 16
33 libdispatch.dylib              0x1b39f4834 _dispatch_main_queue_callback_4CF$VARIANT$mp + 628
34 CoreFoundation                 0x1b3f9e1bc __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
35 CoreFoundation                 0x1b3f99084 __CFRunLoopRun + 1964
36 CoreFoundation                 0x1b3f985b8 CFRunLoopRunSpecific + 436
37 GraphicsServices               0x1b620c584 GSEventRunModal + 100
38 UIKitCore                      0x1e0893558 UIApplicationMain + 212
39 StarMakerLite                  0x10045a5e8 main (main.m:15)
40 libdyld.dylib                  0x1b3a58b94 start + 4

#1. com.apple.CoreLocation.0x157ee3080
0  libsystem_kernel.dylib         0x1b3b99f24 semaphore_timedwait_trap + 8
1  libdispatch.dylib              0x1b39e90ac _dispatch_sema4_timedwait$VARIANT$mp + 64
2  libdispatch.dylib              0x1b39e9a08 _dispatch_semaphore_wait_slow + 72
3  CoreLocation                   0x1bae85058 CLClientInvalidate + 940
4  CoreLocation                   0x1bae8a2b8 CLClientStopVehicleHeadingUpdates + 1752
5  CoreLocation                   0x1bae89f88 CLClientStopVehicleHeadingUpdates + 936
6  CoreLocation                   0x1baee83bc CLGetControlPlaneStatusReport + 42848
7  CoreLocation                   0x1baee82e8 CLGetControlPlaneStatusReport + 42636
8  CoreLocation                   0x1baee2d8c CLGetControlPlaneStatusReport + 20784
9  CoreLocation                   0x1baee2c44 CLGetControlPlaneStatusReport + 20456
10 CoreLocation                   0x1baee510c CLGetControlPlaneStatusReport + 29872
11 libxpc.dylib                   0x1b3c620a4 _xpc_connection_call_event_handler + 68
12 libxpc.dylib                   0x1b3c62410 _xpc_connection_mach_event + 864
13 libdispatch.dylib              0x1b3a48544 _dispatch_client_callout4 + 16
14 libdispatch.dylib              0x1b39ff068 _dispatch_mach_msg_invoke$VARIANT$mp + 340
15 libdispatch.dylib              0x1b39efae4 _dispatch_lane_serial_drain$VARIANT$mp + 284
16 libdispatch.dylib              0x1b39ffc3c _dispatch_mach_invoke$VARIANT$mp + 476
17 libdispatch.dylib              0x1b39efae4 _dispatch_lane_serial_drain$VARIANT$mp + 284
18 libdispatch.dylib              0x1b39f0760 _dispatch_lane_invoke$VARIANT$mp + 432
19 libdispatch.dylib              0x1b39f8f00 _dispatch_workloop_worker_thread + 600
20 libsystem_pthread.dylib        0x1b3c2a0f0 _pthread_wqthread + 312
21 libsystem_pthread.dylib        0x1b3c2cd00 start_wqthread + 4

#2. JavaScriptCore bmalloc scavenger
0  libsystem_kernel.dylib         0x1b3ba4f0c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x1b3c21d48 _pthread_cond_wait$VARIANT$mp + 636
2  libc++.1.dylib                 0x1b31704d0 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 24
3  JavaScriptCore                 0x1bb307d7c void std::__1::condition_variable_any::wait<std::__1::unique_lock<bmalloc::Mutex> >(std::__1::unique_lock<bmalloc::Mutex>&) + 104
4  JavaScriptCore                 0x1bb30be70 bmalloc::Scavenger::threadRunLoop() + 176
5  JavaScriptCore                 0x1bb30b5a4 bmalloc::Scavenger::Scavenger(std::__1::lock_guard<bmalloc::Mutex>&) + 10
6  JavaScriptCore                 0x1bb30d050 std::__1::__thread_specific_ptr<std::__1::__thread_struct>::set_pointer(std::__1::__thread_struct*) + 38
7  libsystem_pthread.dylib        0x1b3c292fc _pthread_body + 128
8  libsystem_pthread.dylib        0x1b3c2925c _pthread_start + 48
9  libsystem_pthread.dylib        0x1b3c2cd08 thread_start + 4

#3. WebThread
0  libsystem_kernel.dylib         0x1b3ba4f0c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x1b3c21d48 _pthread_cond_wait$VARIANT$mp + 636
2  JavaScriptCore                 0x1bb2f5f34 WTF::ThreadCondition::timedWait(WTF::Mutex&, WTF::WallTime) + 148
3  JavaScriptCore                 0x1bb2dd0f4 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 2004
4  WebCore                        0x1bcdbf510 bool WTF::Condition::waitUntil<WTF::Lock>(WTF::Lock&, WTF::TimeWithDynamicClockType const&) + 184
5  WebCore                        0x1bcdbe1f4 SendDelegateMessage(NSInvocation*) + 652
6  CoreFoundation                 0x1b401550c ___forwarding___ + 640
7  CoreFoundation                 0x1b40174bc _CF_forwarding_prep_0 + 92
8  WebKitLegacy                   0x1be261e84 __48-[WebFrame(WebPrivate) deviceOrientationChanged]_block_invoke + 116
9  WebCore                        0x1bdb65d0c HandleRunSource(void*) + 716
10 CoreFoundation                 0x1b3f9e5b8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
11 CoreFoundation                 0x1b3f9e538 __CFRunLoopDoSource0 + 88
12 CoreFoundation                 0x1b3f9de1c __CFRunLoopDoSources0 + 176
13 CoreFoundation                 0x1b3f98ce8 __CFRunLoopRun + 1040
14 CoreFoundation                 0x1b3f985b8 CFRunLoopRunSpecific + 436
15 WebCore                        0x1bcdbfba4 RunWebThread(void*) + 592
16 libsystem_pthread.dylib        0x1b3c292fc _pthread_body + 128
17 libsystem_pthread.dylib        0x1b3c2925c _pthread_start + 48
18 libsystem_pthread.dylib        0x1b3c2cd08 thread_start + 4

#4. Thread
0  libsystem_kernel.dylib         0x1b3ba5b9c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b3c2a114 _pthread_wqthread + 348
2  libsystem_pthread.dylib        0x1b3c2cd00 start_wqthread + 4

#5. com.apple.uikit.eventfetch-thread
0  libsystem_kernel.dylib         0x1b3b99ed0 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x1b3b993a8 mach_msg + 72
2  CoreFoundation                 0x1b3f9dfb0 __CFRunLoopServiceMachPort + 236
3  CoreFoundation                 0x1b3f98e4c __CFRunLoopRun + 1396
4  CoreFoundation                 0x1b3f985b8 CFRunLoopRunSpecific + 436
5  Foundation                     0x1b498c6a4 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 300
6  Foundation                     0x1b498c550 -[NSRunLoop(NSRunLoop) runUntilDate:] + 148
7  UIKitCore                      0x1e07f0ac0 -[UIEventFetcher threadMain] + 136
8  Foundation                     0x1b4abf3b0 __NSThread__start__ + 1040
9  libsystem_pthread.dylib        0x1b3c292fc _pthread_body + 128
10 libsystem_pthread.dylib        0x1b3c2925c _pthread_start + 48
11 libsystem_pthread.dylib        0x1b3c2cd08 thread_start + 4

#6. com.apple.root.default-qos
0  libsystem_kernel.dylib         0x1b3ba4f0c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x1b3c21d48 _pthread_cond_wait$VARIANT$mp + 636
2  Foundation                     0x1b49faa48 -[__NSOperationInternal _waitUntilFinished:] + 780
3  Foundation                     0x1b49b4f90 -[__NSObserver _doit:] + 240
4  CoreFoundation                 0x1b3f7cd14 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
5  CoreFoundation                 0x1b3f7cce0 ___CFXRegistrationPost_block_invoke + 64
6  CoreFoundation                 0x1b3f7c1d0 _CFXRegistrationPost + 392
7  CoreFoundation                 0x1b3f7be7c ___CFXNotificationPost_block_invoke + 96
8  CoreFoundation                 0x1b3ef41c0 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1404
9  CoreFoundation                 0x1b3f7b908 _CFXNotificationPost + 696
10 Foundation                     0x1b498aeb0 -[NSNotificationCenter postNotificationName:object:userInfo:] + 68
11 CoreTelephony                  0x1b6ec5f94 -[CTTelephonyNetworkInfo updateLegacyRat:] + 84
12 CoreTelephony                  0x1b6ec5e68 -[CTTelephonyNetworkInfo updateRat:descriptor:] + 672
13 CoreTelephony                  0x1b6ec5af0 -[CTTelephonyNetworkInfo queryRatForDescriptor:] + 528
14 CoreTelephony                  0x1b6ec5834 -[CTTelephonyNetworkInfo queryRat] + 336
15 CoreTelephony                  0x1b6ec2fc0 -[CTTelephonyNetworkInfo init] + 1368
16 StarMakerLite                  0x1006941b0 -[SMReachabilityManager getMCC] (SMReachabilityManager.m:182)
17 StarMakerLite                  0x100693f0c -[SMReachabilityManager getCountryCode] (SMReachabilityManager.m:175)
18 StarMakerLite                  0x1018649c4 +[SMBundle language] (SMBundle.m:72)
19 StarMakerLite                  0x1019ec3f0 -[SMNetworkingConfig languageCode] (SMNetworkingConfig.m:211)
20 StarMakerLite                  0x1019edca0 -[SMNetworkingConfig serviceBasicURLWithPath:] (SMNetworkingConfig.m:353)
21 StarMakerLite                  0x1012d0f48 +[NSURL(SM) sm_URLWithPath:] (NSURL+SM.m:17)
22 StarMakerLite                  0x101b80de8 +[SMNetworking dataTaskWithPath:method:header:parameters:isCache:completionHandler:] (SMNetworking.m:82)
23 StarMakerLite                  0x101b80744 +[SMNetworking dataTaskWithPath:method:parameters:completionHandler:] (SMNetworking.m:30)
24 StarMakerLite                  0x100e118c0 -[SMGiftNetService getAllEffectSuccess:failure:] (SMGiftNetService.m:488)
25 StarMakerLite                  0x1014bc2b4 -[FBGiftGlobalService requestForEffectList] (FBGiftGlobalService.m:352)
26 StarMakerLite                  0x1014bab88 -[FBGiftGlobalService preloadData] (FBGiftGlobalService.m:251)
27 StarMakerLite                  0x1014b9ac8 -[FBGiftGlobalService init] (FBGiftGlobalService.m:127)
28 StarMakerLite                  0x10187dfdc +[NSObject(OTSharedInstance) sharedInstance] (NSObject+OTSharedInstance.m:12)
29 StarMakerLite                  0x1014b9e28 +[FBGiftGlobalService authLoginWithUserToken:userId:] (FBGiftGlobalService.m:151)
30 StarMakerLite                  0x10140d694 __33-[AppDelegate setUpStarMeService]_block_invoke (AppDelegate.m:300)
31 libdispatch.dylib              0x1b3a476c8 _dispatch_call_block_and_release + 24
32 libdispatch.dylib              0x1b3a48484 _dispatch_client_callout + 16
33 libdispatch.dylib              0x1b39eb4d8 _dispatch_queue_override_invoke + 680
34 libdispatch.dylib              0x1b39f7a60 _dispatch_root_queue_drain + 376
35 libdispatch.dylib              0x1b39f8308 _dispatch_worker_thread2 + 128
36 libsystem_pthread.dylib        0x1b3c2a190 _pthread_wqthread + 472
37 libsystem_pthread.dylib        0x1b3c2cd00 start_wqthread + 4

#7. NSOperationQueue 0x2822f0a60 (QOS: UNSPECIFIED)
0  libsystem_kernel.dylib         0x1b3b99f0c semaphore_wait_trap + 8
1  libdispatch.dylib              0x1b39e8fc4 _dispatch_sema4_wait$VARIANT$mp + 24
2  libdispatch.dylib              0x1b39e9a48 _dispatch_semaphore_wait_slow + 136
3  WebCore                        0x1bc917d60 -[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:] + 160
4  CFNetwork                      0x1b48051f8 invocation function for block in _NSURLConnectionCanRespondToProtectionSpace(_CFURLConnection*, _CFURLProtectionSpace*, void const*) + 92
5  CFNetwork                      0x1b4847a6c __65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke + 60
6  Foundation                     0x1b4a9bb6c __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 16
7  Foundation                     0x1b49a3cc8 -[NSBlockOperation main] + 72
8  Foundation                     0x1b49a319c -[__NSOperationInternal _start:] + 740
9  Foundation                     0x1b4a9da40 __NSOQSchedule_f + 272
10 libdispatch.dylib              0x1b3a476c8 _dispatch_call_block_and_release + 24
11 libdispatch.dylib              0x1b3a48484 _dispatch_client_callout + 16
12 libdispatch.dylib              0x1b39eb874 _dispatch_continuation_pop$VARIANT$mp + 412
13 libdispatch.dylib              0x1b39eaf3c _dispatch_async_redirect_invoke + 600
14 libdispatch.dylib              0x1b39f7a60 _dispatch_root_queue_drain + 376
15 libdispatch.dylib              0x1b39f8308 _dispatch_worker_thread2 + 128
16 libsystem_pthread.dylib        0x1b3c2a190 _pthread_wqthread + 472
17 libsystem_pthread.dylib        0x1b3c2cd00 start_wqthread + 4

#8. com.apple.CoreMotion.MotionThread
0  libsystem_kernel.dylib         0x1b3b99ed0 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x1b3b993a8 mach_msg + 72
2  CoreFoundation                 0x1b3f9dfb0 __CFRunLoopServiceMachPort + 236
3  CoreFoundation                 0x1b3f98e4c __CFRunLoopRun + 1396
4  CoreFoundation                 0x1b3f985b8 CFRunLoopRunSpecific + 436
5  CoreFoundation                 0x1b3f99354 CFRunLoopRun + 80
6  CoreMotion                     0x1b99c72cc (Missing)
7  libsystem_pthread.dylib        0x1b3c292fc _pthread_body + 128
8  libsystem_pthread.dylib        0x1b3c2925c _pthread_start + 48
9  libsystem_pthread.dylib        0x1b3c2cd08 thread_start + 4

#9. Crashed: fmdb.<FMDatabaseQueue: 0x282ce4fc0>
0  libsystem_platform.dylib       0x1b3c16f3c _os_unfair_lock_unowned_abort + 36
1  libsystem_platform.dylib       0x1b3c18524 _os_unfair_lock_unlock_slow + 144
2  libsqlite3.dylib               0x1b440f604 sqlite3_snprintf + 3296
3  libsqlite3.dylib               0x1b440f344 sqlite3_snprintf + 2592
4  libsqlite3.dylib               0x1b4472610 sqlite3_free_table + 48616
5  libsqlite3.dylib               0x1b447d25c sqlite3_bind_int64 + 1356
6  libsqlite3.dylib               0x1b4475628 sqlite3_free_table + 60928
7  libsqlite3.dylib               0x1b4450330 sqlite3_step + 28796
8  libsqlite3.dylib               0x1b4449464 sqlite3_step + 432
9  FMDB                           0x1041d5cc4 -[FMDatabase executeUpdate:error:withArgumentsInArray:orDictionary:orVAList:] (FMDatabase.m:1073)
10 FMDB                           0x1041d608c -[FMDatabase executeUpdate:] (FMDatabase.m:1158)
11 StarMakerLite                  0x100f028b4 __32-[SMTrackDataBase insertEvents:]_block_invoke (SMTrackDataBase.m:58)
12 FMDB                           0x1041d9544 __46-[FMDatabaseQueue beginTransaction:withBlock:]_block_invoke (FMDatabaseQueue.m:192)
13 libdispatch.dylib              0x1b3a48484 _dispatch_client_callout + 16
14 libdispatch.dylib              0x1b39f5610 _dispatch_lane_barrier_sync_invoke_and_complete + 56
15 FMDB                           0x1041d9484 -[FMDatabaseQueue beginTransaction:withBlock:] (FMDatabaseQueue.m:203)
16 StarMakerLite                  0x100f024d0 -[SMTrackDataBase insertEvents:] (SMTrackDataBase.m:50)
17 StarMakerLite                  0x101a93330 __68-[SMEventTrackingManager(Main) notifyInsertLogsWithEvent:updateNow:]_block_invoke (SMEventTrackingManager+Main.m:909)
18 libdispatch.dylib              0x1b3a476c8 _dispatch_call_block_and_release + 24
19 libdispatch.dylib              0x1b3a48484 _dispatch_client_callout + 16
20 libdispatch.dylib              0x1b39efc18 _dispatch_lane_serial_drain$VARIANT$mp + 592
21 libdispatch.dylib              0x1b39f0760 _dispatch_lane_invoke$VARIANT$mp + 432
22 libdispatch.dylib              0x1b39f8f00 _dispatch_workloop_worker_thread + 600
23 libsystem_pthread.dylib        0x1b3c2a0f0 _pthread_wqthread + 312
24 libsystem_pthread.dylib        0x1b3c2cd00 start_wqthread + 4

#10. com.twitter.crashlytics.ios.MachExceptionServer
0  StarMakerLite                  0x101dda4e0 CLSProcessRecordAllThreads + 4332414176
1  StarMakerLite                  0x101dda9a0 CLSProcessRecordAllThreads + 4332415392
2  StarMakerLite                  0x101dca1f0 CLSHandler + 4332347888
3  StarMakerLite                  0x101dc55e0 CLSMachExceptionServer + 4332328416
4  libsystem_pthread.dylib        0x1b3c292fc _pthread_body + 128
5  libsystem_pthread.dylib        0x1b3c2925c _pthread_start + 48
6  libsystem_pthread.dylib        0x1b3c2cd08 thread_start + 4

#11. Thread
0  libsystem_kernel.dylib         0x1b3ba5b9c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b3c2a114 _pthread_wqthread + 348
2  libsystem_pthread.dylib        0x1b3c2cd00 start_wqthread + 4

#12. com.google.fira.worker
0  libsystem_kernel.dylib         0x1b3b99ed0 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x1b3b993a8 mach_msg + 72
2  libdispatch.dylib              0x1b39fe318 _dispatch_mach_send_and_wait_for_reply + 500
3  libdispatch.dylib              0x1b39fe7ac dispatch_mach_send_with_result_and_wait_for_reply$VARIANT$mp + 56
4  libxpc.dylib                   0x1b3c60eb4 xpc_connection_send_message_with_reply_sync + 204
5  Security                       0x1b4cb0948 securityd_message_with_reply_sync + 96
6  Security                       0x1b4cb0f14 securityd_send_sync_and_do + 80
7  Security                       0x1b4d0a6b8 __SecItemCopyMatching_block_invoke_2 + 240
8  Security                       0x1b4d094f8 __SecItemAuthDoQuery_block_invoke + 312
9  Security                       0x1b4d07f48 SecItemAuthDo + 108
10 Security                       0x1b4d087e0 SecItemAuthDoQuery + 512
11 Security                       0x1b4d0a5a0 __SecItemCopyMatching_block_invoke + 120
12 Security                       0x1b4d06554 SecOSStatusWith + 52
13 Security                       0x1b4d08bd4 SecItemCopyMatching + 332
14 StarMakerLite                  0x101f84ad0 +[FIRInstanceIDKeyPair cachedKeyRefWithTag:] + 4334160592
15 StarMakerLite                  0x101f846a0 +[FIRInstanceIDKeyPair keyPairForPrivateKeyTag:publicKeyTag:error:] + 4334159520
16 StarMakerLite                  0x101f860e8 -[FIRInstanceIDKeyPairStore migrateKeyPairCacheIfNeeded] + 4334166248
17 StarMakerLite                  0x101f85890 -[FIRInstanceIDKeyPairStore loadKeyPairWithError:] + 4334164112
18 StarMakerLite                  0x101f856a0 -[FIRInstanceIDKeyPairStore appIdentityWithError:] + 4334163616
19 StarMakerLite                  0x101f78e14 -[FIRInstanceID(Private) appInstanceID:] + 4334112276
20 StarMakerLite                  0x101f25ee8 -[FIRAIdentity firebaseInstanceID] + 4333772520
21 StarMakerLite                  0x101f3016c -[FIRAMeasurement createRawEventMetadataWithUserAttributes:] + 4333814124
22 StarMakerLite                  0x101f2dc48 __43-[FIRAMeasurement writeEventOnWorkerQueue:]_block_invoke.1042 + 4333804616
23 StarMakerLite                  0x101f0eee8 -[FIRASqliteStore performTransaction:] + 4333678312
24 StarMakerLite                  0x101f2ca98 -[FIRAMeasurement writeEventOnWorkerQueue:] + 4333800088
25 StarMakerLite                  0x101f2c388 -[FIRAMeasurement handleEventOnWorkerQueue:] + 4333798280
26 StarMakerLite                  0x101f3e860 __52-[FIRAScheduler scheduleOnWorkerQueueBlockID:block:]_block_invoke + 4333873248
27 libdispatch.dylib              0x1b3a476c8 _dispatch_call_block_and_release + 24
28 libdispatch.dylib              0x1b3a48484 _dispatch_client_callout + 16
29 libdispatch.dylib              0x1b39efc18 _dispatch_lane_serial_drain$VARIANT$mp + 592
30 libdispatch.dylib              0x1b39f0760 _dispatch_lane_invoke$VARIANT$mp + 432
31 libdispatch.dylib              0x1b39f8f00 _dispatch_workloop_worker_thread + 600
32 libsystem_pthread.dylib        0x1b3c2a0f0 _pthread_wqthread + 312
33 libsystem_pthread.dylib        0x1b3c2cd00 start_wqthread + 4

#13. Thread
0  libsystem_kernel.dylib         0x1b3ba5b9c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b3c2a114 _pthread_wqthread + 348
2  libsystem_pthread.dylib        0x1b3c2cd00 start_wqthread + 4

#14. Thread
0  libsystem_kernel.dylib         0x1b3ba5b9c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b3c2a114 _pthread_wqthread + 348
2  libsystem_pthread.dylib        0x1b3c2cd00 start_wqthread + 4

#15. Thread
0  libsystem_kernel.dylib         0x1b3ba5428 __semwait_signal + 8
1  libsystem_c.dylib              0x1b3b1a5d0 nanosleep + 212
2  libsystem_c.dylib              0x1b3b1a3cc sleep + 44
3  StarMakerLite                  0x102248a44 RongCloud::RCloudClient::Timer() + 4337060420
4  StarMakerLite                  0x102245ce4 RongCloud::RCloudClient::ThreadFunc(void*) + 4337048804
5  libsystem_pthread.dylib        0x1b3c292fc _pthread_body + 128
6  libsystem_pthread.dylib        0x1b3c2925c _pthread_start + 48
7  libsystem_pthread.dylib        0x1b3c2cd08 thread_start + 4

#16. com.apple.NSURLConnectionLoader
0  libsystem_kernel.dylib         0x1b3b99ed0 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x1b3b993a8 mach_msg + 72
2  CoreFoundation                 0x1b3f9dfb0 __CFRunLoopServiceMachPort + 236
3  CoreFoundation                 0x1b3f98e4c __CFRunLoopRun + 1396
4  CoreFoundation                 0x1b3f985b8 CFRunLoopRunSpecific + 436
5  CFNetwork                      0x1b45b8e18 -[__CoreSchedulingSetRunnable runForever] + 212
6  Foundation                     0x1b4abf3b0 __NSThread__start__ + 1040
7  libsystem_pthread.dylib        0x1b3c292fc _pthread_body + 128
8  libsystem_pthread.dylib        0x1b3c2925c _pthread_start + 48
9  libsystem_pthread.dylib        0x1b3c2cd08 thread_start + 4

#17. GAIThread
0  libsystem_kernel.dylib         0x1b3b99ed0 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x1b3b993a8 mach_msg + 72
2  CoreFoundation                 0x1b3f9dfb0 __CFRunLoopServiceMachPort + 236
3  CoreFoundation                 0x1b3f98e4c __CFRunLoopRun + 1396
4  CoreFoundation                 0x1b3f985b8 CFRunLoopRunSpecific + 436
5  Foundation                     0x1b498c6a4 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 300
6  Foundation                     0x1b49c8094 -[NSRunLoop(NSRunLoop) run] + 88
7  StarMakerLite                  0x101d35c10 +[GAI threadMain:] + 4331740176
8  Foundation                     0x1b4abf3b0 __NSThread__start__ + 1040
9  libsystem_pthread.dylib        0x1b3c292fc _pthread_body + 128
10 libsystem_pthread.dylib        0x1b3c2925c _pthread_start + 48
11 libsystem_pthread.dylib        0x1b3c2cd08 thread_start + 4

#18. psndproc
0  libsystem_kernel.dylib         0x1b3ba5428 __semwait_signal + 8
1  libsystem_c.dylib              0x1b3b1a5d0 nanosleep + 212
2  libsystem_c.dylib              0x1b3b1a4a4 usleep + 64
3  PI_iLiveBase                   0x105567bf0 PSNDSelector::selectorProc() + 2072
4  libsystem_pthread.dylib        0x1b3c292fc _pthread_body + 128
5  libsystem_pthread.dylib        0x1b3c2925c _pthread_start + 48
6  libsystem_pthread.dylib        0x1b3c2cd08 thread_start + 4

#19. psndproc
0  libsystem_kernel.dylib         0x1b3ba5428 __semwait_signal + 8
1  libsystem_c.dylib              0x1b3b1a5d0 nanosleep + 212
2  libsystem_c.dylib              0x1b3b1a4a4 usleep + 64
3  PI_iLiveBase                   0x105567bf0 PSNDSelector::selectorProc() + 2072
4  libsystem_pthread.dylib        0x1b3c292fc _pthread_body + 128
5  libsystem_pthread.dylib        0x1b3c2925c _pthread_start + 48
6  libsystem_pthread.dylib        0x1b3c2cd08 thread_start + 4

#20. psdns
0  libsystem_kernel.dylib         0x1b3ba5428 __semwait_signal + 8
1  libsystem_c.dylib              0x1b3b1a5d0 nanosleep + 212
2  libsystem_c.dylib              0x1b3b1a4a4 usleep + 64
3  StarMakerLite                  0x10233770c PSDNS::MainThread() (psdns.cpp:275)
4  StarMakerLite                  0x1023373d0 PSDNS_run_main(void*) (psdns.cpp:43)
5  libsystem_pthread.dylib        0x1b3c292fc _pthread_body + 128
6  libsystem_pthread.dylib        0x1b3c2925c _pthread_start + 48
7  libsystem_pthread.dylib        0x1b3c2cd08 thread_start + 4

#21. Log
0  libsystem_kernel.dylib         0x1b3ba4f0c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x1b3c21d48 _pthread_cond_wait$VARIANT$mp + 636
2  libc++.1.dylib                 0x1b31704d0 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 24
3  stari                          0x10564e71c arc::LoggerManager::Run() + 607840
4  stari                          0x105653020 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, std::__1::__bind<void (arc::LoggerManager::*)(), arc::LoggerManager*> > >(void*) + 626532
5  libsystem_pthread.dylib        0x1b3c292fc _pthread_body + 128
6  libsystem_pthread.dylib        0x1b3c2925c _pthread_start + 48
7  libsystem_pthread.dylib        0x1b3c2cd08 thread_start + 4

#22. Thread
0  libsystem_kernel.dylib         0x1b3ba5b9c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b3c2a1d4 _pthread_wqthread + 540
2  libsystem_pthread.dylib        0x1b3c2cd00 start_wqthread + 4

#23. Thread
0  libsystem_kernel.dylib         0x1b3ba5b9c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b3c2a114 _pthread_wqthread + 348
2  libsystem_pthread.dylib        0x1b3c2cd00 start_wqthread + 4

#24. Thread
0  libsystem_pthread.dylib        0x1b3c2ccfc start_wqthread + 190

#25. Thread
0  libsystem_kernel.dylib         0x1b3ba5b9c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b3c2a114 _pthread_wqthread + 348
2  libsystem_pthread.dylib        0x1b3c2cd00 start_wqthread + 4

#26. Thread
0  libsystem_kernel.dylib         0x1b3ba5b9c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b3c2a114 _pthread_wqthread + 348
2  libsystem_pthread.dylib        0x1b3c2cd00 start_wqthread + 4

#27. Thread
0  libsystem_kernel.dylib         0x1b3ba5b9c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b3c2a1d4 _pthread_wqthread + 540
2  libsystem_pthread.dylib        0x1b3c2cd00 start_wqthread + 4

#28. AVAudioSession Notify Thread
0  libsystem_kernel.dylib         0x1b3b99ed0 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x1b3b993a8 mach_msg + 72
2  CoreFoundation                 0x1b3f9dfb0 __CFRunLoopServiceMachPort + 236
3  CoreFoundation                 0x1b3f98e4c __CFRunLoopRun + 1396
4  CoreFoundation                 0x1b3f985b8 CFRunLoopRunSpecific + 436
5  AVFAudio                       0x1b9f71c4c GenericRunLoopThread::Entry(void*) + 164
6  AVFAudio                       0x1b9f9dd34 CAPThread::Entry(CAPThread*) + 88
7  libsystem_pthread.dylib        0x1b3c292fc _pthread_body + 128
8  libsystem_pthread.dylib        0x1b3c2925c _pthread_start + 48
9  libsystem_pthread.dylib        0x1b3c2cd08 thread_start + 4

#29. Thread
0  libsystem_kernel.dylib         0x1b3ba5b9c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b3c2a114 _pthread_wqthread + 348
2  libsystem_pthread.dylib        0x1b3c2cd00 start_wqthread + 4

#30. Thread
0  libsystem_kernel.dylib         0x1b3ba5b9c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b3c2a114 _pthread_wqthread + 348
2  libsystem_pthread.dylib        0x1b3c2cd00 start_wqthread + 4

#31. Thread
0  libsystem_kernel.dylib         0x1b3ba5b9c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b3c2a114 _pthread_wqthread + 348
2  libsystem_pthread.dylib        0x1b3c2cd00 start_wqthread + 4

#32. Thread
0  libsystem_kernel.dylib         0x1b3ba5b9c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b3c2a114 _pthread_wqthread + 348
2  libsystem_pthread.dylib        0x1b3c2cd00 start_wqthread + 4

#33. Thread
0  libsystem_kernel.dylib         0x1b3ba5b9c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b3c2a1d4 _pthread_wqthread + 540
2  libsystem_pthread.dylib        0x1b3c2cd00 start_wqthread + 4

#34. Thread
0  libsystem_kernel.dylib         0x1b3ba5b9c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b3c2a114 _pthread_wqthread + 348
2  libsystem_pthread.dylib        0x1b3c2cd00 start_wqthread + 4

#35. Thread
0  libsystem_kernel.dylib         0x1b3ba5b9c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b3c2a114 _pthread_wqthread + 348
2  libsystem_pthread.dylib        0x1b3c2cd00 start_wqthread + 4

#36. NSURLConnection-0
0  libsystem_kernel.dylib         0x1b3ba4f0c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x1b3c21d48 _pthread_cond_wait$VARIANT$mp + 636
2  Foundation                     0x1b49faa48 -[__NSOperationInternal _waitUntilFinished:] + 780
3  CFNetwork                      0x1b45b8cd8 -[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 200
4  CFNetwork                      0x1b45b8d30 -[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 56
5  CFNetwork                      0x1b4804680 _NSURLConnectionCanRespondToProtectionSpace(_CFURLConnection*, _CFURLProtectionSpace*, void const*) + 116
6  CFNetwork                      0x1b4749000 invocation function for block in URLConnectionClient_Classic::_delegate_willSendRequestForAuthenticationChallenge(_CFURLAuthChallenge*) + 440
7  CFNetwork                      0x1b4745228 invocation function for block in URLConnectionClient_Classic::_withDelegateAsync(char const*, void (_CFURLConnection*, CFURLConnectionClientCurrent_VMax const*) block_pointer) + 108
8  CFNetwork                      0x1b482444c invocation function for block in QCoreSchedulingSet::performAsync(void () block_pointer) const + 52
9  libdispatch.dylib              0x1b3a476c8 _dispatch_call_block_and_release + 24
10 libdispatch.dylib              0x1b3a48484 _dispatch_client_callout + 16
11 libdispatch.dylib              0x1b39efc18 _dispatch_lane_serial_drain$VARIANT$mp + 592
12 libdispatch.dylib              0x1b39f0760 _dispatch_lane_invoke$VARIANT$mp + 432
13 libdispatch.dylib              0x1b39f8f00 _dispatch_workloop_worker_thread + 600
14 libsystem_pthread.dylib        0x1b3c2a0f0 _pthread_wqthread + 312
15 libsystem_pthread.dylib        0x1b3c2cd00 start_wqthread + 4

#37. Thread
0  libsystem_kernel.dylib         0x1b3ba5b9c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b3c2a114 _pthread_wqthread + 348
2  libsystem_pthread.dylib        0x1b3c2cd00 start_wqthread + 4

#38. Thread
0  libsystem_kernel.dylib         0x1b3ba5b9c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b3c2a114 _pthread_wqthread + 348
2  libsystem_pthread.dylib        0x1b3c2cd00 start_wqthread + 4

#39. Thread
0  libsystem_pthread.dylib        0x1b3c2ccfc start_wqthread + 190

#40. Thread
0  libsystem_kernel.dylib         0x1b3ba5b9c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b3c2a114 _pthread_wqthread + 348
2  libsystem_pthread.dylib        0x1b3c2cd00 start_wqthread + 4

#41. Thread
0  libsystem_kernel.dylib         0x1b3ba5b9c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b3c2a114 _pthread_wqthread + 348
2  libsystem_pthread.dylib        0x1b3c2cd00 start_wqthread + 4

#42. Thread
0  libsystem_kernel.dylib         0x1b3ba5b9c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b3c2a114 _pthread_wqthread + 348
2  libsystem_pthread.dylib        0x1b3c2cd00 start_wqthread + 4

#43. Thread
0  libsystem_kernel.dylib         0x1b3ba5b9c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b3c2a114 _pthread_wqthread + 348
2  libsystem_pthread.dylib        0x1b3c2cd00 start_wqthread + 4

@ccgus
Copy link
Owner

ccgus commented Oct 25, 2018

Nothing stands out to me- but you've got two sqlite stacks going on at the same time. Are they hitting the same database?

@dongfanggugu
Copy link
Author

dongfanggugu commented Oct 27, 2018

the two sqlite stacks is independent.

dispatch_async(serialQueue, ^{
    FMDatabaseQueue *queue = [[SMDataBaseManager sharedInstance] getDBQueue];
    [queue inTransaction:^(FMDatabase *db, BOOL *rollback) {
        //do something
    }];
});

I use FMDatabaseQueue with a serial queue like the code above, and the OS create more than one thread to execute the FMDatabaseQueue (indeed more than one thread). the crash report is "Unlock of an os_unfair_lock not owned by current thread", so i think the crash happed when the threads hit the database. The FMDatabaseQueue cannot ensure current execute thread is the same with the previous or the next.
when other thread try to unlock the database, may cause the crash. @ccgus

@irobbin1024
Copy link

same question.

Crashed: fmdb.<FMDatabaseQueue: 0x2823212f0>
0  libsystem_platform.dylib       0x1c4728f14 _os_unfair_lock_recursive_abort + 36
1  libsystem_platform.dylib       0x1c472a3a8 _os_unfair_lock_lock_slow + 264
2  libsqlite3.dylib               0x1c4f21558 sqlite3_snprintf + 3124
3  libsqlite3.dylib               0x1c4f21344 sqlite3_snprintf + 2592
4  libsqlite3.dylib               0x1c4f84610 sqlite3_free_table + 48616
5  libsqlite3.dylib               0x1c4f87fc4 sqlite3_free_table + 63388
6  libsqlite3.dylib               0x1c4f87774 sqlite3_free_table + 61260
7  libsqlite3.dylib               0x1c4f623a8 sqlite3_step + 28916
8  libsqlite3.dylib               0x1c4f5b464 sqlite3_step + 432
9  MyApp                       0x10022c180 -[FMDatabase executeUpdate:error:withArgumentsInArray:orDictionary:orVAList:] (FMDatabase.m:1104)
10 MyApp                       0x10022c50c -[FMDatabase executeUpdate:withParameterDictionary:] (FMDatabase.m:1206)
11 MyApp                       0x1004f8a40 __56-[XYBaseDatabase insertInQueue:withParameterDictionary:]_block_invoke (XYBaseDatabase.m:136)
12 MyApp                       0x100230020 __30-[FMDatabaseQueue inDatabase:]_block_invoke (FMDatabaseQueue.m:188)
13 libdispatch.dylib              0x1c455a484 _dispatch_client_callout + 16
14 libdispatch.dylib              0x1c45075d8 _dispatch_lane_barrier_sync_invoke_and_complete + 56
15 MyApp                       0x10022ff98 -[FMDatabaseQueue inDatabase:] (FMDatabaseQueue.m:202)
16 MyApp                       0x1004f895c -[XYBaseDatabase insertInQueue:withParameterDictionary:] (XYBaseDatabase.m:142)
17 MyApp                       0x10096e328 -[XiaoYingSDKMgr checkTemplateScene] (XiaoYingSDKMgr.m:309)
18 libdispatch.dylib              0x1c455a484 _dispatch_client_callout + 16
19 libdispatch.dylib              0x1c44fd83c _dispatch_continuation_pop$VARIANT$mp + 412
20 libdispatch.dylib              0x1c450dbac _dispatch_source_invoke$VARIANT$mp + 1704
21 libdispatch.dylib              0x1c4509a28 _dispatch_root_queue_drain + 376
22 libdispatch.dylib              0x1c450a2d0 _dispatch_worker_thread2 + 128
23 libsystem_pthread.dylib        0x1c473c17c _pthread_wqthread + 472
24 libsystem_pthread.dylib        0x1c473ecec start_wqthread + 4

@zhouyantongiosDev
Copy link

@ccgus
same question.

Thread 21 name: Dispatch queue: fmdb.<FMDatabaseQueue: 0x281110800>
Thread 21 Crashed:
0 libsystem_platform.dylib 0x00000001ec30ef3c 0x1ec30b000 + 16188
1 libsystem_platform.dylib 0x00000001ec310524 0x1ec30b000 + 21796
2 libsqlite3.dylib 0x00000001ecb07604 0x1ecb00000 + 30212
3 libsqlite3.dylib 0x00000001ecb07344 0x1ecb00000 + 29508
4 libsqlite3.dylib 0x00000001ecb055ec 0x1ecb00000 + 21996
5 libsqlite3.dylib 0x00000001ecb01ebc 0x1ecb00000 + 7868

0 libsystem_platform.dylib 0x1c4728f14 _os_unfair_lock_recursive_abort + 36
1 libsystem_platform.dylib 0x1c472a3a8 _os_unfair_lock_lock_slow + 264

@CodeLife2012
Copy link

same issue

1 similar comment
@yaoyue
Copy link

yaoyue commented Jan 24, 2019

same issue

@zhouyantongiosDev
Copy link

@dongfanggugu Has your problem been solved?
We also used RongCloud

@KenmuHuang
Copy link

Me too, how to fix it?

@minchaozhang
Copy link

same issue, how to fix it?

1 similar comment
@Assuner-Lee
Copy link

same issue, how to fix it?

@zhouyantongiosDev
Copy link

same issue, how to fix it?
crmo have already been solved.

#728

@marcosybarraa
Copy link

Same here

@robertmryan
Copy link
Collaborator

We need a MCVE. I'm unable to reproduce the problem.

It's hard to diagnose on the basis of a crashlog alone. (The crash log from dongfanggugus has a slightly worrisome scenario where there are two threads deep in SQLite API at the same time ... I hope they're not working on the same database; lol.)

A reproducible example of the problem would be useful. Create a blank project and add the bare amount of code necessary to manifest the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests