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

adjust message on non-unwinding panic #105998

Merged
merged 1 commit into from
Dec 29, 2022

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Dec 21, 2022

"thread panicked while panicking" is just plain wrong in case this is a non-unwinding panic, such as

  • a panic out of a nounwind function
  • the sanity checks we have in mem::uninitialized and mem::zeroed
  • the optional debug assertion in various unsafe std library functions

@rustbot
Copy link
Collaborator

rustbot commented Dec 21, 2022

r? @joshtriplett

(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-libs Relevant to the library team, which will review and decide on the PR/issue. labels Dec 21, 2022
@rustbot
Copy link
Collaborator

rustbot commented Dec 21, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@@ -699,7 +699,11 @@ fn rust_panic_with_hook(
// have limited options. Currently our preference is to
// just abort. In the future we may consider resuming
// unwinding or otherwise exiting the thread cleanly.
rtprintpanic!("thread panicked while panicking. aborting.\n");
if !can_unwind {
rtprintpanic!("this is a non-unwinding panic. aborting.\n");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is written from a different perspective than the unwinding case. Is that because this reads differently in context?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it? What alternative wording would preserve the same perspective?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"non-unwinding panic launched. aborting."

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see. Seems fine for me, except I don't think "launch" is usually the verb we use for panics, is it?

The docs usually seem to use "panic" as verb and not noun, so... not sure how to best use that here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am going with "thread caused non-unwinding panic." for now. Thoughts?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, that reads better to me.

@RalfJung
Copy link
Member Author

r? @thomcc

@rustbot rustbot assigned thomcc and unassigned joshtriplett Dec 28, 2022
@thomcc
Copy link
Member

thomcc commented Dec 28, 2022

LGTM
@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 28, 2022

📌 Commit b804c0d has been approved by thomcc

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 28, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 28, 2022
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#104402 (Move `ReentrantMutex` to `std::sync`)
 - rust-lang#104493 (available_parallelism: Gracefully handle zero value cfs_period_us)
 - rust-lang#105359 (Make sentinel value configurable in `library/std/src/sys_common/thread_local_key.rs`)
 - rust-lang#105497 (Clarify `catch_unwind` docs about panic hooks)
 - rust-lang#105570 (Properly calculate best failure in macro matching)
 - rust-lang#105702 (Format only modified files)
 - rust-lang#105998 (adjust message on non-unwinding panic)
 - rust-lang#106161 (Iterator::find: link to Iterator::position in docs for discoverability)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit d28ef9d into rust-lang:master Dec 29, 2022
@rustbot rustbot added this to the 1.68.0 milestone Dec 29, 2022
@RalfJung RalfJung deleted the no-unwind-panic-msg branch January 3, 2023 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants