From e2332a8f56e3f66beb85a5382c7f1d6235b1ef3d Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Tue, 1 Jul 2025 16:57:42 +0200 Subject: [PATCH 1/2] fix: don't hook SIGTRAP in crash handler --- src/backtrace.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/backtrace.cpp b/src/backtrace.cpp index 05cffcd..e537f6a 100644 --- a/src/backtrace.cpp +++ b/src/backtrace.cpp @@ -93,7 +93,6 @@ static void install_crash_handler(void (*hdlr)(int, siginfo_t *, void *)) { sigaction(SIGBUS, &action, nullptr); sigaction(SIGSEGV, &action, nullptr); sigaction(SIGABRT, &action, nullptr); - sigaction(SIGTRAP, &action, nullptr); sigaction(SIGFPE, &action, nullptr); } } // namespace From 829a8d33e92988a51a8c51d204ec766a28c7903d Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Tue, 1 Jul 2025 16:58:39 +0200 Subject: [PATCH 2/2] feat: export additional crash handlers to zig --- src/thespian.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/thespian.zig b/src/thespian.zig index 5a5c80f..3cf2069 100644 --- a/src/thespian.zig +++ b/src/thespian.zig @@ -18,6 +18,8 @@ pub var stack_trace_on_errors: bool = false; pub const subprocess = if (builtin.os.tag == .windows) @import("subprocess_windows.zig") else @import("subprocess.zig"); pub const install_debugger = c.install_debugger; +pub const install_backtrace = c.install_backtrace; +pub const install_jitdebugger = c.install_jitdebugger; pub const max_message_size = 8 * 4096; const message_buf_allocator = std.heap.c_allocator; threadlocal var message_buffer: std.ArrayList(u8) = std.ArrayList(u8).init(message_buf_allocator);