From 29124ae4d8307bc8332b4678eb8cd4434b4bb872 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 24 Sep 2026 21:08:57 +0100 Subject: [PATCH] main: keep the crash handler building without execinfo backtrace() and execinfo.h are glibc extensions, so the crash handler fails to build against musl. Guard both the include and the body of write_backtrace, and record that the backtrace is unavailable, leaving the maps dump and the rest of the crash report intact. Signed-off-by: Daniel Golle --- src/main.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/src/main.c +++ b/src/main.c @@ -2202,7 +2202,9 @@ dump_debug_buffer_to_file (void) #include #include +#ifdef __GLIBC__ #include +#endif #define BACKTRACE_SIZE 1024 #define MAPS_SIZE 8192 @@ -2252,6 +2254,7 @@ write_maps (int output_fd) static void write_backtrace (int output_fd) { +#ifdef __GLIBC__ void *addresses[BACKTRACE_SIZE]; int number_of_addresses; @@ -2264,6 +2267,10 @@ write_backtrace (int output_fd) backtrace_symbols_fd (addresses + BACKTRACE_FRAMES_TO_SKIP, number_of_addresses - BACKTRACE_FRAMES_TO_SKIP, output_fd); +#else + write (output_fd, "backtrace: unavailable\n", + strlen ("backtrace: unavailable\n")); +#endif } static void