summaryrefslogtreecommitdiffstats
path: root/debug.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-26 09:52:28 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-26 09:52:28 +0000
commit1fb59126b0f9facb88cbbdc0331035f7e9dd80a7 (patch)
treeeeddce72ab51757f155ce3f019ae6bacee532585 /debug.c
parent3d26cfc1854cdae96b62b536983b1239b32e9ec2 (diff)
downloadrsyslog-1fb59126b0f9facb88cbbdc0331035f7e9dd80a7.tar.gz
rsyslog-1fb59126b0f9facb88cbbdc0331035f7e9dd80a7.tar.xz
rsyslog-1fb59126b0f9facb88cbbdc0331035f7e9dd80a7.zip
improved SIGSEGV handler a bit (now we get a core dump)
Diffstat (limited to 'debug.c')
-rw-r--r--debug.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/debug.c b/debug.c
index 1577311d..474df03c 100644
--- a/debug.c
+++ b/debug.c
@@ -659,7 +659,6 @@ static void dbgCallStackPrintAll(void)
void
sigsegvHdlr(int signum)
{
- struct sigaction sigAct;
char *signame;
if(signum == SIGSEGV) {
@@ -670,22 +669,15 @@ sigsegvHdlr(int signum)
dbgprintf("\n\n\n\nSignal %d%s occured, execution must be terminated %d.\n\n\n\n", signum, signame, SIGSEGV);
- dbgCallStackPrintAll();
+ dbgPrintAllDebugInfo();
fflush(stddbg);
- /* re-instantiate original handler ... */
- memset(&sigAct, 0, sizeof (sigAct));
- sigemptyset(&sigAct.sa_mask);
- sigAct.sa_handler = SIG_DFL;
- sigaction(SIGSEGV, &sigAct, NULL);
-
- /* and call it */
- int ir = raise(signum);
- printf("raise returns %d, errno %d: %s\n", ir, errno, strerror(errno));
- /* we should never arrive here - but we provide some code just in case... */
- dbgprintf("sigsegvHdlr: oops, returned from raise(), doing exit(), something really wrong...\n");
- exit(1);
+ /* and finally abort... */
+ /* TODO: think about restarting rsyslog in this case: may be a good idea,
+ * but may also be a very bad one (restart loops!)
+ */
+ abort();
}