Launch a non-unwinding panic for misaligned pointer deref#112599
Launch a non-unwinding panic for misaligned pointer deref#112599bors merged 1 commit intorust-lang:masterfrom
Conversation
library/core/src/panicking.rs
Outdated
There was a problem hiding this comment.
We should also make this function #[rustc_nounwind] and document that this function MUST NOT unwind.
I wouldn't worry about non-local dependency that you mentioned at #112403 (comment), since this is a lang item and it's expected that lang item may need special guarantees. A #[rustc_nounwind] just near the lang item attribute with a comment should be clear enough to prevent mistakes.
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
|
☔ The latest upstream changes (presumably #112681) made this pull request unmergeable. Please resolve the merge conflicts. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
This looks fine to me. @bors r+ |
Launch a non-unwinding panic for misaligned pointer deref This panic already never unwinds, but that's only because it always hits the unwind guard that's created by our `UnwindAction::Terminate`. Hitting the unwind guard generates a huge double-panic backtrace. Now we generate a normal-looking panic message when this check is hit. r? `@thomcc`
|
☀️ Test successful - checks-actions |
|
Finished benchmarking commit (0c2c243): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 655.45s -> 656.801s (0.21%) |
| } else { | ||
| UnwindAction::Unreachable | ||
| }, | ||
| // The panic symbol that this calls is #[rustc_nounwind]. We never want to insert an |
There was a problem hiding this comment.
Would be good to mention panic_misaligned_pointer_dereference here so one can grep for what that symbol is. (I was not aware/forgot that different AssertKind dispatch to completely different code on assertion failure.)
…fJung Mention the panic function in CheckAlignment Per rust-lang#112599 (comment) r? `@RalfJung`
This panic already never unwinds, but that's only because it always hits the unwind guard that's created by our
UnwindAction::Terminate. Hitting the unwind guard generates a huge double-panic backtrace. Now we generate a normal-looking panic message when this check is hit.r? @thomcc