-
Notifications
You must be signed in to change notification settings - Fork 6
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
HConsed's Send and Sync traits should be bounded on the contained type #1
Comments
AdrienChampion
added a commit
that referenced
this issue
Nov 17, 2020
Wow. I wrote this a while ago, I think these two lines are leftovers from a previous version. Very bad unsafe leftovers. I just removed the implementations and
Does this look fine to you? |
Thank you for the quick response, this looks good to me 🙂 |
Awesome! I just updated the official crates.io version. |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, HConsed implements the
Send
andSync
traits unconditionally:hashconsing/src/lib.rs
Lines 354 to 355 in 1b91c14
This is a possible soundness issue because it allows types
T
that aren't necessarily thread safe to be used across threads as long as they are wrapped in anHConsed<T>
.Sort of a contrived example but the following demonstrates a data-race that segfaults safe rust using this:
Click to expand example
This outputs:
(Issue found by @sslab-gatech's Rust group)
The text was updated successfully, but these errors were encountered: