-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
1.30 -> 1.31 dylib late-binding regression with GNU binutils 2.28 or older. #61539
Comments
|
How confident are we that PLT entirely negates this issue other than just accidentally preventing it from triggering in this particular case? To me it seems that exactly what happens with PLT here is prevention and the core issue still remains regardless of whether PLT is enabled or not. Not opposed to flipping back the default for now, though. |
I agree, I have no idea what the actual bug is yet, just what affects this specific reduction. What I suspect is happening with |
@eddyb an easy way to (dis-)prove linker fault is to attempt linking with lld. |
triage: we need to discuss this at today's meeting before I'll be comfortable assigning a priority to it. |
discussed in triage meeting. P-high. Removing nomination tag. Assigning to @nagisa and myself. |
Linking with |
This issue is no longer present with binutils 2.29.0. |
https://sourceware.org/bugzilla/show_bug.cgi?id=20995 may be related. |
@nagisa @alexcrichton Is there precedent for checking the version of the linker to work around bugs? |
At least 2.27 also fails so not relro related. Waiting for 2.26 to build right now. |
2.26 and 2.23.1 also fail (although 2.23.1 only prints the addresses and exits with exit code 0 before calling into the plugin), so it is probably safe to say that this issue is present in all relevant versions of the GNU toolchain before 2.29. |
@nagisa Oh, right, I forgot, the bug was fixed after 2.28 but I never tested earlier versions. |
We have only one rudimentary check for support of a c compiler flag (-pie I think) but other than that we don't have any precedence for c compiler or linker version checking in rustc itself |
I think 2.27 only added a way to configure the default:
But |
pre-triage stray thought: While I worry about trying to change compiler behavior based on a dynamically detected linker version, I would have fewer objections to use such detection just to drive the emission of a diagnostic warning. Where said diagnostic tells people to take one of the aforementioned steps to work around the bug. nominating for discussion at T-compiler meeting. |
This has been discussed briefly during the meeting last week, but no real conclusion was arrived at. |
Some points made during aforementioned meeting that I thought were worth transcribing here:
|
I haven't taken any time to look into this since I last commented here (about two months ago). Its tempting to downgrade this to P-medium with justification "this is a bug in |
I tried landing a lint to detect this case (PR #66839) but no one seems terribly enthused about that approach, at least not at this time. (Maybe it would have gotten more traction sooner after @eddyb found the bug.) In that PR, we did get a survey of what version of So, I will just close this issue as a bug in GNU |
Originally reported as #60593, and appears to be caused by #54592, this is my reduction:
common.rs
plugin.rs
driver.rs
How to run it:
I was able to try this out with NixOS 18.03 and 18.09 releases, via:
Example of failure (using a NixOS 18.03 toolchain):
Example of success (by switching to NixOS 18.09):
Other ways to get it to succeed:
RELEASE=nightly-2018-10-11
)-Z plt=yes
when compilingdriver
plugin
tocdylib
(instead ofdylib
)common::get
is private in that case?cdylib
common::get
indriver
common::get
won't get looked up early, which meansdriver
's copy won't overrideplugin
's (within the context of affected toolchains)RTLD_DEEPBIND
when callingdlopen
common::get
fromdriver
is ignored when looking up the use fromplugin
cc @alexcrichton @rust-lang/compiler
The text was updated successfully, but these errors were encountered: