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.
Этот коммит содержится в:
родитель
4ff5316b2d
Коммит
45a3eccec6
@ -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 ())) {
|
if (OMPI_SUCCESS != (ret = opal_util_register_stackhandlers ())) {
|
||||||
error = "util_register_stackhandlers() failed";
|
error = "util_register_stackhandlers() failed";
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* initialize datatypes. This step should be done early as it will
|
/* initialize datatypes. This step should be done early as it will
|
||||||
* create the local convertor and local arch used in the proc
|
* create the local convertor and local arch used in the proc
|
||||||
|
@ -19,6 +19,9 @@
|
|||||||
#include "ompi_config.h"
|
#include "ompi_config.h"
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#ifdef HAVE_SIGNAL_H
|
||||||
|
#include <signal.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "ompi/include/constants.h"
|
#include "ompi/include/constants.h"
|
||||||
#include "ompi/runtime/mpiruntime.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
|
* 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",
|
char *string = NULL;
|
||||||
false, false, NULL, 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
|
* opal_progress: decide whether to yield and the event library
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user