]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
ggml : add option to not print stack on abort (ggml/1081)
authorWilliam Tambellini <redacted>
Thu, 23 Jan 2025 19:59:08 +0000 (11:59 -0800)
committerGeorgi Gerganov <redacted>
Mon, 3 Feb 2025 20:00:57 +0000 (22:00 +0200)
* Add option to not print stack on abort

Add option/envvar to disable stack printing on abort.
Also link some unittests with Threads to fix link errors on
ubuntu/g++11.

* Update ggml/src/ggml.c

---------

Co-authored-by: Diego Devesa <redacted>
ggml/src/ggml.c

index da5b817e1563785bbc9ffa48e559019c5d8b5c63..ae8147dd7d2f7af7650c071389624351aa0c95d4 100644 (file)
@@ -128,6 +128,10 @@ static void ggml_print_backtrace_symbols(void) {
 #endif
 
 static void ggml_print_backtrace(void) {
+    const char * GGML_NO_BACKTRACE = getenv("GGML_NO_BACKTRACE");
+    if (GGML_NO_BACKTRACE) {
+        return;
+    }
     char attach[32];
     snprintf(attach, sizeof(attach), "attach %d", getpid());
     int pid = fork();