From 485da9fd358eb17ba0a659a554f44be6c72efd2e Mon Sep 17 00:00:00 2001 From: Daniel Hiltgen Date: Tue, 18 Nov 2025 16:33:33 -0800 Subject: [PATCH] win: exit instead of abort (#13138) Calling abort on windows triggers the C++ runtime to attempt a debugger attach, which causes the crashed runners to hang instead of exit, leading to a timeout instead of a fast failure during discovery. --- .../0036-win-exit-instead-of-abort.patch | 28 +++++++++++++++++++ ml/backend/ggml/ggml/src/ggml.c | 7 ++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 llama/patches/0036-win-exit-instead-of-abort.patch diff --git a/llama/patches/0036-win-exit-instead-of-abort.patch b/llama/patches/0036-win-exit-instead-of-abort.patch new file mode 100644 index 00000000..ab78d631 --- /dev/null +++ b/llama/patches/0036-win-exit-instead-of-abort.patch @@ -0,0 +1,28 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Hiltgen +Date: Tue, 18 Nov 2025 09:58:23 -0800 +Subject: [PATCH] win: exit instead of abort + +--- + ggml/src/ggml.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/ggml/src/ggml.c b/ggml/src/ggml.c +index 9be35c1be..923c33d05 100644 +--- a/ggml/src/ggml.c ++++ b/ggml/src/ggml.c +@@ -229,8 +229,13 @@ void ggml_abort(const char * file, int line, const char * fmt, ...) { + fprintf(stderr, "%s\n", message); + ggml_print_backtrace(); + } +- ++#if defined(_WIN32) ++ fflush(stderr); ++ fflush(stdout); ++ exit(1); ++#else + abort(); ++#endif + } + + // ggml_print_backtrace is registered with std::set_terminate by ggml.cpp diff --git a/ml/backend/ggml/ggml/src/ggml.c b/ml/backend/ggml/ggml/src/ggml.c index 9be35c1b..923c33d0 100644 --- a/ml/backend/ggml/ggml/src/ggml.c +++ b/ml/backend/ggml/ggml/src/ggml.c @@ -229,8 +229,13 @@ void ggml_abort(const char * file, int line, const char * fmt, ...) { fprintf(stderr, "%s\n", message); ggml_print_backtrace(); } - +#if defined(_WIN32) + fflush(stderr); + fflush(stdout); + exit(1); +#else abort(); +#endif } // ggml_print_backtrace is registered with std::set_terminate by ggml.cpp