-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
[Regression] Rust v1.20.0 leads to segfault with lazy_static Mutex inside a dylib #44283
Comments
Huh. That's pretty mysterious! We'll have to investigate and see if we can narrow down what might have caused it. |
An ideal thing would be to try and bisect this using the nightly snapshots, to try and narrow down precisely when the regression occurred. |
triage: P-high |
I will try to do this, though if anyone can help with the bisection, it would be most appreciated. =) |
I can run the bisection tool later today. |
I can reproduce the problem locally, at least. |
(Using |
@TimNN that'd be awesome =) |
Here are the results:
Since the segfault occurs in #![feature(alloc_system)]
extern crate alloc_system; to |
@alexcrichton any PRs jump out to you as having fixed this? |
@TimNN what nightly did you test what wasn't affected? For me the current nightly, That being said, this script is doing something that's not supported and fundamentally buggy, which is linking a rust If you use the |
@alexcrichton I'm running |
Ah, I missed that. Do we want to close this as "unsupported", or do you think there's another bug here? I'm inclined to think you've correctly diagnosed the problem. @archshift -- can you say a bit more about how you came upon this use case? Maybe we can help you set things up in a better way? |
@TimNN ah ok that may explain it yeah, I was on 10.12.6 @nikomatsakis yeah I'm ok closing as unsupported, but I'm ok waiting to hear back from @archshift |
@nikomatsakis @alexcrichton I was linking a rust staticlib into a C dylib, then linking the resulting dylib with another rust project. |
@archshift ah yeah unfortunately that's not supported today unless you manually hide symbols from the Rust library. Otherwise allocators are just one instance of a set of symbols that can cause conflicts, but there's other global state in the standard library which can get mixed up and cause conflicts. |
Going to close then. Thanks @archshift for the bug report! |
Smallest sample code I could come up with: https://gist.github.com/d679876d14dd6990494ca65440800dad
When the program reaches main.cpp,L8 (
env::args().nth(0).unwrap();
), it crashes with a segfault. This did not happen in v1.19.0.Version:
Backtrace with rust-lldb:
The text was updated successfully, but these errors were encountered: