-
Notifications
You must be signed in to change notification settings - Fork 164
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
Segmentation fault in realm_callback_token_schema::~realm_callback_token_schema #7426
Comments
➤ PM Bot commented: Jira ticket: RCORE-2003 |
@nicola-cab or @jedelbo can you take a look here - it's not extremely urgent, but it's related to our mixed support in dart. |
Highly likely something odd with how the object is finalized and garbage collected... can you point me out to the test? |
Unfortunately, it's not a specific test that fails - instead, when the isolate is torn down and all objects in it are finalized, we get the crash. It appears to be a race condition as it only happens in 40-50% of the cases, which makes me believe it is caused by the non-deterministic order of calling the destructors (e.g. if the callback token is destroyed before the Realm, it's fine, otherwise we get this crash). |
mmm, probably order of destruction... I'll try to reproduce it with a multithreading test.. |
Internal note: verify if this PR #7437 is fixing the problem. |
I'm seeing the following crash during test teardown in the dart SDK:
I haven't been able to dive deeper into it, but I believe it has something to do with the destructor being called nondeterministically for the
SharedRealm
and therealm_callback_token_schema
. Sincerealm_callback_token_schema
takes a raw pointer to the Realm, I don't believe it's legal to use it after the realm has been closed. Unfortunately, when dealing with garbage collected languages, we can't control the order in which the destructors will be called, so the C API should somehow guard against this.The text was updated successfully, but these errors were encountered: