> Blocking SIGSEGV with sigprocmask does really BLOCK it. 
> I think, this is a bug. I discovered this because I wanted to
> provoke a core dump by a write to (int *)0, but the process got hung,

The instruction that caused the SEGV is going to restart after any handler
runs because the handler may have mapped the page that caused the fault.

On other operating systems you can block SEGV for purposes of asynchronous
signals (ie `kill -SEGV') but not for synchronous signals.  To quote from
the Solaris sigprocmask manpage:

     Signals that  are  generated  synchronously  should  not  be
     masked.  If  such  a  signal  is  blocked and delivered, the
     receiving process is killed.

and indeed a test program shows that you still get SEGV in that case.
You can still shoot yourself in the foot with a SEGV handler that doesn't
eliminate the fault.

--Ben


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-stable" in the body of the message

Reply via email to