Bug 315 - Handle sigcontext structures without eip.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1959 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan
2006-05-05 11:23:26 +00:00
parent 28c5faf68d
commit fbc4c6e088
2 changed files with 5 additions and 1 deletions

View File

@@ -174,6 +174,7 @@ AC_TYPE_SIGNAL
AC_CHECK_TYPES(siginfo_t,,,[#include <signal.h>])
AC_CHECK_TYPES(struct sigcontext,,,[#include <signal.h>])
AC_CHECK_MEMBERS([struct sigcontext.eip],,,[#include <signal.h>])
AC_CHECK_TYPES(ucontext_t,,,[#include <signal.h>])
AC_CHECK_HEADERS(mysql/mysql.h,,AC_MSG_ERROR(zm requires mysql/mysql.h),)

View File

@@ -85,13 +85,16 @@ RETSIGTYPE zm_die_handler( int signal )
void *trace[16];
int trace_size = 0;
#if HAVE_STRUCT_SIGCONTEXT
#if HAVE_STRUCT_SIGCONTEXT_EIP
Error(( "Signal address is %p, from %p\n", context.cr2, context.eip ));
trace_size = backtrace( trace, 16 );
// overwrite sigaction with caller's address
trace[1] = (void *)context.eip;
#elif HAVE_STRUCT_SIGCONTEXT
Error(( "Signal address is %p, no eip\n", context.cr2 ));
trace_size = backtrace( trace, 16 );
#else // HAVE_STRUCT_SIGCONTEXT
if ( info && context )
{