Skip to content

dynamic_lib is not thread safe #9137

Closed
Closed
@alexcrichton

Description

@alexcrichton

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions