lkml.org 
[lkml]   [2004]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 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/

\
 
 \ /
  Last update: 2005-03-22 14:02    [W:0.044 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site