-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Segfault building libcore with stage1 rustc and RUSTFLAGS="-g" #15156
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've been able to reproduce this and it seems that bug is triggered by the function inlining pass. When not using |
@luqmana Thanks a lot for even bisecting LLVM, very helpful! 👍 👍 |
Somewhat related I think: http://llvm.org/viewvc/llvm-project?view=revision&revision=212205 |
…=luqmana So far, type names generated for debuginfo where a bit sketchy. It was not clearly defined when a name should be fully qualified and when not, if region parameters should be shown or not, and other things like that. This commit makes the debuginfo module responsible for creating type names instead of using `ppaux::ty_to_str()` and brings type names (as they show up in the DWARF information) in line with GCC and Clang: * The name of the type being described is unqualified. It's path is defined by its position in the namespace hierarchy. * Type arguments are always fully qualified, no matter if they would actually be in scope at the type definition location. Care is also taken to make type names consistent across crate boundaries. That is, the code now tries make the type name the same, regardless if the type is in the local crate or reconstructed from metadata. Otherwise LLVM will complain about violating the one-definition-rule when using link-time-optimization. This commit also removes all source location information from type descriptions because these cannot be reconstructed for types instantiated from metadata. Again, with LTO enabled, this can lead to two versions of the debuginfo type description, one with and one without source location information, which then triggers the LLVM ODR assertion. Fortunately, source location information about types is rarely used, so this has little impact. Once source location information is preserved in metadata (#1972) it can also be re-enabled for type descriptions. `RUSTFLAGS=-g make check` no works again for me locally, including the LTO test cases (note that I've taken care of #15156 by reverting the change in LLVM that @luqmana identified as the culprit for that issue).
The work on this area on the LLVM side is ongoing: |
I just tested with a current version (83a8a56) and I do not get an error when running I'm always interested in the results others get when trying to compile all of Rust with debuginfo... |
Update: I'm getting a different assertion now:
Debuginfo handling in LLVM seems to be rather unstable at the moment |
FWIW, I can reproduce even without
|
@farcaller If you have |
Oh, that does explain it for me then. |
Could we ignore inline(always) if we specify -g ? Or maybe have another flag to prevent all ignoring including override inline(always)? It's an annoying bug not to have debuginfo :-( |
cc me |
As of the last LLVM update RUSTFLAGS="-g" is once again broken:
I bisected LLVM and traced it down to this commit rust-lang/llvm@503af43
Here is a backtrace:
cc @michaelwoerister
The text was updated successfully, but these errors were encountered: