-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Comments
the iOS version is 12.0.0 [logging] BUG IN CLIENT OF sqlite3.dylib: illegal multi-threaded access to database connection |
@Tomsocket Show a backtrace of all your threads please. |
|
me too |
Show a back trace of all your threads. Copy and paste them in here (no screenshots please) |
//the crash trace
|
Nothing stands out to me- but you've got two sqlite stacks going on at the same time. Are they hitting the same database? |
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. |
same question.
|
@ccgus Thread 21 name: Dispatch queue: fmdb.<FMDatabaseQueue: 0x281110800> 0 libsystem_platform.dylib 0x1c4728f14 _os_unfair_lock_recursive_abort + 36 |
same issue |
1 similar comment
same issue |
@dongfanggugu Has your problem been solved? |
Me too, how to fix it? |
same issue, how to fix it? |
1 similar comment
same issue, how to fix it? |
|
Same here |
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. |
the iOS version is 12.0.0
the FMDatabaseQueue is the single instance in my app
i call as
sometimes, the app crashed, report "Unlock of an os_unfair_lock not owned by current thread"
call stack:
the FMDB version is '2.6.2'
The text was updated successfully, but these errors were encountered: