Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use xbt_abort instead of abort.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Wed, 3 Oct 2012 14:02:26 +0000 (16:02 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Wed, 3 Oct 2012 21:30:55 +0000 (23:30 +0200)
Maybe this will improve the code coverage analysis.

src/mc/mc_liveness.c
src/msg/msg_config.c
src/simdag/sd_daxloader.c
src/simix/smx_process.c
src/simix/smx_user.c
src/smpi/smpi_global.c
src/surf/lagrange.c
src/xbt/backtrace_linux.c
src/xbt/ex.c
src/xbt/snprintf.c
src/xbt/xbt_os_thread.c

index eadd149..aa5bd8b 100644 (file)
@@ -27,7 +27,7 @@ int create_dump(int pair)
   switch(fork()){
   case 0:
     // We are the child process -- run the actual program
-    abort();
+    xbt_abort();
     break;
     
   case -1:
index 71758ee..31bed56 100644 (file)
@@ -23,7 +23,7 @@ void MSG_config(const char *name, ...)
   if (!msg_global) {
     fprintf(stderr,
             "ERROR: Please call MSG_init() before using MSG_config()\n");
-    abort();
+    xbt_abort();
   }
   va_start(pa, name);
   xbt_cfg_set_vargs(_surf_cfg_set, name, pa);
index 45137ff..a4364e7 100644 (file)
@@ -23,7 +23,7 @@ bool parents_are_marked(SD_task_t task);
 static void dax_parse_error(char *msg)
 {
   fprintf(stderr, "Parse error on line %d: %s\n", dax_lineno, msg);
-  abort();
+  xbt_abort();
 }
 
 static double dax_parse_double(const char *string)
index 3e5bafc..dfeae73 100644 (file)
@@ -713,7 +713,7 @@ xbt_running_ctx_t *SIMIX_process_get_running_context(void)
 void SIMIX_process_exception_terminate(xbt_ex_t * e)
 {
   xbt_ex_display(e);
-  abort();
+  xbt_abort();
 }
 
 smx_context_t SIMIX_process_get_context(smx_process_t p) {
index 54edf9d..9344984 100644 (file)
@@ -1278,7 +1278,7 @@ smx_mutex_t simcall_mutex_init(void)
 {
   if(!simix_global) {
     fprintf(stderr,"You must run MSG_init or gras_init before using MSG or GRAS\n"); // I would have loved using xbt_die but I can't since it is not initialized yet... :)
-    abort();
+    xbt_abort();
   }
   smx_simcall_t simcall = SIMIX_simcall_mine();
 
index 43e5c0c..c864c5c 100644 (file)
@@ -118,8 +118,8 @@ int smpi_global_size(void) {
    char* value = getenv("SMPI_GLOBAL_SIZE");
 
    if(!value) {
-      fprintf(stderr, "Please set env var SMPI_GLOBAL_SIZE to expected number of processes.\n");
-      abort();
+     fprintf(stderr, "Please set env var SMPI_GLOBAL_SIZE to expected number of processes.\n");
+     xbt_abort();
    }
    return atoi(value);
 }
index a6e30f3..0eec4fb 100644 (file)
@@ -460,12 +460,12 @@ static double dichotomy(double init, double diff(double, void *),
     } else if (min_diff > 0 && max_diff < 0) {
       XBT_CWARN(surf_lagrange_dichotomy,
              "The impossible happened, partial_diff(min) > 0 && partial_diff(max) < 0");
-      abort();
+      xbt_abort();
     } else {
       XBT_CWARN(surf_lagrange_dichotomy,
              "diffmin (%1.20f) or diffmax (%1.20f) are something I don't know, taking no action.",
              min_diff, max_diff);
-      abort();
+      xbt_abort();
     }
   }
 
index 4f246cc..06621d9 100644 (file)
@@ -196,8 +196,7 @@ void xbt_ex_setup_backtrace(xbt_ex_t * e) //FIXME: This code could be greatly im
   XBT_VERB("Fire a first command: '%s'", cmd);
   pipe = popen(cmd, "r");
   if (!pipe) {
-    XBT_CRITICAL("Cannot fork addr2line to display the backtrace");
-    abort();
+    xbt_die("Cannot fork addr2line to display the backtrace");
   }
 
   for (i = 0; i < e->used; i++) {
@@ -306,8 +305,7 @@ void xbt_ex_setup_backtrace(xbt_ex_t * e) //FIXME: This code could be greatly im
         XBT_VERB("Fire a new command: '%s'", subcmd);
         subpipe = popen(subcmd, "r");
         if (!subpipe) {
-          XBT_CRITICAL("Cannot fork addr2line to display the backtrace");
-          abort();
+          xbt_die("Cannot fork addr2line to display the backtrace");
         }
         fgets_res = fgets(line_func, 1024, subpipe);
         if (fgets_res == NULL)
index 3f333ce..1d15d7a 100644 (file)
@@ -176,8 +176,7 @@ void xbt_ex_display(xbt_ex_t * e)
 void __xbt_ex_terminate_default(xbt_ex_t * e)
 {
   xbt_ex_display(e);
-
-  abort();
+  xbt_abort();
 }
 
 /* the externally visible API */
index 1e443fb..83c8181 100644 (file)
@@ -1176,7 +1176,7 @@ char *bvprintf(const char *fmt, va_list ap)
     /* Do not want to use xbt_die() here, as it uses the logging
      * infrastucture and may fail to allocate memory too. */
     fprintf(stderr, "bprintf: vasprintf failed. Aborting.\n");
-    abort();
+    xbt_abort();
   }
   return res;
 }
index 3d1c361..e18ae2e 100644 (file)
@@ -74,8 +74,7 @@ static xbt_running_ctx_t *_os_thread_get_running_ctx(void)
 static void _os_thread_ex_terminate(xbt_ex_t * e)
 {
   xbt_ex_display(e);
-
-  abort();
+  xbt_abort();
   /* FIXME: there should be a configuration variable to choose to kill everyone or only this one */
 }