1
1

re-enable the stack-trace functionality (it had been inadvertently disabled

in a merge a long time ago).  Set default signals to print a stack trace from
none to SIGBUS,SIGSEGV.

This commit was SVN r8603.
Этот коммит содержится в:
Brian Barrett 2005-12-22 19:39:50 +00:00
родитель 4ff5316b2d
Коммит 45a3eccec6
2 изменённых файлов: 30 добавлений и 5 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -19,6 +19,9 @@
#include "ompi_config.h"
#include <time.h>
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#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