signals of type SIGSEGV handled only once (in multithreaded process)

Samuel Thibault samuel.thibault@ens-lyon.org
Fri Feb 15 11:07:00 GMT 2008


Corinna Vinschen, le Fri 15 Feb 2008 10:45:47 +0100, a écrit :
> On Feb 15 09:37, klement2 wrote:
> > After excellently quick correction of pthread_kill when the argument
> > signal is zero
> > (by cgf), I have found another problem related to signal handling. The
> > code in attachment
> > demonstrates it ( because of pthread_kill, it must be run with
> > cygwin1-20080213.dll and newer ).
> > It seams that signal handlers for signals like SIGSEGV, SIGFPE are
> > called only once,
> 
> This patch was necessary to get SEHs (and so Cygwin) working correctly
> on Windows 2008 Server.  The new behaviour is covered by POSIX:
> 
> http://www.opengroup.org/onlinepubs/009695399/functions/signal.html
> 
>   "If and when the function returns, if the value of sig was SIGFPE,
>    SIGILL, or SIGSEGV or any other implementation-defined value
>    corresponding to a computational exception, the behavior is undefined.
>    Otherwise, the program shall resume execution at the point it was
>    interrupted."

His handler doesn't return, it calls pthread_exit(), thus killing the
thread causing the SIGFPE, SIGILL or SIGSEGV.

Samuel

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list