You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue #8140 brought to my attention that some code in the dynamic library implementation was incorrect. After chatting to @bblum on IRC, I figured out my mistake in creating the implementation. Apparently the function task::atomically only asserts that no context switching occurs, and does not in fact prevent it. A corrected pair of check_for_errors_in functions should replace the use of task::atomically with some locking mechanism to prevent threads from stepping on each others use of errno (or the equivalent Win32 error variable.) Maybe this locking mechanism for safely accessing the error variable should also be exposed separately in Rust's OS interaction facilities.
The text was updated successfully, but these errors were encountered:
The root issue is that dlerror isn't reentrant or even thread safe.
The solution implemented here is to make a yielding spin lock over an
AtomicFlag. This is pretty hacky, but the best we can do at this point.
As far as I can tell, it isn't possible to create a global mutex without
having to initialize it in a single threaded context.
The Windows code isn't affected since errno is thread-local on Windows
and it's running in an atomically block to ensure there isn't a green
thread context switch.
Closes#8156
[`needless_return`] Recursively remove unneeded semicolons
fixrust-lang#8336,
fixrust-lang#8156,
fixrust-lang/rust-clippy#7358,
fixrust-lang#9192,
fixrust-lang/rust-clippy#9503
changelog: [`needless_return`] Recursively remove unneeded semicolons
For now the suggestion about removing the semicolons are hidden because they would be very noisy and should be obvious if the user wants to apply the lint manually instead of using `--fix`. This could be an issue for beginner, but haven't found better way to display it.
Issue #8140 brought to my attention that some code in the dynamic library implementation was incorrect. After chatting to @bblum on IRC, I figured out my mistake in creating the implementation. Apparently the function
task::atomically
only asserts that no context switching occurs, and does not in fact prevent it. A corrected pair of check_for_errors_in functions should replace the use oftask::atomically
with some locking mechanism to prevent threads from stepping on each others use oferrno
(or the equivalent Win32 error variable.) Maybe this locking mechanism for safely accessing the error variable should also be exposed separately in Rust's OS interaction facilities.The text was updated successfully, but these errors were encountered: