Project

General

Profile

Actions

Bug #554

closed

Fix for CGI / Zombie issue in ticket # 552

Added by Anonymous about 18 years ago. Updated almost 16 years ago.

Status:
Fixed
Priority:
Normal
Category:
mod_cgi
Target version:
-
ASK QUESTIONS IN Forums:

Description

Regarding the issue about zombies I posted earlier, I resolved this with a waitpid() call before the write() calls in cgi_create_env in the file mod_cgi.c. The problem I was having stems from that function reading all blocks in the request (presumably pulling new blocks over the wire) before checking state. Using waitpid() with WNOHANG lets me check if the child has exited, at which point I break the loop.

This is a bit sloppy as I haven't walked through the code to see if the remaining request blocks in the queue get cleaned up, but I'll send a patch if you want.

(Sorry for sloppy bug updates; I can't figure out how to log in)

-- dwerner

Actions #1

Updated by cam about 18 years ago

i think this bug may have already been fixed in this change:

http://trac.lighttpd.net/trac/changeset/1006

the bug is that lighttpd is holding open a read part of the pipe, which means the write blocks, waiting for someone to free some buffer space in the pipe by reading. the client is dead, though, and the only other process with an open read handle is lighttpd. lighttpd never uses this handle, so the fix makes sure lighttpd closes the read handle as soon as possible. this means the write will generate a SIG_PIPE because no one has the pipe open for reading and lighttpd can keep going.

if possible, try the latest version from svn and see if it resolves the problem (see http://www.lighttpd.net/download/ for instructions).

Actions #2

Updated by stbuehler almost 16 years ago

  • Status changed from New to Fixed
  • Resolution set to fixed
Actions

Also available in: Atom