From fa3a9b6f04aef7472753c612208e1d47433dd53c Mon Sep 17 00:00:00 2001 From: Franz Date: Fri, 17 Apr 2026 12:49:29 +0200 Subject: [PATCH] Prevent coredump when child process gets killed by signal. Generating a coredump here is not useful, but is relatively slow and generates a useless ~20M file every time. The child process still creates a coredump. --- src/main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 53735704d..2bb74d912 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -62,6 +62,7 @@ gb_global Timings global_timings = {0}; #else #include #include +#include #endif #include "parser.hpp" @@ -153,6 +154,8 @@ gb_internal i32 system_exec_command_line_app_internal(bool exit_on_err, char con } exit_code = system(cmd_line); if (exit_on_err && WIFSIGNALED(exit_code)) { + struct rlimit limit = { 0, 0, }; + setrlimit(RLIMIT_CORE, &limit); raise(WTERMSIG(exit_code)); } if (WIFEXITED(exit_code)) {