Ticket #431 (assigned defect)

Opened 3 years ago

Last modified 2 years ago

mod_fastcgi.c fcgi_demux_response() stops sometimes when server is busy

Reported by: singnoo@hotmail.com Assigned to: anonymous (accepted)
Priority: normal Milestone:
Component: mod_fastcgi Version: 1.4.x-svn
Severity: major Keywords:
Cc: Blocking:
Need Feedback:

Description

PHP via fastcgi stops responding sometimes in lighttpd v1.4.8. It can be replayed like belows:

php -i > test.php
ab -n 5000 -c 200 http://localhost/test.php

If you turn fastcgi.debug = 1, "unexpected end-of-file (perhaps the fastcgi process died)" will be reported.

I checked mod_fastcgi.c and found that fcgi_demux_response() process FIONREAD wrong. Line 2262 should return 0 instead of log_error_write and return -1. I have tested by myself and it works.

/* init read-buffer */

if (toread > 0) {
    ...
} else {
    log_error_write(srv, __FILE__, __LINE__, "ssdsdsd",
    "unexpected end-of-file (perhaps the fastcgi process died):",
    ...
}
/* init read-buffer */

if (toread > 0) {
    ...
} else {
    return 0;
}

Attachments

Change History

01/05/2006 11:19:27 AM changed by jan@kneschke.de

  • owner changed from jan to anonymous.
  • status changed from new to assigned.

No, if toread is 0 this is a EOF from the socket without a FCGI_FINISH packet.

This violates the FastCGI spec and usually means that the backend segfaulted before it could send the FCGI_FINISH packet.

Please provide a strace so we can check both what is going on in your case.


Add/Change #431 (mod_fastcgi.c fcgi_demux_response() stops sometimes when server is busy)




Change Properties