Linux Bug: SIGPIPEs at Will?

Linux Bug: SIGPIPEs at Will?

Post by Thomas Boute » Fri, 31 Mar 1995 04:00:00

I am developing a server application which operates as a single
thread, select()ing to determine which sockets need servicing and
so forth. This is much more efficient than forking a child
for every incoming request, like a web server would (for instance).

Under Linux, and not under other Unix flavors (so far), my server
typically runs for several hours, handling various connections,
until it abruptly receives a SIGPIPE signal and dies.

Fine, I figured, I'll catch SIGPIPE with signal(SIGPIPE, SIGIGN)
and ignore it. Nope, I still get the signal and it still kills
my app. Fine, I'll catch it and jump to a handling function
with signal(SIGPIPE, handlerFunction). Nope, I still get the
signal, my handler gets called, and then it kills my app anyway.

HELP! Is this a Linux bug? We're using version 1.1.59, has
this problem been subsequently corrected (we haven't seen
it on a 1.2.1 test system, but it's hard to prove the
*absence* of a bug that can't be trivially demonstrated)? Do I
fail to understand how to properly recover from SIGPIPE
(which occurs when a write to a closed socket is

Many thanks. Please email, and I will summarize any
useful responses to the newsgroup. Note the followup-to,
which you may wish to change if I'm an idiot and this
isn't a kernel bug.

The ouzo of human kindness.



1. SIGPIPE after signal(SIGPIPE, SIG_IGN)

 I'm coding a server application that is supposed to ignore client
closing the socket, but for no apparent reason the program still
terminates with sigpipe even after I've declared SIG_IGN for this. I am
developing under rh linux 6.2:

void SendToClient(vector<string>& temp, SOCKET cli)
  signal(SIGPIPE, SIG_IGN);

[clip clip]

 if(!send(cli, buf, strlen(buf), 0) || errno == EPIPE)
  //printf("ERROR SENDING TO CLIENT!\n");

Any thoughts anyone?


Jussi Lehtinen
Finansium ltd

2. Attaching a non-sun CDROM to SS5

3. TCP close/write/SIGPIPE/EPIPE bug


5. SIGPIPE problem in Linux?

6. Anyone using linux from CD? Without ANY HARD DISK?

7. linux/bug.h and asm/bug.h

8. Support Media Magic?

9. proposal: feed smaller mailing lists into linux-kernel, add linux-kernel-core and linux-kernel-bugs

10. popen(3) and SIGPIPE

11. pclose() causes SIGPIPE

12. 5.6 printd SIGPIPE errors

13. CERN on DEC Alpha (OSF/1) gives SIGPIPE errors with Perl scripts