Skip to content

Commit

Permalink
ggml : add option to not print stack on abort (ggml/1081)
Browse files Browse the repository at this point in the history
* 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 <slarengh@gmail.com>
  • Loading branch information
2 people authored and ggerganov committed Jan 29, 2025
1 parent d2e518e commit 1a0e87d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ggml/src/ggml.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 1a0e87d

Please sign in to comment.