Vulnerability Development mailing list archives

Re: locating default signal handler for SIGSEGV


From: Valdis.Kletnieks () vt edu
Date: Wed, 10 Dec 2003 12:13:44 -0500

On Tue, 09 Dec 2003 12:14:17 +0545, npguy said:

DM> Can anyone tell me how can I locate the signal handler for SIGSEGV,

simply call

   sighandler_t signal(int signum, sighandler_t sighd);

I think what he *wanted* to know was, "While looking at an existing binary
using gdb or other debugger, how to determin whether a signal was currently set
to SIG_IGN, SIG_DFL, or the pointer to the function in the binary".  Running
the binary under 'strace' or similar will tell you if the signal is getting set
to a function (and the address of it if so).  It's quite possible that a given
program doesn't set a handler (for instance, very few programs trap SEGV) so
you *will not* find any code in the binary to do the "catch signal and dump
core", as that's being done for you by the kernel.

Attachment: _bin
Description:


Current thread: