Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 23448 invoked by uid 6000); 7 Dec 1997 21:00:04 -0000 Received: (qmail 23441 invoked from network); 7 Dec 1997 21:00:02 -0000 Received: from uk1.imdb.com (@192.68.174.59) by taz.hyperreal.org with SMTP; 7 Dec 1997 21:00:02 -0000 Received: from robh.imdb.com [194.222.68.23] by uk1.imdb.com with esmtp (Exim 1.62 #1) id 0xenaY-0006Hs-00; Sun, 7 Dec 1997 20:46:07 +0000 Date: Sun, 7 Dec 1997 19:33:58 +0000 (GMT) From: Rob Hartill X-Sender: robh@localhost To: Apache Group Subject: PR #1523 in apache-bugs (fwd) Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org ---------- Forwarded message ---------- Date: Sun, 07 Dec 1997 20:00:57 +0100 From: Peter Tillemans To: apache-bugs@apache.org Cc: fer@elex.be, mdm@elex.be, bge@elex.be Subject: PR #1523 in apache-bugs Hello, Sorry for bothering you like this, but I think I solved the PR #1523 which I submitted saturday. Apparently a temporary copy of the standard files were made before spawning a script. These temporary copies were not destraoyed after reassigning them to the standard files, causing a leak of 3 filehandles each time a CGI script is called. >From line 1618 I added the lines marked with a +. I can now run scripts over 50000 times without stopping serving CGI scripts. Before it stopped serving scripts after 680 times : it ran out of filehandles. /* restore the original stdin, stdout and stderr */ if (pipe_in) dup2(hStdIn, fileno(stdin)); if (pipe_out) dup2(hStdOut, fileno(stdout)); if (pipe_err) dup2(hStdErr, fileno(stderr)); + /* PTI : Close duplicate copy of original stdin, stdout and stderr */ + if (pipe_in) + close(hStdIn); + if (pipe_out) + close(hStdOut); + if (pipe_err) + close(hStdErr); if (pid) { note_subprocess(p, pid, kill_how); if (pipe_in) { *pipe_in = in_fds[1]; } if (pipe_out) { *pipe_out = out_fds[0]; } if (pipe_err) { *pipe_err = err_fds[0]; } A further indication that this fixed the problem is that the execution time of the scripts stays the same now. It used to increase slowly till all the filehandles were consumed. Sorry I could not use the usual channels : I never received a confirmation email (or MS Outlook Express misplaced it AGAIN) to reply on. And the newsserver of my ISP is down (AGAIN :-( ). regards, Peter Tillemans