Re: Catching SIGSEGV with signal() in 2.6

From: Kevin B. Hendricks
Date: Mon Apr 05 2004 - 22:02:44 EST


Hi,

> If the code would be correct you'd see the expected behavior.
> Since you jump out of a signal handling you must use siglongmp
> And sigsetjmp(check_env, 1) here.

So the code has been wrong since the beginning and we were just "lucky" it
worked in all pre-2.6 kernels?

I have no doubt you are right but forgiving my ignorance here, please explain
why must we use siglongjmp when longjmping out of a signal handler given that

1. before the next use of the handler we use signal again to properly set the
signal handler (and the set of masked signals).

and

2. the mask of blocked signals will include sigsegv upon entry to the signal
handler and therefore it will be masked after the normal longjmp since a
normal longjmp wil not change the set of masked symbols.

What am I missing that makes sigsetjmp and siglongjmp a requirement, or is
this just part of some specification someplace?

Kevin

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/