-
Notifications
You must be signed in to change notification settings - Fork 199
data race with example_hyper #98
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
/cc @overvenus |
Be aware that there could be false positives. See https://users.rust-lang.org/t/howto-sanitize-your-rust-code/9378/22. And https://github.com/japaric/rust-san#better-backtraces could be useful too. |
Thanks @BrunoQC We will fix it later, or could you send us a PR to fix it? |
Hi @BrunoQC , Sorry for the super late reply. The SUMMARY indicates that the data race happens in crate lazy-static. unsafe {
let r = &mut self.0;
self.1.call_once(|| {
*r = Box::into_raw(Box::new(f())); // write
});
&*self.0 // read
} @parched said that
rust-lang/rust#39608 (comment) I am not so familiar with atomic and fence, not sure if this is false positive. I will investigate further. 😄 |
Looks like is probably call_once. I had a look at the source though and couldn't see anything obvious, it certainly doesn't use fences that I could see. It would be good to run it with better backtraces (link earlier) to see exactly where it is happening. |
Looks to be a false positive. Closing. |
To reproduce, run example_hyper with
RUSTFLAGS="-Z sanitizer=thread" cargo run
on a recent nightly. Then runcurl localhost:9898/metrics
twice.The sanitizer is a new cool feature. See [HowTo] Sanitize your Rust code!
The text was updated successfully, but these errors were encountered: