You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2011/03/19 15:16:14 UTC

DO NOT REPLY [Bug 50948] New: Connection not closed when CGI dies waiting for POST data

https://issues.apache.org/bugzilla/show_bug.cgi?id=50948

           Summary: Connection not closed when CGI dies waiting for POST
                    data
           Product: Apache httpd-2
           Version: 2.2.17
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_cgi
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: zachlutho@mailfish.de


When a CGI program dies while it is waiting for the client to send its POST
data, Apache does not reap the child process and close the connection but
instead waits for whatever timeout is configured globally before closing the
connection. This seems senseless as there's nothing to be done once the child
has exited.

Consider this simple Perl script:

<snip>
#!/usr/bin/perl

$SIG{ALRM} = sub { die };
alarm 5;
sysread STDIN, $data, 4096;

END {
  print "Content-Type: text/plain\n\n";
  print $data;
}
</snip>

and this client request sending all the headers but no body and keeping the
connection open:

<snip>
POST /test.cgi HTTP/1.1
Host: localhost
Content-Length: 10

</snip>

After the five seconds timeout the child will hang around as a zombie but the
connection is still open.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 50948] Connection not closed when CGI dies waiting for POST data

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50948

Joe Orton <jo...@redhat.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX

--- Comment #2 from Joe Orton <jo...@redhat.com> 2011-06-24 08:38:33 UTC ---
mod_cgi does not discover the child has died until it reads or writes from the
child's stdout or stdin respectively.  If the client is sending a body, mod_cgi
will not write to the stdin until it reads a block from the client.  So, this
is expected behaviour, sorry.  (It is a design constraint with httpd filters
that it is not possible to wait for I/O across {client connection, pipes to
children}.)

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 50948] Connection not closed when CGI dies waiting for POST data

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50948

Carsten Gaebler <wh...@mailfish.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WONTFIX                     |---

--- Comment #3 from Carsten Gaebler <wh...@mailfish.de> ---
How about allowing apr_bucket_read() to return when interrupted by a signal,
i.e. implementing something in between APR_BLOCK_READ and APR_NONBLOCK_READ?

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 50948] Connection not closed when CGI dies waiting for POST data

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50948

--- Comment #1 from Zach Lutho <za...@mailfish.de> 2011-06-23 17:29:01 UTC ---
Ping?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org