-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Add more info to an ICE message #32371
Conversation
r? @Aatch (rust_highfive has picked a reviewer for you, use r? to override) |
In theory if this is an internal assertion error we may want actually dump a whole bunch of information. For example we could dump things like:
We may want to even go the extra mile and emit the information into a temporary file (e.g. I guess what I'm getting at is that this probably isn't too helpful for readers of the message except during bug reports, and we could perhaps add a whole lot more contextual information to bug reports by default as well (without streaming it all to the console). cc @rust-lang/compiler |
☔ The latest upstream changes (presumably #32369) made this pull request unmergeable. Please resolve the merge conflicts. |
My impression was we don't suffer from a lack of information in a bug report that often. Instead I tend to see we cry for "Minimal case! Minimal reproducible test case!". So I'm not sure if a support for a rich crash report really helps the project. By the way, as someone who gets paid by working for a proprietary software project, I'm not very comfortable with pastebin-like services.
Actually the "verbose" mode essentially adds the host triple only... Anyways this is straightforward.
Minimal change to
What prevents us from hardcoding a full backtrace? Performance hit? I think we can improve |
No, in the general case it's risking bugs in the libbacktrace code that may not be avoidable (other than by having |
Yeah it's certainly slow to produce a backtrace, but that doesn't matter much as we're just doing it whenever an error is generated. I wouldn't recommend re-running the closure to the |
I would be wary about dumping a tonne of info for an ICE by default. As a user experience, hitting an ICE is bad enough already, we really shouldn't make it worse by flooding the console with info. The majority of users are passive and will not report the bug, they are just quietly annoyed by it and dumping more info (esp. a backtrace) will just make them more annoyed. If we do this (and it seems like a good idea) we could perhaps do it by default on nightly and with a flag or env var on other channels (changing the "run with On this actual PR, I don't feel strongly either way. |
The new ICE message will look like
This patch adds version, host and arguments fields. I'll address the backtrace issue in a separate commit. |
The new ICE message will look like $ rustc -O /tmp/nodakai/ice.rs error: internal compiler error: unexpected panic note: the compiler unexpectedly panicked. this is a bug. note: we would appreciate a bug report: note: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports note: version: 1.9.0-dev (1437edb98 2016-03-22) note: host: x86_64-unknown-linux-gnu note: arguments: ["rustc", "-O", "/tmp/nodakai/ice.rs"] note: run with `RUST_BACKTRACE=1` for a backtrace thread 'rustc' panicked at 'impossible range in AST', src/librustc_front/lowering.rs:1292 note: Run with `RUST_BACKTRACE=1` for a backtrace. Signed-off-by: NODA, Kai <[email protected]>
The tools team discussed this during triage yesterday, and the conclusion was that we like the idea here but probably want to tweak it. The key point we realized is that we don't want to pollute the ICE message on the console more than it is already today, but we probably want to perhaps dump more information somewhere. Along those lines, we envisioned something like:
That should help give us more information "by default" without polluting the terminal, and it's also an nice expandable vector for adding more information in the future. How's that sound @nodakai? |
Sounds good, I'll work on a new patch. Let me take this opportunity to fix this discouragingly lengthy URL At least it should be https://www.rust-lang.org/contribute.html and ideally just |
☔ The latest upstream changes (presumably #32773) made this pull request unmergeable. Please resolve the merge conflicts. |
Closing due to inactivity, but feel free to resubmit with a rebase! |
The new message looks like
Wonder if the version string should appear the first. Any suggestions?