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

Store ICE backtraces to disk and point end users at the file location #578

Closed
1 of 3 tasks
estebank opened this issue Jan 11, 2023 · 6 comments
Closed
1 of 3 tasks
Labels
major-change A proposal to make a major change to rustc major-change-accepted A major change proposal that was accepted T-compiler Add this label so rfcbot knows to poll the compiler team

Comments

@estebank
Copy link

estebank commented Jan 11, 2023

Proposal

Modify rustc's panic handler to always store ICE backtraces and the query stack, as well as other minimal debugging-relevant information (platform, rustc version) to a file on disk. Modify the presented output to be less intrusive (we would no longer print out a wall of inscrutable text unless RUSTC_BACKTRACE=full is set and hope people notice the instructions) and include instructions on how to find the file and submit a ticket. When RUSTC_BACKTRACE=full isn't set and a backtrace wouldn't be printed, we'd print the backtrace to disk.

Mentors or Reviewers

@estebank

Process

The main points of the Major Change Process are as follows:

  • File an issue describing the proposal.
  • A compiler team member or contributor who is knowledgeable in the area can second by writing @rustbot second.
    • Finding a "second" suffices for internal changes. If however, you are proposing a new public-facing feature, such as a -C flag, then full team check-off is required.
    • Compiler team members can initiate a check-off via @rfcbot fcp merge on either the MCP or the PR.
  • Once an MCP is seconded, the Final Comment Period begins. If no objections are raised after 10 days, the MCP is considered approved.

You can read more about Major Change Proposals on forge.

Comments

I've created a draft PR to experiment on what was technically feasible and I am satisfied with the results.

@estebank estebank added T-compiler Add this label so rfcbot knows to poll the compiler team major-change A proposal to make a major change to rustc labels Jan 11, 2023
@rustbot
Copy link
Collaborator

rustbot commented Jan 11, 2023

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

cc @rust-lang/compiler @rust-lang/compiler-contributors

@compiler-errors
Copy link
Member

@rustbot second

@rustbot rustbot added the final-comment-period The FCP has started, most (if not all) team members are in agreement label Jan 11, 2023
@compiler-errors
Copy link
Member

Hm, well seems like there's a bit more discussion in the zulip thread. Perhaps we should pause this MCP for now, at least until discussion has settled?

@apiraino
Copy link
Contributor

@compiler-errors No problem, I'll tentatively revert the FCP until the discussion settles. Please feel free to second again (or anyone else) later on.

@rustbot label -final-comment-period

@rustbot rustbot removed the final-comment-period The FCP has started, most (if not all) team members are in agreement label Jan 12, 2023
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Jan 12, 2023
@oli-obk
Copy link
Contributor

oli-obk commented Feb 9, 2023

@rustbot second

@rustbot rustbot added the final-comment-period The FCP has started, most (if not all) team members are in agreement label Feb 9, 2023
@apiraino
Copy link
Contributor

apiraino commented Mar 1, 2023

@rustbot label -final-comment-period +major-change-accepted

@apiraino apiraino closed this as completed Mar 1, 2023
@rustbot rustbot added major-change-accepted A major change proposal that was accepted to-announce Announce this issue on triage meeting and removed final-comment-period The FCP has started, most (if not all) team members are in agreement labels Mar 1, 2023
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Mar 23, 2023
estebank added a commit to estebank/rust that referenced this issue Jul 6, 2023
Implement rust-lang/compiler-team#578.

When an ICE is encountered on nightly releases, the new rustc panic
handler will also write the contents of the backtrace to disk. If any
`delay_span_bug`s are encountered, their backtrace is also added to the
file. The platform and rustc version will also be collected.
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Jul 7, 2023
On nightly, dump ICE backtraces to disk

Implement rust-lang/compiler-team#578.

When an ICE is encountered on nightly releases, the new rustc panic handler will also write the contents of the backtrace to disk. If any `delay_span_bug`s are encountered, their backtrace is also added to the file. The platform and rustc version will also be collected.

<img width="1032" alt="Screenshot 2023-03-03 at 2 13 25 PM" src="https://user-images.githubusercontent.com/1606434/222842420-8e039740-4042-4563-b31d-599677171acf.png">

The current behavior will *always* write to disk on nightly builds, regardless of whether the backtrace is printed to the terminal, unless the environment variable `RUSTC_ICE_DISK_DUMP` is set to `0`. This is a compromise and can be changed.
estebank added a commit to estebank/rust that referenced this issue Jul 19, 2023
Implement rust-lang/compiler-team#578.

When an ICE is encountered on nightly releases, the new rustc panic
handler will also write the contents of the backtrace to disk. If any
`delay_span_bug`s are encountered, their backtrace is also added to the
file. The platform and rustc version will also be collected.
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 20, 2023
On nightly, dump ICE backtraces to disk

Implement rust-lang/compiler-team#578.

When an ICE is encountered on nightly releases, the new rustc panic handler will also write the contents of the backtrace to disk. If any `delay_span_bug`s are encountered, their backtrace is also added to the file. The platform and rustc version will also be collected.

<img width="1032" alt="Screenshot 2023-03-03 at 2 13 25 PM" src="https://user-images.githubusercontent.com/1606434/222842420-8e039740-4042-4563-b31d-599677171acf.png">

The current behavior will *always* write to disk on nightly builds, regardless of whether the backtrace is printed to the terminal, unless the environment variable `RUSTC_ICE_DISK_DUMP` is set to `0`. This is a compromise and can be changed.
flip1995 pushed a commit to flip1995/rust-clippy that referenced this issue Jul 28, 2023
Implement rust-lang/compiler-team#578.

When an ICE is encountered on nightly releases, the new rustc panic
handler will also write the contents of the backtrace to disk. If any
`delay_span_bug`s are encountered, their backtrace is also added to the
file. The platform and rustc version will also be collected.
compiler-errors pushed a commit to compiler-errors/rustfmt that referenced this issue Oct 13, 2023
Implement rust-lang/compiler-team#578.

When an ICE is encountered on nightly releases, the new rustc panic
handler will also write the contents of the backtrace to disk. If any
`delay_span_bug`s are encountered, their backtrace is also added to the
file. The platform and rustc version will also be collected.
thomcc pushed a commit to tcdi/postgrestd that referenced this issue Oct 17, 2023
Implement rust-lang/compiler-team#578.

When an ICE is encountered on nightly releases, the new rustc panic
handler will also write the contents of the backtrace to disk. If any
`delay_span_bug`s are encountered, their backtrace is also added to the
file. The platform and rustc version will also be collected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major-change A proposal to make a major change to rustc major-change-accepted A major change proposal that was accepted T-compiler Add this label so rfcbot knows to poll the compiler team
Projects
None yet
Development

No branches or pull requests

5 participants