| ... | @@ -532,6 +532,10 @@ pub fn defaultPanic(msg: []const u8, first_trace_addr: ?usize) noreturn { | ... | @@ -532,6 +532,10 @@ pub fn defaultPanic(msg: []const u8, first_trace_addr: ?usize) noreturn { |
| 532 | else => {}, | 532 | else => {}, |
| 533 | } | 533 | } |
| 534 | | 534 | |
| | 535 | // Don't try to cancel during a panic. No need to re-enable cancelation, |
| | 536 | // because the panic handler doesn't return. |
| | 537 | _ = std.Options.debug_io.swapCancelProtection(.blocked); |
| | 538 | |
| 535 | if (enable_segfault_handler) { | 539 | if (enable_segfault_handler) { |
| 536 | // If a segfault happens while panicking, we want it to actually segfault, not trigger | 540 | // If a segfault happens while panicking, we want it to actually segfault, not trigger |
| 537 | // the handler. | 541 | // the handler. |
| ... | @@ -1533,6 +1537,10 @@ fn handleSegfault(addr: ?usize, name: []const u8, opt_ctx: ?CpuContextPtr) noret | ... | @@ -1533,6 +1537,10 @@ fn handleSegfault(addr: ?usize, name: []const u8, opt_ctx: ?CpuContextPtr) noret |
| 1533 | } | 1537 | } |
| 1534 | | 1538 | |
| 1535 | pub fn defaultHandleSegfault(addr: ?usize, name: []const u8, opt_ctx: ?CpuContextPtr) noreturn { | 1539 | pub fn defaultHandleSegfault(addr: ?usize, name: []const u8, opt_ctx: ?CpuContextPtr) noreturn { |
| | 1540 | // Don't try to cancel during a segfault. No need to re-enable cancelation, |
| | 1541 | // because the segfault handler doesn't return. |
| | 1542 | _ = std.Options.debug_io.swapCancelProtection(.blocked); |
| | 1543 | |
| 1536 | // There is very similar logic to the following in `defaultPanic`. | 1544 | // There is very similar logic to the following in `defaultPanic`. |
| 1537 | switch (panic_stage) { | 1545 | switch (panic_stage) { |
| 1538 | 0 => { | 1546 | 0 => { |