Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upSimple "Hello World!" throws Segmentation fault on CentOS 6.8 x86 #37874
Comments
This comment has been minimized.
This comment has been minimized.
|
I was able to confirm this in a clean |
sanxiyn
added
the
O-linux
label
Nov 21, 2016
This comment has been minimized.
This comment has been minimized.
itkovian
commented
Feb 20, 2017
|
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.
|
This comment has been minimized.
This comment has been minimized.
itkovian
commented
Feb 21, 2017
•
|
Looking a bit further, I get here
The demangled edx value on no run becomes the original value again. |
This comment has been minimized.
This comment has been minimized.
itkovian
commented
Feb 21, 2017
•
|
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? |
This comment has been minimized.
This comment has been minimized.
itkovian
commented
Feb 21, 2017
|
If it's any help, a program with an empty main gives this:
|
This comment has been minimized.
This comment has been minimized.
itkovian
commented
Feb 21, 2017
|
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. |
This comment has been minimized.
This comment has been minimized.
|
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? |
This comment has been minimized.
This comment has been minimized.
|
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:
|
This comment has been minimized.
This comment has been minimized.
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. |
This comment has been minimized.
This comment has been minimized.
itkovian
commented
Feb 23, 2017
|
Ah! I forgot to check that @cuviper. It's CO 7.3, so the answer would be no. |
This comment has been minimized.
This comment has been minimized.
|
Actually, that's interesting. EL7 has glibc-2.17, so it's result doesn't have that |
This comment has been minimized.
This comment has been minimized.
This works fine! |
This comment has been minimized.
This comment has been minimized.
|
I believe it is this binutils bug: https://sourceware.org/bugzilla/show_bug.cgi?id=12654 |
This comment has been minimized.
This comment has been minimized.
|
@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 :( |
This comment has been minimized.
This comment has been minimized.
|
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 |
This comment has been minimized.
This comment has been minimized.
|
Ok in that case I think I'll go ahead and close. Thanks though for the investigation @cuviper! |
alexcrichton
closed this
Feb 28, 2017
cuviper
referenced this issue
Mar 3, 2017
Merged
Let `-Crelocation-model` better control `-pie` linking #40245
alexcrichton
referenced this issue
Apr 18, 2017
Closed
dist-x86_64-linux: upgrade to CentOS 6 #41339
This comment has been minimized.
This comment has been minimized.
|
FYI, the fix is in |
This comment has been minimized.
This comment has been minimized.
|
Thanks for the update @cuviper! |
clytras commentedNov 19, 2016
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.