-
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
-Cdebuginfo=1 wastefully produces full type descriptions. #69074
Comments
More examples (using
pub static FOO: Option<Foo> = None;
pub fn foo() -> &'static dyn Sync {
&None::<Foo>
} However, struct {
int should_not_be_in_debug_info;
} foo; I think we should follow |
I think this is a recent regression. Do we know when it was introduced? A few months ago when I filed #64405, this wasn't the case yet. |
Ah, weird, it looked like it's been like this forever, thankfully godbolt has all stable versions so we can narrow it down quickly. In that issue you suggest we should not even be emitting It would be good to remove even more than #69080 does right now, because then we might stand a chance to ship debuginfo. Of course the ideal thing would be split DWARF and a |
Inlined calls are determined from |
That would reduce the quality of ICE backtraces reported by the average user. |
Right now we have no debuginfo at all AFAIK, but if there was an optional component we could tell people to install it. Or maybe we could take the backtrace they report, and the version, and generate the full backtrace ourselves using the right debuginfo (since all you need is addresses, right?). |
Forgot that :)
And ASLR bias I think.
It would be nice if a bot could do it. |
[triagebot] The |
I've decided, in the interest of getting something merged, to not try to do everything in #69080. Which leaves out:
|
…-a-bar, r=michaelwoerister rustc_codegen_llvm: don't generate any type debuginfo for -Cdebuginfo=1. Works towards rust-lang#69074 by adding more checks for `DebugInfo::Full` in a few places in `rustc_codegen_llvm`, bringing us in line with what `clang -g1` generates (no debuginfo types, nor debuginfo for `static`s). <hr/> My local build's (`debuginfo-level=1`, `debug-assertions=1`) `librustc_driver-*.so` went from just over 1GiB (1019MiB) down to 402MiB. It's still bad, but the `.debug_*` sections themselves (as reported by `objdump`) went from something like 853MiB down to 236MiB, i.e. roughly a 3.6x reduction. <hr/> Sadly, I don't think this is enough to justify *shipping* all of this debuginfo, but now it's more plausible that we could at least *build* with `debuginfo-level=1` *then* strip it. That would give us real backtraces for e.g. ICEs during builds, but I don't know how often that's relevant. We could also look into split DWARF, and maybe have a `rustc-debuginfo` component in `rustup`. There's also the possibility of making it slimmer by omitting parameters to functions, or perhaps some deduplication (I think right now there is no DWARF reuse across CGUs? maybe ThinLTO helps?). r? @michaelwoerister cc @rust-lang/wg-codegen @alexcrichton @Mark-Simulacrum
Visited during wg-debugging triage. There are various issues with changing what debuginfo is generated by |
This example makes
-Cdebuginfo=1
emit the variant (seegodbolt
output):Its resulting LLVM IR shows all of these DebugInfo metadata nodes:
But at
-Cdebuginfo=1
, this is really what we want to see:If this doesn't work we can always just use
DINamespace
instead.IIUC, this specific example is caused from the way we handle inherent
impl
s, but there might be others, so we probably want to make the debuginfo generating infrastructure ICE when it's trying to generate non-trivial type debuginfo but-Cdebuginfo=1
is set.Oh, and, I found this because
librustc_driver-*.so
is 1GB withdebuginfo-level=1
(anddebug-assertions=1
) inconfig.toml
, and most of that is type debuginfo.cc @rust-lang/compiler @alexcrichton
The text was updated successfully, but these errors were encountered: