Discussion:
Crashing lighttpd 1.3.x
Jan Kneschke
2005-01-12 19:01:33 UTC
Permalink
The fcgi_connection_cleanup() call in fcgi.c at line 1548 before the

log_error_write(srv, __FILE__, __LINE__, "sd", "unexpected end-of-file
(perhaps the fastcgi process died: ", fcgi_fd);

return -1;

has to be removed to prevent a double free.

It would be nice if someone could send a diff for this against 1.3.7 to
the list as I am currently on the road.

This was found and reported by Markjuh @ #lighttpd

Jan
--
Jan Kneschke http://jan.kneschke.de/
Perhaps you want to say 'thank you, jan': http://jk.123.org/wishlist/
Elan Ruusamäe
2005-01-12 21:12:27 UTC
Permalink
Post by Jan Kneschke
The fcgi_connection_cleanup() call in fcgi.c at line 1548 before the
log_error_write(srv, __FILE__, __LINE__, "sd", "unexpected end-of-file
(perhaps the fastcgi process died: ", fcgi_fd);
return -1;
has to be removed to prevent a double free.
wow. this looks exactly the problem i had "perhaps process died" message and
then after few times whole process exiting

i'll give it a try tomorrow!
Post by Jan Kneschke
It would be nice if someone could send a diff for this against 1.3.7 to
the list as I am currently on the road.
Jan
--
glen
Elan Ruusamäe
2005-01-13 07:18:47 UTC
Permalink
Post by Elan Ruusamäe
Post by Jan Kneschke
The fcgi_connection_cleanup() call in fcgi.c at line 1548 before the
log_error_write(srv, __FILE__, __LINE__, "sd", "unexpected end-of-file
(perhaps the fastcgi process died: ", fcgi_fd);
return -1;
has to be removed to prevent a double free.
wow. this looks exactly the problem i had "perhaps process died" message
and then after few times whole process exiting
i'll give it a try tomorrow!
oeh. didn't help. still died.

error log before it died
2005-01-13 08:57:04: (fcgi.c.1670) error: unexpected close of fastcgi connection for /i (no fastcgi process on host: 192.1
68.5.86, port: 3001 ?)3
2005-01-13 08:57:04: (fcgi.c.1670) error: unexpected close of fastcgi connection for /i (no fastcgi process on host: 192.1
68.5.86, port: 3001 ?)3
2005-01-13 08:57:04: (fcgi.c.1498) write failed: Connection timed out 110
2005-01-13 08:57:04: (fcgi.c.1541) fcgi-server disabled: 192.168.5.86 3001 412
2005-01-13 08:57:04: (fcgi.c.1498) write failed: Connection timed out 110
2005-01-13 08:57:04: (fcgi.c.1541) fcgi-server disabled: 192.168.5.86 3001 332
2005-01-13 08:57:04: (fcgi.c.1498) write failed: Connection timed out 110
2005-01-13 08:57:04: (fcgi.c.1541) fcgi-server disabled: 192.168.5.86 3001 346
2005-01-13 08:57:04: (network_writev.c.104) write failed: Connection reset by peer 1047
2005-01-13 08:57:04: (connections.c.538) connection closed: write failed on fd 1047
2005-01-13 08:57:04: (fcgi.c.1670) error: unexpected close of fastcgi connection for /i (no fastcgi process on host: 192.1
68.5.86, port: 3001 ?)3
2005-01-13 08:57:04: (fcgi.c.1498) write failed: Connection timed out 110
2005-01-13 08:57:04: (fcgi.c.1541) fcgi-server disabled: 192.168.5.86 3001 353
2005-01-13 08:57:04: (fcgi.c.1670) error: unexpected close of fastcgi connection for /i (no fastcgi process on host: 192.1
68.5.86, port: 3001 ?)3
2005-01-13 08:57:04: (fcgi.c.1670) error: unexpected close of fastcgi connection for /i (no fastcgi process on host: 192.1
68.5.86, port: 3001 ?)3
2005-01-13 08:57:04: (fcgi.c.1498) write failed: Connection timed out 110
2005-01-13 08:57:04: (fcgi.c.1541) fcgi-server disabled: 192.168.5.86 3001 454
2005-01-13 08:57:04: (fcgi.c.1498) write failed: Connection timed out 110
2005-01-13 08:57:04: (fcgi.c.1541) fcgi-server disabled: 192.168.5.86 3001 457
2005-01-13 08:57:04: (network_writev.c.104) write failed: Connection reset by peer 1389
2005-01-13 08:57:04: (connections.c.538) connection closed: write failed on fd 1389
2005-01-13 08:57:04: (network_writev.c.104) write failed: Connection reset by peer 688
2005-01-13 08:57:04: (connections.c.538) connection closed: write failed on fd 688
2005-01-13 08:57:04: (fcgi.c.1670) error: unexpected close of fastcgi connection for /i (no fastcgi process on host: 192.1
68.5.86, port: 3001 ?)3
2005-01-13 08:57:04: (fcgi.c.1498) write failed: Connection timed out 110
2005-01-13 08:57:04: (fcgi.c.1541) fcgi-server disabled: 192.168.5.86 3001 443
2005-01-13 08:57:04: (fcgi.c.1670) error: unexpected close of fastcgi connection for /i (no fastcgi process on host: 192.1
68.5.86, port: 3001 ?)3
2005-01-13 08:57:04: (fcgi.c.1670) error: unexpected close of fastcgi connection for /i (no fastcgi process on host: 192.1
68.5.86, port: 3001 ?)3
2005-01-13 08:57:04: (fcgi.c.1498) write failed: Connection timed out 110
2005-01-13 08:57:04: (fcgi.c.1541) fcgi-server disabled: 192.168.5.86 3001 117
2005-01-13 08:57:04: (fcgi.c.1498) write failed: Connection timed out 110
2005-01-13 08:57:04: (fcgi.c.1541) fcgi-server disabled: 192.168.5.86 3001 1045
2005-01-13 08:57:04: (fcgi.c.1670) error: unexpected close of fastcgi connection for /i (no fastcgi process on host: 192.1
68.5.86, port: 3001 ?)3
2005-01-13 08:57:04: (fcgi.c.1498) write failed: Connection timed out 110
2005-01-13 08:57:04: (fcgi.c.1541) fcgi-server disabled: 192.168.5.86 3001 20
2005-01-13 08:57:04: (fcgi.c.1688) fcgi: err
2005-01-13 08:57:04: (fcgi.c.1580) emergency exit: fastcgi: connection-fd: 533 fcgi-fd: 1100
2005-01-13 08:57:04: (fcgi.c.1693) fcgi-FDEVENT_ERR
(END)
--
glen
Jan Kneschke
2005-01-14 12:27:06 UTC
Permalink
Post by Elan Ruusamäe
Post by Elan Ruusamäe
Post by Jan Kneschke
The fcgi_connection_cleanup() call in fcgi.c at line 1548 before the
log_error_write(srv, __FILE__, __LINE__, "sd", "unexpected end-of-file
(perhaps the fastcgi process died: ", fcgi_fd);
return -1;
has to be removed to prevent a double free.
wow. this looks exactly the problem i had "perhaps process died" message
and then after few times whole process exiting
i'll give it a try tomorrow!
oeh. didn't help. still died.
2005-01-13 08:57:04: (fcgi.c.1541) fcgi-server disabled: 192.168.5.86 3001 20
2005-01-13 08:57:04: (fcgi.c.1688) fcgi: err
2005-01-13 08:57:04: (fcgi.c.1580) emergency exit: fastcgi: connection-fd: 533 fcgi-fd: 1100
2005-01-13 08:57:04: (fcgi.c.1693) fcgi-FDEVENT_ERR
A patch for this one is:

} else if (revents & FDEVENT_ERR) {
log_error_write(srv, __FILE__, __LINE__, "s",
"fcgi: got a FDEVENT_ERR. Don't know why.");
/* kill all connections to the fastcgi process */

connection_set_state(srv, con, CON_STATE_ERROR);
fcgi_connection_close(srv, hctx);
}

for the lines from fcgi.c 1688 to 1693.

(we already talked about it on IRC).
Post by Elan Ruusamäe
glen
Jan
--
Jan Kneschke http://jan.kneschke.de/
Perhaps you want to say 'thank you, jan': http://jk.123.org/wishlist/
Elan Ruusamäe
2005-01-12 21:25:55 UTC
Permalink
Post by Jan Kneschke
It would be nice if someone could send a diff for this against 1.3.7 to
the list as I am currently on the road.
attached.
--
glen
Loading...