-
Notifications
You must be signed in to change notification settings - Fork 7
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
Unsound logger
function
#22
Comments
Yes, this is not the only possible unsoundness of this crate. Technically this should only be used for debugging purposes and disabled for production use. If we have the bandwidth we might consider a refactor that gets rid of these. |
Yes, this is not the only possible unsoundness of this crate... That crate gets mutable references to logger everytime itself, and when you have multiple threads (or executions contexts in general, like interrupts), that library can obtain 2 exclusive references to logger (already ub) and cause data races (ub too). We debugged and confirmed that and removed |
This is exactly what |
Hello,
having multiple references with at least one of them being
&mut
to the same memory is considered undefined behavior in Rust.Code like this:
Is absolutely safe and using public interface, yet triggering UB.
Miri output:
The text was updated successfully, but these errors were encountered: