X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/39b6ed28636c4d67a0127d8526bf10dbc212cdc9..9a444de20a7545d1c3d10bd242f317febded25c4:/src/xbt/backtrace_linux.c diff --git a/src/xbt/backtrace_linux.c b/src/xbt/backtrace_linux.c index e57e486018..e4eda28d87 100644 --- a/src/xbt/backtrace_linux.c +++ b/src/xbt/backtrace_linux.c @@ -28,6 +28,12 @@ void xbt_backtrace_postexit(void) void xbt_backtrace_current(xbt_ex_t * e) { e->used = backtrace((void **) e->bt, XBT_BACKTRACE_SIZE); + if (e->used == 0) { + fprintf(stderr, "The backtrace() function failed, which probably means that the memory is exhausted. Here is a crude dump of the exception that I was trying to build:"); + fprintf(stderr, "%s:%s(%d) [%s:%d] %s", e->host,e->procname,e->pid, e->file,e->line,e->msg); + fprintf(stderr, "Bailing out now since there is nothing I can do without a decent amount of memory. Please go fix the memleaks\n"); + exit(1); + } }