-
Notifications
You must be signed in to change notification settings - Fork 13.4k
gcc's lto breaks rust's jemalloc/llvm interfaces #30178
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
After repeating the whole procedure with jemalloc |
This seems like a bug that should be filed on jemalloc? |
Probably yes; meanwhile what about rust's build system? The compiler builds without a slightest problem and even generates a working hello world! (as well as manages to build some crates) |
The jemalloc maintainter didn't give a definitive answer to my last question but it's almost certain now it wasn't about jemalloc per se. Back to you guys :) |
I suspect you're going to have issues with people saying "there's nothing actionable here" on both the jemalloc side and the Rust side... |
Let's recap:
At least that was the case two weeks ago. |
After the recent C purge I can no longer reproduce. |
Well no, still happens sometimes:
or
which yields the same trace:
|
Can you provide a full transcript of the steps you are following to exhibit this behavior? If will probably need both your configure invocation (for rustc) and whatever remaining steps you used to exhibit the bug Independently, since I am inferring that these stack traces are coming from invocations of your locally built rustc, maybe you should run |
No, I'd already stated clearly it was all about CFLAGS (-flto) when building rustc. So it should either reproduce anywhere or it's a bug in gcc. The last part about hello world is rather funny as the gdb traces were coming from regular projects' cargo builds. |
@petevine I do not understand your response to my suggestion. you have reopened the issue here, so I infer that you are not actually suggesting that you believe this to be a bug in |
Oh I see, you really are not building |
I was, how else would I be testing a rustc compiled with those flags? Rustc is able to compile crates just fine (and bootstrap itself) but the crashes happen in the |
I am just trying to understand your comments and infer why you would not run make check |
I didn't keep the build directory and I'm not going to devote the old i686 hardware I rarely use to just building/testing rust. Use a buildbot, Luke! |
After overcoming issue #30688 I was finally able to build rustc on arm (
Note the absence of anything related to jemalloc meaning other interfaces can be affected too. |
@petevine did you capture a transcript during any of these runs? It might help others who are trying to properly reproduce the problem |
You mean a build log or sth else? |
@petevine something with the sequence of commands, starting from your configure invocation (and I guess the result of invoking The output from the invocations is good to include too (which would indeed make it a build log). But the most important thing is to document all the environment options and configure switches. |
@petevine (FYI in case you were wondering, people often put such transcripts into a gist and then link to the gist from a comment, so that the comment thread does not get innundated with the wall of text that such a log can take up. and that way there is no problem with including the output from the command invocations, which is usually easier to grab via cut-and-paste...) |
Indeed - I have a little suspicion it could be related to linking against I propose setting up a travis job that would build everything (llvm!) from scratch using |
Any chance of relation to #28066 ? perhaps not since portions of this bug are gcc specific but I thought it best to cross reference the two |
see also #26541 which may or may not be related. |
Even though llvm's LTO is disabled during rust builds it's rather probable a similar problem could be exposed by LTO in either toolchain. About the ARM build that almost works - the segfaulting binary is different from all the others in that it calls the system llvm tools. Does that give you any ideas? EDIT: The unofficial arm build from yesterday produces the crashing binary as well (I never build with jemalloc on ARM so my own build is free of this issue) which is why it was easy to blame |
There's an additional adverse effect of using LTO - rustc linked with a newer Compiling minifb v0.2.7
error: linking with `cc` failed: exit code: 1
note: lto1: fatal error: bytecode stream generated with LTO version 4.0 instead of the expected 3.0 |
The downgraded jemalloc seems to have fixed this issue on |
As an experiment I had
-flto
in my CFLAGS while building rustc which didn't cause any problems.(Dec 2 nightly, i686-linux, gcc 4.9.3, local llvm 3.6)
It seems the compiler is fully functional but still I'm getting segfaults like this (in other build commands too):
If it's not a good idea to use lto flags at build-time,
configure
should definitely filter them out or at least warn the user.EDIT:
This issue is not about artifacts as it can be reproduced with empty
.cargo
and fresh project directories.The text was updated successfully, but these errors were encountered: