-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
No backtrace on windows with current rustc stable #122857
Comments
Hm, I wonder if that's due to a change in debug information being generated. Does it work if you use |
I tried |
@TheBlueMatt What about nightly? |
The reasons I can think of for a lack of symbols is:
The last case I think is the most unlikely because that should show up in our CI. The other cases are more likely caused by either a rustc or CI issue, in which case it should be reported on the rust-lang/rust repository. A possibly relevant PR I see is #121297 |
Oh yeah, the beta is a really recent nightly, right. |
Confirmed in rust-lang/backtrace-rs#594 that our CI for Windows is now broken, likely due to rustc changes. Transferring this to rust-lang/rust accordingly. |
cc @michaelwoerister sorry but it seems the combination of everything actually merging together did in fact break backtraces! |
For note it has not been confirmed in a beyond-a-shadow-of-a-doubt way that #121297 is the guilty commit. |
hmm. the remarks in rust-lang/backtrace-rs#594 (comment) removes my confidence this is a stable->beta regression and not a stable->stable regression? could it have been rust-lang/cargo#13257 instead? cc @Kobzol people were relying on these backtraces working. but should they have not been? and how do PDBs work anyways? |
Also cc @wesleywiser, as I'm wondering what the semantics of |
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-high |
I tried to cook up something in rust-lang/cargo#13630, but I'm not sure if it's the right approach. |
@michaelwoerister It seems like #115120 will take time to design but there is perhaps an interim solution that's simpler and easier to backport. We could simply make |
An alternative to rust-lang/cargo#13630 that could fix the problem could be something like this. |
I think I'd suggest something more like this. This would lead to more consistent behaviour. We could additionally skip including natvis but I'm more "meh" on that, especially if the eventual intent is for strip to have no effect on external files. |
I think it is clear by now that we don't want However, given that the current documentation of That being the case, I think we should temporarily revert Cargo's defaults when targeting |
Do not strip debuginfo by default for MSVC This PR disables the logic which enables debuginfo stripping by default in release mode (#13257) for MSVC, since it causes problems there (rust-lang/rust#122857). I'm not sure if this is the correct way to gate the logic on a specific target triple. The root of the issue is that `-Cstrip=debuginfo` currently behaves like `-Cstrip=symbols` on MSVC, which causes the original optimization to break backtraces on Windows. Ultimately, this should probably be fixed in `rustc`, but that might take some further design work, therefore a faster solution would be to just special case this in Cargo for now, and remove the special case later, once it gets fixed on the `rustc` side. Related issue: rust-lang/rust#122857
stable cargo backport is up #123105 |
@Kobzol This might impact building packages for Linux distros too. I know Arch Linux build system sets RUSTFLAGS expecting it to take effect just like CFLAGS etc does. It is exposed in the user config at |
You can still overwrite the defaut by setting |
I will remove the t-compiler nomination since a decision to fix this in cargo was reached way faster, so I guess there is not a lot to discuss right now :-) @rustbot label -I-compiler-nominated |
Discussing what rustc should do has moved to #115120 (comment) |
Windows MSVC has debuginfo in a separate file, and thus stripping provides no benefits to binary size. Given generating the .pdb file does not take that much time, and how useful they are for backtraces, you should thus always default to generating the .pdb on Windows MSVC regardless of debug vs release. This is something that was already figured out years before but I guess people just forget after a while. |
The "striping" behaviour of rustc has existed for four years now a6c2f73. I don't think Cargo was necessarily wrong to use |
And I think that PR from four years ago was wrong to do so. Someone brought up the reason that people might want to not emit PDB files on Windows (#71825 (comment)), but if you look into the linked issue (#67012) you'll see that they actually just didn't want the full path to the PDB file embedded into the binary. However, that reason was solved by a different PR fairly recently (#121297). I even stated in that issue (#67012) that Rust always emitting a PDB file was intended behavior, and yet that wasn't considered by the people in the Thus we should stop having |
This was fixed in: Nightly already landed the original cargo fix. Nightly should also be landing #115120 sometime soon (for very expansive definitions of "soon") which would allow us to revert the cargo workaround at our leisure. |
can this be closed now? |
Our CI started working again, so I assume so 🤷♂️ |
Fixes have landed on stable, beta, and nightly. Closing. |
Currently rustc beta in our CI is giving us backtraces like this with simple
cargo test
s (with Cargo.toml set foropt-level = 1
):The text was updated successfully, but these errors were encountered: