Messages in this thread | | | Date | Mon, 05 Apr 2004 19:04:15 -0700 | From | Ulrich Drepper <> | Subject | Re: Catching SIGSEGV with signal() in 2.6 |
| |
Kevin B. Hendricks wrote:
> For some reason, the segfault generated by trying to write to address 0 can > not be properly caught anymore (or at least it appears that way to me).
If the code would be correct you'd see the expected behavior.
> void SignalHdl( int sig ) > { > bSignal = 1; > longjmp( check_env, sig ); > }
Since you jump out of a signal handling you must use siglongmp
> int check( TestFunc func, void* p ) > { > int result; > bSignal = 0; > if ( !setjmp( check_env ) )
And sigsetjmp(check_env, 1) here.
-- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |