-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Rust 1.34 generates significantly less debug information for libstd functions vs. Rust 1.33 #60020
Comments
Some first steps that would be good here:
in any case I'm not 100% sure what priority to assign to this. Obviously we want our debug info to be high quality. But the first step is to find out whether this change was deliberate or not, and if it was deliberate, what was the issue motivating the change. |
A reasonably small testcase is:
Using
|
This is a fairly serious bug for the FF folk as it is breaking their crash report infrastructure. It would be good to do a bisection to verify if, indeed, #58208 is at fault (I don't know why that should be the case). Is there any connection between the use of Rust 2018 and debuginfo? |
I believe we don't currently use Rust 2018, as upgrading is low priority and requires fixes to our tooling |
Some investigation showed that the dropping of module names is not limited to |
I am in the process of bisecting this. |
OK, I have run into an issue that must involve some subtlety with My command for the stage2 What is going on here? Why isn't the stage2 |
Search for debuginfo in the rust section of config.toml. |
Try with the following
That should make sure that each crate of the standard library results in one object file, and that debuginfo is generated for the standard library (but not the compiler). |
Anyway, several attempts at bisection later, and I haven't been able to reproduce the issue when compiling 1.34.0 on my machine and testing against that. I must be using the wrong flags somewhere along the way. |
@froydnj have you tried using a docker image to replicate the exact form used by our builders when they make the distribution artifacts? |
This is really strange. I don't think we have support for disabling debuginfo generation, so any compiler should be able to produce it, regardless of how the compiler was built. What platform are you on? |
@froydnj Did you check if the function makes it into the staticlib at all? If it is a Rust function then |
I'll try bisecting from there; my early (mostly ignorant of how rustc works) predictions are #57675 or #57407. Maybe #57908. |
Commit bisection with That would also explain--I think--why I couldn't get the problem to reproduce locally; my It looks like LLVM enables you to tweak the linkage names emitted through the ( Paths forward that I can see:
Options 2 and 3 are a bit gross, but presumably don't run into issues of generating overly-verbose debug information, like option 4 would. |
triage: Marking P-high, but I am not sure it actually warrants that prioritization. Either @michaelwoerister or @cuviper , can one of you assign this to yourself and take charge on figuring out what we should do here? |
Assigning to myself for now. |
FWIW, I started setting the emission kind in an attempt to solve Windows debug errors, per #57675 (comment). I suggest expanding GitHub's hidden comments for more context. That didn't actually solve the problem -- needed a further LLVM fix for empty type info -- but I still think setting that kind is correct. |
unnominating; the bug is assigned and the nomination currently unwarranted. |
So, I looked into this some more and here are my findings:
My suggested course of action is to
|
rust-lang@cff075009 made LLVM emit less debuginfo when compiling with "line-tables-only". The change was essentially correct but the reduced amount of debuginfo broke a number of tools. This commit reverts the change so we get back the old behavior, until we figure out how to do this properly and give external tools to adapt to the new format. See rust-lang#60020 for more info.
…hton debuginfo: Revert to old/more verbose behavior for -Cdebuginfo=1 cff075009 made LLVM emit less debuginfo when compiling with "line-tables-only". The change was essentially correct but the reduced amount of debuginfo broke a number of tools. This commit reverts the change so we get back the old behavior, until we figure out how to do this properly and give external tools to adapt to the new format. See #60020 for more info. r? @cuviper cc @jrmuizel & @froydnj
rust-lang@cff075009 made LLVM emit less debuginfo when compiling with "line-tables-only". The change was essentially correct but the reduced amount of debuginfo broke a number of tools. This commit reverts the change so we get back the old behavior, until we figure out how to do this properly and give external tools to adapt to the new format. See rust-lang#60020 for more info.
triage: Not sure where we currently stand on this bug. @michaelwoerister , given the changes you landed in PR #61007, is this resolved now ? If not, could you point out what's changed, if anything, compared to your last comment? (Or just strikeout the |
I opened #64405 to document that our current behavior could be improved. Closing this issue. |
…oerister Extend -Cdebuginfo with new options and named aliases This is a rebase of rust-lang#83947, along with my best guess at what the new options mean. I tried to follow the LLVM source code to get a better idea but ran into quite a lot of trouble (https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/go-to-definition.20in.20src.2Fllvm-project.3F). The description for the original PR follows below. Note that the changes in this PR have already been through FCP: rust-lang#83947 (comment) Closes rust-lang#109311. Helps with rust-lang#104968. r? `@michaelwoerister` cc `@cuviper` --- The -Cdebuginfo=1 option was never line tables only and can't be due to backwards compatibility issues. This was clarified and an option for emitting line tables only was added. Additionally an option for emitting line info directives only was added, which is needed for some targets, i.e. nvptx. The debug info options should now behave similarly to clang's debug info options. Fix rust-lang#60020 Fix rust-lang#64405
Extend -Cdebuginfo with new options and named aliases This is a rebase of rust-lang/rust#83947, along with my best guess at what the new options mean. I tried to follow the LLVM source code to get a better idea but ran into quite a lot of trouble (https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/go-to-definition.20in.20src.2Fllvm-project.3F). The description for the original PR follows below. Note that the changes in this PR have already been through FCP: rust-lang/rust#83947 (comment) Closes rust-lang/rust#109311. Helps with rust-lang/rust#104968. r? `@michaelwoerister` cc `@cuviper` --- The -Cdebuginfo=1 option was never line tables only and can't be due to backwards compatibility issues. This was clarified and an option for emitting line tables only was added. Additionally an option for emitting line info directives only was added, which is needed for some targets, i.e. nvptx. The debug info options should now behave similarly to clang's debug info options. Fix rust-lang/rust#60020 Fix rust-lang/rust#64405
…-Simulacrum bootstrap: Don't override `debuginfo-level = 1` to mean `line-tables-only` This has real differences in the effective debuginfo: in particular, it omits the module-level information and makes perf less useful (it can't distinguish "self" from "child" time anymore). Allow passing `line-tables-only` directly in config.toml instead. See https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/debuginfo.20in.20try.20builds/near/365090631 and https://rust-lang.zulipchat.com/#narrow/stream/238009-t-compiler.2Fmeetings/topic/.5Bsteering.5D.202023-06-09/near/364883519 for more discussion. This effectively reverts the cargo half of rust-lang#110221 to avoid regressing rust-lang#60020 again in 1.72.
A Firefox developer filed a bug report about Rust symbols not being correctly represented in crash reports:
The expectation was that, e.g.
rust_panic_with_hook
would have beenstd::panicking::rust_panic_with_hook
.We had recently upgraded to Rust 1.34, which led to comparing object files before and after the upgrade. I compared Linux x86-64 binaries; I don't see why the analysis doesn't apply to OS X's Mach-O files, but it's possible the results are different there. (The above crash is from OS X, and we have crashes using Rust 1.33 that do display
std::panicking::rust_panic_with_hook
and similar.) The ELF symbol table in both cases listsrust_panic_with_hook
as_ZN3std9panicking20rust_panic_with_hook$UNIQUE_ID
, so that wasn't the problem.We then looked at the debug information. Rust 1.33 generated, according to
readelf --debug-dump=info
:Notice the existence of both
DW_AT_name
andDW_AT_linkage_name
. Rust 1.34, in contrast, generated:which drops the
DW_AT_linkage_name
and is also significantly less informative than its predecessor.I'm not familiar enough with
rustc
to know what might have caused this regression. One of my colleagues pointed out #58208, which changed how various bits of panic infrastructure are imported intolibstd
. It's not clear to me whether it's that specific change, or how the compiler internally describescrate::
symbols to LLVM, or something else entirely.cc @glandium @michaelwoerister
The text was updated successfully, but these errors were encountered: