1
1

* The MoreBacktrace code supplied by Apple doesn't work on 64 bit Intel

builds, so disable it there
  * On 10.4.8 (and possibly others), siginfo is NULL in the signal
    callback on 64 bit Intel builds, so account for that in the signal
    callback.

This commit was SVN r14045.
Этот коммит содержится в:
Brian Barrett 2007-03-16 21:27:19 +00:00
родитель 3982be852e
Коммит 01d6121c7f
2 изменённых файлов: 99 добавлений и 82 удалений

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

@ -32,6 +32,13 @@ AC_DEFUN([MCA_backtrace_darwin_CONFIG],[
[backtrace_darwin_happy="yes"], [backtrace_darwin_happy="yes"],
[backtrace_darwin_happy="no"]) [backtrace_darwin_happy="no"])
case "${host}" in
i?86-*|x86_64*)
if test "$ac_cv_sizeof_long" = "8" ; then
backtrace_darwin_happy="no"
fi
esac
if test "$backtrace_darwin_happy" = "yes" ; then if test "$backtrace_darwin_happy" = "yes" ; then
if test "$OMPI_C_GCC_INLINE_ASSEMBLY" = "0" ; then if test "$OMPI_C_GCC_INLINE_ASSEMBLY" = "0" ; then
backtrace_darwin_happy="no" backtrace_darwin_happy="no"

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

@ -101,11 +101,12 @@ static void opal_show_stackframe (int signo, siginfo_t * info, void * p)
size -= ret; size -= ret;
tmp += ret; tmp += ret;
switch (signo) if (NULL != info) {
{ switch (signo)
case SIGILL: {
switch (info->si_code) case SIGILL:
{ switch (info->si_code)
{
#ifdef ILL_ILLOPC #ifdef ILL_ILLOPC
case ILL_ILLOPC: si_code_str = "Illegal opcode"; break; case ILL_ILLOPC: si_code_str = "Illegal opcode"; break;
#endif #endif
@ -130,11 +131,11 @@ static void opal_show_stackframe (int signo, siginfo_t * info, void * p)
#ifdef ILL_BADSTK #ifdef ILL_BADSTK
case ILL_BADSTK: si_code_str = "Internal stack error"; break; case ILL_BADSTK: si_code_str = "Internal stack error"; break;
#endif #endif
} }
break; break;
case SIGFPE: case SIGFPE:
switch (info->si_code) switch (info->si_code)
{ {
#ifdef FPE_INTDIV #ifdef FPE_INTDIV
case FPE_INTDIV: si_code_str = "Integer divide-by-zero"; break; case FPE_INTDIV: si_code_str = "Integer divide-by-zero"; break;
#endif #endif
@ -149,22 +150,22 @@ static void opal_show_stackframe (int signo, siginfo_t * info, void * p)
#ifdef FPE_FLTSUB #ifdef FPE_FLTSUB
case FPE_FLTSUB: si_code_str = "Subscript out of range"; break; case FPE_FLTSUB: si_code_str = "Subscript out of range"; break;
#endif #endif
} }
break; break;
case SIGSEGV: case SIGSEGV:
switch (info->si_code) switch (info->si_code)
{ {
#ifdef SEGV_MAPERR #ifdef SEGV_MAPERR
case SEGV_MAPERR: si_code_str = "Address not mapped"; break; case SEGV_MAPERR: si_code_str = "Address not mapped"; break;
#endif #endif
#ifdef SEGV_ACCERR #ifdef SEGV_ACCERR
case SEGV_ACCERR: si_code_str = "Invalid permissions"; break; case SEGV_ACCERR: si_code_str = "Invalid permissions"; break;
#endif #endif
} }
break; break;
case SIGBUS: case SIGBUS:
switch (info->si_code) switch (info->si_code)
{ {
#ifdef BUS_ADRALN #ifdef BUS_ADRALN
case BUS_ADRALN: si_code_str = "Invalid address alignment"; break; case BUS_ADRALN: si_code_str = "Invalid address alignment"; break;
#endif #endif
@ -174,22 +175,22 @@ static void opal_show_stackframe (int signo, siginfo_t * info, void * p)
#ifdef BUS_OBJERR #ifdef BUS_OBJERR
case BUS_OBJERR: si_code_str = "Objet-specific hardware error"; break; case BUS_OBJERR: si_code_str = "Objet-specific hardware error"; break;
#endif #endif
} }
break; break;
case SIGTRAP: case SIGTRAP:
switch (info->si_code) switch (info->si_code)
{ {
#ifdef TRAP_BRKPT #ifdef TRAP_BRKPT
case TRAP_BRKPT: si_code_str = "Process breakpoint"; break; case TRAP_BRKPT: si_code_str = "Process breakpoint"; break;
#endif #endif
#ifdef TRAP_TRACE #ifdef TRAP_TRACE
case TRAP_TRACE: si_code_str = "Process trace trap"; break; case TRAP_TRACE: si_code_str = "Process trace trap"; break;
#endif #endif
} }
break; break;
case SIGCHLD: case SIGCHLD:
switch (info->si_code) switch (info->si_code)
{ {
#ifdef CLD_EXITED #ifdef CLD_EXITED
case CLD_EXITED: si_code_str = "Child has exited"; break; case CLD_EXITED: si_code_str = "Child has exited"; break;
#endif #endif
@ -208,36 +209,36 @@ static void opal_show_stackframe (int signo, siginfo_t * info, void * p)
#ifdef CLD_CONTINUED #ifdef CLD_CONTINUED
case CLD_CONTINUED: si_code_str = "Stopped child has continued"; break; case CLD_CONTINUED: si_code_str = "Stopped child has continued"; break;
#endif #endif
} }
break; break;
#ifdef SIGPOLL #ifdef SIGPOLL
case SIGPOLL: case SIGPOLL:
switch (info->si_code) switch (info->si_code)
{ {
#ifdef POLL_IN #ifdef POLL_IN
case POLL_IN: si_code_str = "Data input available"; break; case POLL_IN: si_code_str = "Data input available"; break;
#endif #endif
#ifdef POLL_OUT #ifdef POLL_OUT
case POLL_OUT: si_code_str = "Output buffers available"; break; case POLL_OUT: si_code_str = "Output buffers available"; break;
#endif #endif
#ifdef POLL_MSG #ifdef POLL_MSG
case POLL_MSG: si_code_str = "Input message available"; break; case POLL_MSG: si_code_str = "Input message available"; break;
#endif #endif
#ifdef POLL_ERR #ifdef POLL_ERR
case POLL_ERR: si_code_str = "I/O error"; break; case POLL_ERR: si_code_str = "I/O error"; break;
#endif #endif
#ifdef POLL_PRI #ifdef POLL_PRI
case POLL_PRI: si_code_str = "High priority input available"; break; case POLL_PRI: si_code_str = "High priority input available"; break;
#endif #endif
#ifdef POLL_HUP #ifdef POLL_HUP
case POLL_HUP: si_code_str = "Device disconnected"; break; case POLL_HUP: si_code_str = "Device disconnected"; break;
#endif #endif
} }
break; break;
#endif /* SIGPOLL */ #endif /* SIGPOLL */
default: default:
switch (info->si_code) switch (info->si_code)
{ {
#ifdef SI_ASYNCNL #ifdef SI_ASYNCNL
case SI_ASYNCNL: si_code_str = "SI_ASYNCNL"; break; case SI_ASYNCNL: si_code_str = "SI_ASYNCNL"; break;
#endif #endif
@ -259,30 +260,30 @@ static void opal_show_stackframe (int signo, siginfo_t * info, void * p)
#ifdef SI_UNDEFINED #ifdef SI_UNDEFINED
case SI_UNDEFINED: si_code_str = "Undefined code"; break; case SI_UNDEFINED: si_code_str = "Undefined code"; break;
#endif #endif
} }
} }
/* print signal errno information */ /* print signal errno information */
if (0 != info->si_errno) { if (0 != info->si_errno) {
ret = snprintf(tmp, size, HOSTFORMAT "Associated errno: %s (%d)\n", ret = snprintf(tmp, size, HOSTFORMAT "Associated errno: %s (%d)\n",
stacktrace_hostname, getpid(),
strerror (info->si_errno), info->si_errno);
size -= ret;
tmp += ret;
}
ret = snprintf(tmp, size, HOSTFORMAT "Signal code: %s (%d)\n",
stacktrace_hostname, getpid(), stacktrace_hostname, getpid(),
strerror (info->si_errno), info->si_errno); si_code_str, info->si_code);
size -= ret; size -= ret;
tmp += ret; tmp += ret;
}
ret = snprintf(tmp, size, HOSTFORMAT "Signal code: %s (%d)\n", switch (signo)
stacktrace_hostname, getpid(), {
si_code_str, info->si_code); case SIGILL:
size -= ret; case SIGFPE:
tmp += ret; case SIGSEGV:
case SIGBUS:
switch (signo)
{
case SIGILL:
case SIGFPE:
case SIGSEGV:
case SIGBUS:
{ {
ret = snprintf(tmp, size, HOSTFORMAT "Failing at address: %p\n", ret = snprintf(tmp, size, HOSTFORMAT "Failing at address: %p\n",
stacktrace_hostname, getpid(), info->si_addr); stacktrace_hostname, getpid(), info->si_addr);
@ -290,30 +291,39 @@ static void opal_show_stackframe (int signo, siginfo_t * info, void * p)
tmp += ret; tmp += ret;
break; break;
} }
case SIGCHLD: { case SIGCHLD:
ret = snprintf(tmp, size, HOSTFORMAT "Sending PID: %d, Sending UID: %d, Status: %d\n", {
stacktrace_hostname, getpid(), ret = snprintf(tmp, size, HOSTFORMAT "Sending PID: %d, Sending UID: %d, Status: %d\n",
info->si_pid, info->si_uid, info->si_status); stacktrace_hostname, getpid(),
size -= ret; info->si_pid, info->si_uid, info->si_status);
tmp += ret; size -= ret;
break; tmp += ret;
} break;
}
#ifdef SIGPOLL #ifdef SIGPOLL
case SIGPOLL: { case SIGPOLL:
{
#ifdef HAVE_SIGINFO_T_SI_FD #ifdef HAVE_SIGINFO_T_SI_FD
ret = snprintf(tmp, size, HOSTFORMAT "Band event: %ld, File Descriptor : %d\n", ret = snprintf(tmp, size, HOSTFORMAT "Band event: %ld, File Descriptor : %d\n",
stacktrace_hostname, getpid(), info->si_band, info->si_fd); stacktrace_hostname, getpid(), info->si_band, info->si_fd);
#elif HAVE_SIGINFO_T_SI_BAND #elif HAVE_SIGINFO_T_SI_BAND
ret = snprintf(tmp, size, HOSTFORMAT "Band event: %ld\n", ret = snprintf(tmp, size, HOSTFORMAT "Band event: %ld\n",
stacktrace_hostname, getpid(), info->si_band); stacktrace_hostname, getpid(), info->si_band);
#else #else
ret = 0; ret = 0;
#endif #endif
size -= ret;
tmp += ret;
break;
}
#endif
}
} else {
ret = snprintf(tmp, size,
HOSTFORMAT "siginfo is NULL, additional information unavailable\n",
stacktrace_hostname, getpid());
size -= ret; size -= ret;
tmp += ret; tmp += ret;
break;
}
#endif
} }
/* write out the signal information generated above */ /* write out the signal information generated above */