-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Intermittent Realm Accessed from Incorrect Thread after Realm version upgrade #6559
Comments
I am also seeing these crashes.
In realm init I see
So it gets replaced in original cached Realm too on original thread. Then I get a crash on some other operation on that thread, because new scheduler says it is queue-confined. @bmunkholm @jsflax what do you think? I am not a great c++ programmer, so it is just a theory |
I rewrote our helpers to use the same queue to create Realm, fetch results and subscribe to notifications and crash is gone 🎉 |
|
Goals
We use a wrapper around Realm to abstract away some of the write/read logic throughout our application as a way to modularize and simplify our code. We recently upgraded realm from 3.17.3 -> 5.0.1
Expected Results
Our realm wrappers will grab an instance of realm and perform a write transaction on that instance with a Dispatch Item on an autorelease pool and throw it onto our static utility queue to complete the transaction. This worked perfectly prior to upgrading realm.
Actual Results
(print statements for getting realm and writing on realm threads to verify that they're indeed the same, crash happens in the realm.beginWrite() immediately after the latter print statement where we just verified thread safety)
The text was updated successfully, but these errors were encountered: