
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: Starting program: /local/home/keean/HServer/hserver (no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)...[New Thread 16384 (LWP 23152)] (no debugging symbols found)...(no debugging symbols found)... (no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)... Server Start serverMain Connection from: "xxx.xxx.xxx.xxx":1054 caught thread exception application finally Connection from: "xxx.xxx.xxx.xxx":1055 caught thread exception application finally : : Connection from: "pc-80-192-247-253-cr.blueyonder.co.uk":1104 (no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)... Program received signal SIGPIPE, Broken pipe. [Switching to Thread 16384 (LWP 23152)] 0x4015b8cd in sigprocmask () from /lib/libc.so.6 So there is a real thread, what I cant quite figure out is why it dies in sigprocmask ()... Regards, Keean Schupke -----Original Message----- From: Wolfgang Thaller [mailto:wolfgang.thaller@gmx.net] Sent: 10 January 2003 19:20 To: Keean Schupke Subject: Re: signal masks and garbage collection. Keean Schupke wrote:
I have a problem with c_sigprocmask from the Posix library. This is supposed to set a signal mask for the process (but it appears it actually only sets it for the thread). I need some way of calling sigprocmask before the garbage collector thread is started so it inherits the same signal mask (or a way of setting the signal mask of the garbage collector whilst running). Any ideas?
The garbage collector in GHC doesn't currenlty run in a separate thread - it is executed in the same thread as your haskell code (even if you use the "threaded RTS"). Therefore there is no separate signal mask for the garbage collector. What are you trying to do? Regards, Wolfgang Thaller