diff --git a/ompi/runtime/ompi_mpi_init.c b/ompi/runtime/ompi_mpi_init.c index ce00058194..90d9296502 100644 --- a/ompi/runtime/ompi_mpi_init.c +++ b/ompi/runtime/ompi_mpi_init.c @@ -232,12 +232,10 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided) } } -#if 0 if (OMPI_SUCCESS != (ret = opal_util_register_stackhandlers ())) { error = "util_register_stackhandlers() failed"; goto error; } -#endif /* initialize datatypes. This step should be done early as it will * create the local convertor and local arch used in the proc diff --git a/ompi/runtime/ompi_mpi_params.c b/ompi/runtime/ompi_mpi_params.c index 978cc68701..aeae96a625 100644 --- a/ompi/runtime/ompi_mpi_params.c +++ b/ompi/runtime/ompi_mpi_params.c @@ -19,6 +19,9 @@ #include "ompi_config.h" #include +#ifdef HAVE_SIGNAL_H +#include +#endif #include "ompi/include/constants.h" #include "ompi/runtime/mpiruntime.h" @@ -71,9 +74,33 @@ int ompi_mpi_register_params(void) /* * This string is going to be used in opal/util/stacktrace.c */ - mca_base_param_reg_string_name("mpi", "signal", - "If a signal is received, display the stack trace frame", - false, false, NULL, NULL); + { + char *string = NULL; + int j; + int signals[] = { +#ifdef SIGBUS + SIGBUS, +#endif +#ifdef SIGSEGV + SIGSEGV, +#endif + -1 + }; + for (j = 0 ; signals[j] != -1 ; ++j) { + if (j == 0) { + asprintf(&string, "%d", signals[j]); + } else { + char *tmp; + asprintf(&tmp, "%s,%d", string, signals[j]); + free(string); + string = tmp; + } + } + + mca_base_param_reg_string_name("mpi", "signal", + "If a signal is received, display the stack trace frame", + false, false, string, NULL); + } /* * opal_progress: decide whether to yield and the event library