Skip to content

dynamic_lib is not thread safe #9137

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

Closed
alexcrichton opened this issue Sep 12, 2013 · 2 comments
Closed

dynamic_lib is not thread safe #9137

alexcrichton opened this issue Sep 12, 2013 · 2 comments

Comments

@alexcrichton
Copy link
Member

I was looking back at all the recent failures on the BSD bots, and all of them were in the dynamic_lib libstd tests. If you take a look at these logs:

http://buildbot.rust-lang.org/builders/auto-bsd-64-opt/builds/1029/steps/test/logs/stdio
http://buildbot.rust-lang.org/builders/auto-bsd-64-opt/builds/1030/steps/test/logs/stdio
http://buildbot.rust-lang.org/builders/auto-bsd-64-opt/builds/1040/steps/test/logs/stdio
http://buildbot.rust-lang.org/builders/auto-bsd-64-opt/builds/1027/steps/test/logs/stdio

The problem is always that in the test_errors_do_not_crash test, the call to DynamicLibrary::open actually returns Ok when it should be returning Err. The runtime failure then happens when the destructor re-invokes fail!().

This only fails sometimes, and I'm led to believe that this is a race in the check_for_errors_in function. This function is not thread-safe in that it is possible for one thread to get the errors of another. Basically there should not be any interleaving inside of this function, but it's a very real possibility that there is.

For now I'm going to ignore the tests, but this needs a real fix at some point.

cc @sstewartgallus

alexcrichton added a commit to alexcrichton/rust that referenced this issue Sep 12, 2013
The library isn't thread-safe, cc rust-lang#9137
bors added a commit that referenced this issue Sep 12, 2013
…=thestinger

The library isn't thread-safe, cc #9137
@mstewartgallus
Copy link
Contributor

Right. I recognized this possibility when I wrote the library but was mistaken about how to fix this. I already wrote a related issue #8156 but this issue is more specific. I plan to fix this after I finish up with the issue where the unit tests use the cos function instead of an internal function.

@alexcrichton
Copy link
Member Author

Ah, closing in favor of #8156 in that case.

flip1995 pushed a commit to flip1995/rust that referenced this issue Jul 18, 2022
…rednet

Fix example header

changelog: fix example header
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants