-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Simple "Hello World!" throws Segmentation fault on CentOS 6.8 x86 #37874
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
Comments
I was able to confirm this in a clean |
I am seeing this for 1.15.1 as well as for 1.16 (beta) on SL 6.8. This is the only function I see being registered for running at exit:
But when I continue, the SIGSEGV seesms to occur elsewhere.
|
Looking a bit further, I get here
The demangled edx value on no run becomes the original value again. |
The original value gets mangled:
Turning
into
At the end, we find the same value again:
Moving through the mangling:
And then we get ...
So, we now looking to call the function at 0xc39b41a4, which is totally not what was the original target before mangling. So something messed with the guard value? |
If it's any help, a program with an empty main gives this:
|
I do notice the issue does not occur when creating a binary for i686-unknown-linux-gnu on an x86_64-unknown-linux-gnu platform using the --target option. |
Thanks for the investigation @itkovian! I wonder if there's a stray out write causing this problem? Or maybe it's a runtime bug we're running into? |
I just discovered this issue myself, ouch! I wasn't even doing hello, just I found that the binary compiled on RHEL6 won't run on Fedora either, so it's not just runtime libraries. And the binary compiled on Fedora can't run on RHEL6 because it has a versioned Fedora 24 i686:
RHEL6 i686:
|
Was your x86_64 host also EL6? I do still see the issue when cross-compiling this way. But the native x86_64 target is fine. |
Ah! I forgot to check that @cuviper. It's CO 7.3, so the answer would be no. |
Actually, that's interesting. EL7 has glibc-2.17, so it's result doesn't have that |
This works fine! |
I believe it is this binutils bug: https://sourceware.org/bugzilla/show_bug.cgi?id=12654 |
@cuviper wow that must have been quite the investigation! Does that mean if you re-link the binary without If that's the cause here then I'm not sure what we can do about it :( |
Yeah, it was fun. Kudos to @fweimer for identifying the actual fix. Here's the RHEL6 bug: So yeah, linking without There's probably some way to get rustc to use your own fixed |
Ok in that case I think I'll go ahead and close. Thanks though for the investigation @cuviper! |
FYI, the fix is in |
Thanks for the update @cuviper! |
After installing rust, I tried the sample "Hello World!" program. It compiles just fine, but when I run it, it throws a segmentation fault after the "Hello World!" output.
This happens to a local server running CentOS 6.8 x86. This issue does not occur on a CentOS 6.8 x86_64. I am not sure if this is something that has to do with my OS installation or it's related to rust.
The text was updated successfully, but these errors were encountered: