Skip to content
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

Teach rustc to write the ICE backtrace and query stack to disk #106691

Closed
wants to merge 6 commits into from

Conversation

estebank
Copy link
Contributor

  • On non--dev builds, always hide the backtrace and query stack.
  • Introduce RUSTC_BACKTRACE_FORCE where 1 will always print the backtrace and 0 will always hide it.

@rustbot
Copy link
Collaborator

rustbot commented Jan 10, 2023

r? @davidtwco

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 10, 2023
@estebank estebank changed the title Teach rustc to write the backtrace and query stack to disk. Teach rustc to write the ICE backtrace and query stack to disk Jan 10, 2023
@estebank
Copy link
Contributor Author

estebank commented Jan 10, 2023

For context, this is what the contents of the file looks like

rustc 1.68.0-dev running on x86_64-unknown-linux-gnu at 2023-01-10 02:37:25
compiler flags:
    -Z
    treat-err-as-bug

panicked at compiler/rustc_errors/src/lib.rs:1663:30:
aborting due to `-Z treat-err-as-bug=1`

   0: rustc_driver::write_ice_to_disk
             at ./compiler/rustc_driver/src/lib.rs:1206:19
   1: rustc_driver::DEFAULT_HOOK::{closure#0}::{closure#0}
             at ./compiler/rustc_driver/src/lib.rs:1304:44
   2: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
             at ./library/alloc/src/boxed.rs:2002:9
   3: std::panicking::rust_panic_with_hook
             at ./library/std/src/panicking.rs:692:13
8<8<8<8<8<8<8<8<8<8<8<8<8<8<8<8<
 113: std::sys::unix::thread::Thread::new::thread_start
             at ./library/std/src/sys/unix/thread.rs:108:17
 114: start_thread
             at ./nptl/./nptl/pthread_create.c:442:8
 115: clone3
             at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81


query stack during panic:
#0 [mir_borrowck] borrow-checking `<impl at f6.rs:45:1: 45:16>::foo`
#1 [analysis] running analysis passes on this crate
end of query stack

And a screenshot of a prior version of the wording, just give an idea of the visual output:

three lines of output, first saying this is an internal compiler error and a bug, the second saying where the context was written and the third with a link to github to file a ticket

@davidtwco
Copy link
Member

r=me if you're looking to land this

@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Jan 11, 2023
@estebank
Copy link
Contributor Author

@davidtwco would you mind seconding rust-lang/compiler-team#578 in that case?

@rustbot rustbot added the A-testsuite Area: The testsuite used to check the correctness of rustc label Jan 11, 2023
@bors
Copy link
Contributor

bors commented Jan 11, 2023

☔ The latest upstream changes (presumably #106730) made this pull request unmergeable. Please resolve the merge conflicts.

@bors
Copy link
Contributor

bors commented Jan 14, 2023

☔ The latest upstream changes (presumably #106822) made this pull request unmergeable. Please resolve the merge conflicts.

* On non-`-dev` builds, always hide the backtrace and query stack.
* Introduce `RUSTC_BACKTRACE_FORCE` where `1` will always print the
  backtrace and `0` will always hide it.
@rust-log-analyzer

This comment has been minimized.

@albertlarsan68

This comment was marked as off-topic.

@rustbot rustbot removed the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Jan 18, 2023
@WaffleLapkin WaffleLapkin added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 24, 2023
@jyn514 jyn514 added the D-diagnostic-infra Diagnostics: Issues that affect all diagnostics, or relate to the diagnostic machinery itself. label Apr 26, 2023
@estebank estebank closed this Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc D-diagnostic-infra Diagnostics: Issues that affect all diagnostics, or relate to the diagnostic machinery itself. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants