Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
don't try to compute the backtrace if we have no process name (only occure with ...
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 7 Dec 2010 08:46:46 +0000 (08:46 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 7 Dec 2010 08:46:46 +0000 (08:46 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9020 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/xbt/backtrace_linux.c
src/xbt/ex.c

index be2ebc4..0401eeb 100644 (file)
@@ -60,6 +60,9 @@ void xbt_ex_setup_backtrace(xbt_ex_t * e)
               && e->used,
               "Backtrace not setup yet, cannot set it up for display");
 
+  if (!xbt_binary_name) /* no binary name, nothing to do */
+    return;
+
   backtrace_syms = backtrace_symbols(e->bt, e->used);
   /* ignore first one, which is this xbt_backtrace_current() */
   e->used--;
index cd6d584..1b141a4 100644 (file)
@@ -153,6 +153,10 @@ void xbt_ex_display(xbt_ex_t * e)
   {
     int i;
 
+    if (!xbt_binary_name) {
+      fprintf(stderr, "variable 'xbt_binary_name' set to NULL. Cannot compute the backtrace\n");
+      return;
+    }
     fprintf(stderr, "\n");
     for (i = 0; i < e->used; i++)
       fprintf(stderr, "%s\n", e->bt_strings[i]);