On Tue, Oct 21, 2003 at 10:01:16PM +1000, Ken Foskey wrote:

> On Tue, 2003-10-21 at 18:43, Martin Johansson wrote:
> > On Mon, Oct 20, 2003 at 11:07:40PM +1000, Ken Foskey wrote:
> > 
> > > 
> > > If anyone is on a very fresh version of K2.6 with extra patches can you
> > > please run this code and see if it crashes.  It fails on all K2.6 up to
> > > Test6 release.  I would be interested to hear of any success.
> > 
> > I don't think it's related to the kernel version.
> > 
> > > There should be no segfault and another signal caught.
> > > 
> > > If there is any obvious blunder with this code let me know.  Looks
> > > pretty right to me though I don't use signals much at all.
> > 
> > The problem is that you never return from the signal handler. Now you're
> > getting a SIGSEGV during execution of the SIGSEGV handler and the signal is
> > probably forced to SIG_DFL, otherwise you could get an infinite signal
> > loop. Return from the handler instead of a longjmp and you should be ok.
> 
> The following code behaves the same under K 2.4 and K 2.6 so there is
> something different for SEGV to SIGINT.  Can anyone explain?

It was a bit more involved than what I remembered, but there are ways to
handle SIGSEGV other than abort & dump core. You can handle page faults in
user-space for example. Check out http://libsigsegv.sourceforge.net/

/Martin
-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to