diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-26 09:52:28 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-26 09:52:28 +0000 |
commit | 1fb59126b0f9facb88cbbdc0331035f7e9dd80a7 (patch) | |
tree | eeddce72ab51757f155ce3f019ae6bacee532585 /debug.c | |
parent | 3d26cfc1854cdae96b62b536983b1239b32e9ec2 (diff) | |
download | rsyslog-1fb59126b0f9facb88cbbdc0331035f7e9dd80a7.tar.gz rsyslog-1fb59126b0f9facb88cbbdc0331035f7e9dd80a7.tar.bz2 rsyslog-1fb59126b0f9facb88cbbdc0331035f7e9dd80a7.zip |
improved SIGSEGV handler a bit (now we get a core dump)
Diffstat (limited to 'debug.c')
-rw-r--r-- | debug.c | 20 |
1 files changed, 6 insertions, 14 deletions
@@ -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(); } |