More explicative StackTrace message

This commit is contained in:
Andrea Mazzoleni 2016-01-02 12:23:48 +01:00
parent c9b97b48bf
commit b853b4c406
2 changed files with 8 additions and 0 deletions

View file

@ -264,6 +264,9 @@ void os_abort(void)
for (i=0; i<size; ++i)
printf("[bt] %02u: %p\n", i, stack[i]);
printf("Please report this error to the SnapRAID Forum:\n");
printf("https://sourceforge.net/p/snapraid/discussion/1677233/\n");
/* use exit() and not abort to avoid the Windows abort dialog */
exit(EXIT_FAILURE);
}

View file

@ -1112,6 +1112,7 @@ void os_abort(void)
char** messages;
size_t size;
unsigned i;
#endif
printf("Stacktrace of " PACKAGE " v" VERSION);
#ifdef _linux
@ -1124,6 +1125,7 @@ void os_abort(void)
printf(", PATH_MAX=%d", PATH_MAX);
printf("\n");
#if HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS
size = backtrace(stack, 32);
messages = backtrace_symbols(stack, size);
@ -1150,6 +1152,9 @@ void os_abort(void)
}
#endif
printf("Please report this error to the SnapRAID Forum:\n");
printf("https://sourceforge.net/p/snapraid/discussion/1677233/\n");
abort();
}