Subject: Re: Programming question - signal handlers
To: None <netbsd-users@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: netbsd-users
Date: 07/08/2002 13:25:45
On Mon, Jul 08, 2002 at 02:14:16PM +0200, Johnny Billquist wrote:
> On Mon, 8 Jul 2002, Paul Goyette wrote:
>
> > There's this program I've been working on, and I'm having some
> > difficulties dealing with signal handlers. The program explicitly
> > catches and handles SIGSEGV and takes some clean-up action so that
> > some datafiles don't get left corrupted. But it the process, the
> > "normal" action of dropping a .core file doesn't happen, so I'm left
> > without a clue as to where the SEGV occurred.
> >
> > So, is there any was I can make the program do BOTH the default
> > sigaction AND the specified handler? Or, alternatively, is there a
> > routine I can call from within the program's handler that will drop
> > a core file suitable for use in gdb?
>
> Why don't you remove the signal handler in the handler, and the return for
> a retry? That should create the core at the correct spot, or am I missing
> something?
kill( 0, SIGSEGV ) within the handler should dump a core.
(because the handler (should) be inactive inside itself)
David
--
David Laight: david@l8s.co.uk