| ... | @@ -1784,6 +1784,7 @@ pub fn updateSegfaultHandler(act: ?*const os.Sigaction) error{OperationNotSuppor | ... | @@ -1784,6 +1784,7 @@ pub fn updateSegfaultHandler(act: ?*const os.Sigaction) error{OperationNotSuppor |
| 1784 | try os.sigaction(os.SIG.SEGV, act, null); | 1784 | try os.sigaction(os.SIG.SEGV, act, null); |
| 1785 | try os.sigaction(os.SIG.ILL, act, null); | 1785 | try os.sigaction(os.SIG.ILL, act, null); |
| 1786 | try os.sigaction(os.SIG.BUS, act, null); | 1786 | try os.sigaction(os.SIG.BUS, act, null); |
| | 1787 | try os.sigaction(os.SIG.FPE, act, null); |
| 1787 | } | 1788 | } |
| 1788 | | 1789 | |
| 1789 | /// Attaches a global SIGSEGV handler which calls @panic("segmentation fault"); | 1790 | /// Attaches a global SIGSEGV handler which calls @panic("segmentation fault"); |
| ... | @@ -1845,6 +1846,7 @@ fn handleSegfaultPosix(sig: i32, info: *const os.siginfo_t, ctx_ptr: ?*const any | ... | @@ -1845,6 +1846,7 @@ fn handleSegfaultPosix(sig: i32, info: *const os.siginfo_t, ctx_ptr: ?*const any |
| 1845 | os.SIG.SEGV => stderr.print("Segmentation fault at address 0x{x}\n", .{addr}), | 1846 | os.SIG.SEGV => stderr.print("Segmentation fault at address 0x{x}\n", .{addr}), |
| 1846 | os.SIG.ILL => stderr.print("Illegal instruction at address 0x{x}\n", .{addr}), | 1847 | os.SIG.ILL => stderr.print("Illegal instruction at address 0x{x}\n", .{addr}), |
| 1847 | os.SIG.BUS => stderr.print("Bus error at address 0x{x}\n", .{addr}), | 1848 | os.SIG.BUS => stderr.print("Bus error at address 0x{x}\n", .{addr}), |
| | 1849 | os.SIG.FPE => stderr.print("Arithmetic exception at address 0x{x}\n", .{addr}), |
| 1848 | else => unreachable, | 1850 | else => unreachable, |
| 1849 | } catch os.abort(); | 1851 | } catch os.abort(); |
| 1850 | } | 1852 | } |