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
Unsoundness when starting an isolate per thread #1467
Comments
Do you mind providing the output of the data races? v8 may have some undocumented ordering requirements that we may need to encode via mutexes. I assume these don't happen when you serialize them on different threads via mutex? |
What do you mean by this? Serialize what? Lock what? The output of TSan:
I got even more data races in my real code, when I actually used the isolates. This lead to a segfault. |
Serialization and locking refer to mutual exclusion, ie: We can certainly fix this or accept a PR, but we would need to understand if this means:
|
Oh serializing as in running serially, I thought you meant serializing as in marshalling :P Indeed it seems like only the first isolate must be started on its own |
This is also a good moment to revise the API. I'll expand on another issue though |
I'll work on this |
Is it supposed to be sound to instantiate one isolate per thread?
If it's not the API shouldn't allow it.
If it is, you have data races as reported by ThreadSanitizer at least when creating and dropping the isolates.
There are more data races reported by it.
This code can be ran with
RUSTFLAGS=-Zsanitizer=thread cargo +nightly run -r -Zbuild-std --target x86_64-unknown-linux-gnu
The text was updated successfully, but these errors were encountered: