From: Arnaud Giersch Date: Wed, 3 Oct 2012 14:02:26 +0000 (+0200) Subject: Use xbt_abort instead of abort. X-Git-Tag: v3_8~146^2~1 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/e7cdc14647fc01e576c8e820bf51cc96a679be17 Use xbt_abort instead of abort. Maybe this will improve the code coverage analysis. --- diff --git a/src/mc/mc_liveness.c b/src/mc/mc_liveness.c index eadd14909e..aa5bd8bfe8 100644 --- a/src/mc/mc_liveness.c +++ b/src/mc/mc_liveness.c @@ -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: diff --git a/src/msg/msg_config.c b/src/msg/msg_config.c index 71758eed2a..31bed567c6 100644 --- a/src/msg/msg_config.c +++ b/src/msg/msg_config.c @@ -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); diff --git a/src/simdag/sd_daxloader.c b/src/simdag/sd_daxloader.c index 45137ff25e..a4364e7a92 100644 --- a/src/simdag/sd_daxloader.c +++ b/src/simdag/sd_daxloader.c @@ -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) diff --git a/src/simix/smx_process.c b/src/simix/smx_process.c index 3e5bafcc7c..dfeae73515 100644 --- a/src/simix/smx_process.c +++ b/src/simix/smx_process.c @@ -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) { diff --git a/src/simix/smx_user.c b/src/simix/smx_user.c index 54edf9dc64..9344984a17 100644 --- a/src/simix/smx_user.c +++ b/src/simix/smx_user.c @@ -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(); diff --git a/src/smpi/smpi_global.c b/src/smpi/smpi_global.c index 43e5c0c676..c864c5c6fe 100644 --- a/src/smpi/smpi_global.c +++ b/src/smpi/smpi_global.c @@ -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); } diff --git a/src/surf/lagrange.c b/src/surf/lagrange.c index a6e30f382d..0eec4fb677 100644 --- a/src/surf/lagrange.c +++ b/src/surf/lagrange.c @@ -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(); } } diff --git a/src/xbt/backtrace_linux.c b/src/xbt/backtrace_linux.c index 4f246ccf62..06621d904b 100644 --- a/src/xbt/backtrace_linux.c +++ b/src/xbt/backtrace_linux.c @@ -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) diff --git a/src/xbt/ex.c b/src/xbt/ex.c index 3f333ce914..1d15d7a589 100644 --- a/src/xbt/ex.c +++ b/src/xbt/ex.c @@ -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 */ diff --git a/src/xbt/snprintf.c b/src/xbt/snprintf.c index 1e443fb690..83c8181cc6 100644 --- a/src/xbt/snprintf.c +++ b/src/xbt/snprintf.c @@ -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; } diff --git a/src/xbt/xbt_os_thread.c b/src/xbt/xbt_os_thread.c index 3d1c361834..e18ae2ef2a 100644 --- a/src/xbt/xbt_os_thread.c +++ b/src/xbt/xbt_os_thread.c @@ -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 */ }