Skip to content

std panicking implementation comments suggest we might make double-panic not abort #98953

@CAD97

Description

@CAD97

if panics > 1 || !can_unwind {
// If a thread panics while it's already unwinding then we
// 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");
crate::sys::abort_internal();
}

At this point, I think we've effectively guaranteed in practice that a panicking while already unwinding leads to a full-process abort, and changing this to attempt to unwind the inner panic or even just to abort the thread but not the whole process is likely far to breaking. We're even considering making unwinds from drops always abort, though AIUI this cannot replace the panic while unwinding immediate abort check.

Best guess at appropriate labels...

@rustbot modify labels +T-compiler +T-lang +C-cleanup +A-technical-debt

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-technical-debtArea: Internal cleanup workC-cleanupCategory: PRs that clean code up or issues documenting cleanup.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions