| ... | ... | @@ -1764,13 +1764,15 @@ fn handleSegfaultLinux(sig: i32, info: *const os.siginfo_t, ctx_ptr: ?*const c_v |
| 1764 | 1764 | }; |
| 1765 | 1765 | |
| 1766 | 1766 | // Don't use std.debug.print() as stderr_mutex may still be locked. |
| 1767 | | const stderr = io.getStdErr().writer(); |
| 1768 | | _ = switch (sig) { |
| 1769 | | os.SIGSEGV => stderr.print("Segmentation fault at address 0x{x}\n", .{addr}), |
| 1770 | | os.SIGILL => stderr.print("Illegal instruction at address 0x{x}\n", .{addr}), |
| 1771 | | os.SIGBUS => stderr.print("Bus error at address 0x{x}\n", .{addr}), |
| 1772 | | else => unreachable, |
| 1773 | | } catch os.abort(); |
| 1767 | nosuspend { |
| 1768 | const stderr = io.getStdErr().writer(); |
| 1769 | _ = switch (sig) { |
| 1770 | os.SIGSEGV => stderr.print("Segmentation fault at address 0x{x}\n", .{addr}), |
| 1771 | os.SIGILL => stderr.print("Illegal instruction at address 0x{x}\n", .{addr}), |
| 1772 | os.SIGBUS => stderr.print("Bus error at address 0x{x}\n", .{addr}), |
| 1773 | else => unreachable, |
| 1774 | } catch os.abort(); |
| 1775 | } |
| 1774 | 1776 | |
| 1775 | 1777 | switch (builtin.arch) { |
| 1776 | 1778 | .i386 => { |
| ... | ... | @@ -1823,13 +1825,15 @@ fn handleSegfaultWindowsExtra(info: *windows.EXCEPTION_POINTERS, comptime msg: u |
| 1823 | 1825 | if (@hasDecl(windows, "CONTEXT")) { |
| 1824 | 1826 | const regs = info.ContextRecord.getRegs(); |
| 1825 | 1827 | // Don't use std.debug.print() as stderr_mutex may still be locked. |
| 1826 | | const stderr = io.getStdErr().writer(); |
| 1827 | | _ = switch (msg) { |
| 1828 | | 0 => stderr.print("{s}\n", .{format.?}), |
| 1829 | | 1 => stderr.print("Segmentation fault at address 0x{x}\n", .{info.ExceptionRecord.ExceptionInformation[1]}), |
| 1830 | | 2 => stderr.print("Illegal instruction at address 0x{x}\n", .{regs.ip}), |
| 1831 | | else => unreachable, |
| 1832 | | } catch os.abort(); |
| 1828 | nosuspend { |
| 1829 | const stderr = io.getStdErr().writer(); |
| 1830 | _ = switch (msg) { |
| 1831 | 0 => stderr.print("{s}\n", .{format.?}), |
| 1832 | 1 => stderr.print("Segmentation fault at address 0x{x}\n", .{info.ExceptionRecord.ExceptionInformation[1]}), |
| 1833 | 2 => stderr.print("Illegal instruction at address 0x{x}\n", .{regs.ip}), |
| 1834 | else => unreachable, |
| 1835 | } catch os.abort(); |
| 1836 | } |
| 1833 | 1837 | |
| 1834 | 1838 | dumpStackTraceFromBase(regs.bp, regs.ip); |
| 1835 | 1839 | os.abort(); |