Uh oh!
There was an error while loading. Please reload this page.
Revert "Work around invalid DWARF bugs for fat LTO" - #95685
Conversation
rust-highfive
commented
Apr 5, 2022
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @compiler-errors (or someone else) soon. Please see the contribution instructions for more information. |
compiler-errors
commented
Apr 5, 2022
r? @pnkfelix since you self-assigned the attached issue (and I know very little about codegen) |
jyn514
commented
Apr 5, 2022
@cbiffle do you think you could add tests for this in src/test/debuginfo so it doesn't regress again? |
cbiffle
commented
Apr 5, 2022
Happy to give it a shot! A modification to Is it worth attempting to matrix the debug tests across different build settings so that there aren't omissions like this? |
Since September, the toolchain has not been generating reliable DWARF information for static variables when LTO is on. This has affected projects in the embedded space where the use of LTO is typical. In our case, it has kept us from bumping past the 2021-09-22 nightly toolchain lest our debugger break. This has been a pretty dramatic regression for people using debuggers and static variables. See rust-lang#90357 for more info and a repro case. This commit is a mechanical revert of d5de680 from PR rust-lang#89041, which caused the issue. (Note on that PR that the commit's author has requested it be reverted.) I have locally verified that this fixesrust-lang#90357 by restoring the functionality of both the repro case I posted on that bug, and debugger behavior on real programs. There do not appear to be test cases for this in the toolchain; if I've missed them, point me at 'em and I'll update them.
68800da to
3f48e92CompareSo, there were some tests that would have caught this, except that (1) they were "temporarily" disabled in 2018 and (2) they were using the wrong build configuration. Altering
I've added a commit to this PR that re-enables the test and adds a duplicate of it using LTO. Both tests pass with this PR; the LTO test fails without it, reproducing the bug. I admit I don't understand the circumstances that led to these tests being disabled in #47155, so I don't know for sure that simply turning them back on and fixing the decay is the right answer. Also, if there is a way to matrix a single test case in multiple build configurations rather than copy-pasta, please let me know. |
cbiffle
commented
Apr 5, 2022
Also, for what it's worth, I've managed to update and re-enable 16 debuginfo tests, some simply by turning them back on, some by updating rotten assertions about GDB's output. It looks like there's been some regression in lldb's output in some cases, unrelated to rustc's DWARF generation, so in some cases I've left them disabled for lldb. If there's interest in this change I can create a followup PR. |
jyn514
commented
Apr 5, 2022
That sounds amazing! |
compiler-errors
commented
Apr 5, 2022
cbiffle
commented
Apr 5, 2022
Slick. That's almost exactly what I wanted. Unfortunately, any attempt to use |
- Re-enabled basic-types-globals which has been disabled since 2018 - Updated its now-rotted assertions about GDB's output to pass - Rewrote header comment describing some previous state of GDB behavior that didn't match either the checked-in assertions _or_ the current behavior, and so I assume has just been wrong for some time. - Copy-pasta'd the test into a version that uses LTO to check for regression on rust-lang#90357, because I don't see a way to matrix the same test into several build configurations.
3f48e92 to
42af197Comparecbiffle
commented
Apr 5, 2022
Posted as a draft in #95696 . It's based on top of this PR for my convenience. If it seems like this PR is going to be controversial I can rebase and separate them. |
cbiffle
commented
Apr 11, 2022
Hi! Is anybody looking at this? Can I do anything to facilitate? Thanks! |
pnkfelix
commented
Apr 14, 2022
Hi @cbiffle , I'm looking at it now. Hopefully will merge soon. |
pnkfelix
commented
Apr 14, 2022
This is pretty easy justification for a revert here. :) Thanks @cbiffle ! @bors r+ rollup |
bors
commented
Apr 14, 2022
📌 Commit 42af197 has been approved by |
… r=pnkfelix Revert "Work around invalid DWARF bugs for fat LTO" Since September, the toolchain has not been generating reliable DWARF information for static variables when LTO is on. This has affected projects in the embedded space where the use of LTO is typical. In our case, it has kept us from bumping past the 2021-09-22 nightly toolchain lest our debugger break. This has been a pretty dramatic regression for people using debuggers and static variables. See rust-lang#90357 for more info and a repro case. This commit is a mechanical revert of d5de680 from PR rust-lang#89041, which caused the issue. (Note on that PR that the commit's author has requested it be reverted.) I have locally verified that this fixesrust-lang#90357 by restoring the functionality of both the repro case I posted on that bug, and debugger behavior on real programs. There do not appear to be test cases for this in the toolchain; if I've missed them, point me at 'em and I'll update them.
… r=pnkfelix Revert "Work around invalid DWARF bugs for fat LTO" Since September, the toolchain has not been generating reliable DWARF information for static variables when LTO is on. This has affected projects in the embedded space where the use of LTO is typical. In our case, it has kept us from bumping past the 2021-09-22 nightly toolchain lest our debugger break. This has been a pretty dramatic regression for people using debuggers and static variables. See rust-lang#90357 for more info and a repro case. This commit is a mechanical revert of d5de680 from PR rust-lang#89041, which caused the issue. (Note on that PR that the commit's author has requested it be reverted.) I have locally verified that this fixesrust-lang#90357 by restoring the functionality of both the repro case I posted on that bug, and debugger behavior on real programs. There do not appear to be test cases for this in the toolchain; if I've missed them, point me at 'em and I'll update them.
GrantM11235
commented
Apr 30, 2022
What is the status of this PR? Does bors need to try again? |
jyn514
commented
May 1, 2022
@GrantM11235 it failed the multiplatform tests - someone (presumably @cbiffle, although other people can take it over if they don't have time) needs to figure out why and fix the tests. |
cbiffle
commented
May 17, 2022
@jyn514 I'd like to help however I can, but I don't understand the failure these hit. |
cbiffle
commented
Jun 1, 2022
@pnkfelix or anyone else, do you understand the build failure here? We're getting increasingly far behind the rust-embedded ecosystem because they're using features that became available after DWARF generation broke, whereas we require DWARF generation. I'd like to do what I can to move this along but my fix works on the platforms I have access to. |
nikic
commented
Jun 1, 2022
The build failure is because the newly reenabled tests fail. It looks like #95138 also tried to reenable gdb tests, but also ran into failures. Most likely, these don't work under gdb 7, but work under some newer version. You could try adding a min-gdb-version annotation. |
JohnCSimon
commented
Jul 3, 2022
Ping from triage: |
@rustbot ready Spoke w/ @cbiffle to help get this landed. I updated the test to include a minimum GDB version. The CI job linked above that failed was using While this does mean it won't be run on some of the CI machines, we already have a number of tests that specify a minimum GDB version of anywhere from 7.7 to 10.1. This should still give us some coverage (e.g. |
jyn514
commented
Jul 15, 2022
@bors r=pnkfelix rollup=never Thanks! |
bors
commented
Jul 15, 2022
bors
commented
Jul 15, 2022
⌛ Testing commit 2085d6a with merge 1d91b6bba8269b811ffc115121616b3d0d2ef43f... |
Mark-Simulacrum
commented
Jul 15, 2022
rust-log-analyzer
commented
Jul 15, 2022
bors
commented
Jul 16, 2022
bors
commented
Jul 16, 2022
☀️ Test successful - checks-actions |
rust-timer
commented
Jul 16, 2022
Finished benchmarking commit (e6c43cf): comparison url. Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
compiletest: Allow using revisions with debuginfo tests. A small wart that came up in rust-lang#95685 (comment).
Since September, the toolchain has not been generating reliable DWARF
information for static variables when LTO is on. This has affected
projects in the embedded space where the use of LTO is typical. In our
case, it has kept us from bumping past the 2021-09-22 nightly toolchain
lest our debugger break. This has been a pretty dramatic regression for
people using debuggers and static variables. See #90357 for more info
and a repro case.
This commit is a mechanical revert of
d5de680 from PR #89041, which caused
the issue. (Note on that PR that the commit's author has requested it be
reverted.)
I have locally verified that this fixes#90357 by restoring the
functionality of both the repro case I posted on that bug, and debugger
behavior on real programs. There do not appear to be test cases for this
in the toolchain; if I've missed them, point me at 'em and I'll update
them.