| ... | ... | @@ -2256,6 +2256,7 @@ pub fn attachSegfaultHandler() void { |
| 2256 | 2256 | |
| 2257 | 2257 | os.sigaction(os.SIGSEGV, &act, null); |
| 2258 | 2258 | os.sigaction(os.SIGILL, &act, null); |
| 2259 | os.sigaction(os.SIGBUS, &act, null); |
| 2259 | 2260 | } |
| 2260 | 2261 | |
| 2261 | 2262 | fn resetSegfaultHandler() void { |
| ... | ... | @@ -2273,6 +2274,7 @@ fn resetSegfaultHandler() void { |
| 2273 | 2274 | }; |
| 2274 | 2275 | os.sigaction(os.SIGSEGV, &act, null); |
| 2275 | 2276 | os.sigaction(os.SIGILL, &act, null); |
| 2277 | os.sigaction(os.SIGBUS, &act, null); |
| 2276 | 2278 | } |
| 2277 | 2279 | |
| 2278 | 2280 | fn handleSegfaultLinux(sig: i32, info: *const os.siginfo_t, ctx_ptr: *const c_void) callconv(.C) noreturn { |
| ... | ... | @@ -2285,6 +2287,7 @@ fn handleSegfaultLinux(sig: i32, info: *const os.siginfo_t, ctx_ptr: *const c_vo |
| 2285 | 2287 | switch (sig) { |
| 2286 | 2288 | os.SIGSEGV => std.debug.warn("Segmentation fault at address 0x{x}\n", .{addr}), |
| 2287 | 2289 | os.SIGILL => std.debug.warn("Illegal instruction at address 0x{x}\n", .{addr}), |
| 2290 | os.SIGBUS => std.debug.warn("Bus error at address 0x{x}\n", .{addr}), |
| 2288 | 2291 | else => unreachable, |
| 2289 | 2292 | } |
| 2290 | 2293 | switch (builtin.arch) { |