signal masks and garbage collection.

Wolfgang Thaller wolfgang.thaller@gmx.net
Fri, 10 Jan 2003 22:55:12 +0100


Keean Schupke wrote:

> I am trying to block the SIGPIPE signal, I have used the Posix 
> sigprocmask
> call to set the signal to blocked. However the program sill bails out 
> if the
> client closes its socket. The exception handler appears to be called 
> then
> the program terminates. When I run the program in gdb, it gives a 
> SIGPIPE
> signal just after the thread swap happens... Heres the report from gdb:

I think I know what's going on:
The runtime system is using sigprocmask for it's own purposes and 
accidentally overwrites your signal mask. In short: stay away from 
sigProcMask and friends, they don't work.

Instead, try to use:
installHandler sigPIPE Ignore Nothing

I hope that works, I haven't tried it.

Cheers,

Wolfgang Thaller