Spaces:
Running
Running
William Tambellini
Diego Devesa
commited on
Commit
·
9b2706e
1
Parent(s):
8e57313
ggml : add option to not print stack on abort (ggml/1081)
Browse files* 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 <[email protected]>
- ggml/src/ggml.c +4 -0
ggml/src/ggml.c
CHANGED
|
@@ -128,6 +128,10 @@ static void ggml_print_backtrace_symbols(void) {
|
|
| 128 |
#endif
|
| 129 |
|
| 130 |
static void ggml_print_backtrace(void) {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
char attach[32];
|
| 132 |
snprintf(attach, sizeof(attach), "attach %d", getpid());
|
| 133 |
int pid = fork();
|
|
|
|
| 128 |
#endif
|
| 129 |
|
| 130 |
static void ggml_print_backtrace(void) {
|
| 131 |
+
const char * GGML_NO_BACKTRACE = getenv("GGML_NO_BACKTRACE");
|
| 132 |
+
if (GGML_NO_BACKTRACE) {
|
| 133 |
+
return;
|
| 134 |
+
}
|
| 135 |
char attach[32];
|
| 136 |
snprintf(attach, sizeof(attach), "attach %d", getpid());
|
| 137 |
int pid = fork();
|