-
Notifications
You must be signed in to change notification settings - Fork 167
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 in SyncManager::unregister_session #5752
Comments
What kind of crash happens in pthread_mutex_lock? Does it segfault or abort or something else? I suspect things are just not being torn down in the right order somewhere. Would it be possible to use the thread sanitizer when reproducing this? That would almost certainly show us what's being destroyed in the wrong order, but I have no idea if/how you'd use it with .NET. |
It's a segfault as far as I can tell. I'm also not sure how to use the thread sanitizer, but will see if @fealebenpae can help. |
We also saw that in a dart CI run:
|
We also got a user report of this: realm/realm-dart#858 |
I tried downgrading to various versions all the way to Core 11.14 and it seems the issue still exists. As far as I can tell, it happens when we destroy the .NET session while an upload is in progress. It destroys the shared_ptr to the native session and the crash occurs. |
➤ Nikola Irinchev commented: The dart user reporting this claims it only started happening after upgrading from Core 12.1.0 to 12.5.1. While I can repro the Unity crash with 12.1.0, it may point to these being different bugs or to the older version of the dart SDK not exercising the buggy code for some reason. |
@danieltabacaru, can you take a look? It seems like we have more than a few instances here. Maybe we can add more logging here to try to track down what's getting destroyed in the wrong order here. |
This is a duplicate of #5493. Going to close 5493 and use this issue to track both. |
SDK and version
SDK : .NET
Version: 10.15.1
Core: 12.5.0
Observations
Crash log / stacktrace
Steps & Code to Reproduce
Happens in Unity when I reload the assembly. This causes the finalizer to collect all C# instances, which in turn release any shared pointers they were holding. Based on the stacktrace, when destroying a sync session, it tries to unregister from the manager and a mutex fails to lock. I don't know what the reason for that could be, but I figured someone on the Core team might.
The text was updated successfully, but these errors were encountered: