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.