Package: libapache2-mod-suphp
Severity: grave
I have found that when the executable exec(2)'d by the suphp helper prints
more than a certain amount of data to stderr, mod_suphp will freeze up,
preventing the executable from completing.
Fist, a PHP script that demonstrates the bug:
<?php
$x = 2049;
for ($i = 0; $i < $x; ++$i) {
error_log ($i % 10);
}
?>
If $x is set to 2048, the script runs normally. But with it set to 2049, suphp
hangs and the php process is unable to continue:
$ pstree -p -u 14667
apache2(14667)-+-apache2(25197,www-data)
|-apache2(25204,www-data)
|-apache2(25304,www-data)
|-apache2(25319,www-data)
|-apache2(25365,www-data)
|-apache2(25869,www-data)
|-apache2(25870,www-data)
`-apache2(2152,www-data)---php5(3366,user1)
# strace -p 3366
Process 3366 attached - interrupt to quit
write(2, "8\n", 2
ps says that the process is in state S (interruptable sleep), so it
seems that the apache process isn't reading the data that the script is
trying to send.
Eventually, something times out and the php process is killed,
generating a 'premature end of script headers' message.
Next, a shell script that also triggers the freeze:
#!/bin/bash
echo Content-type: text/plain
echo
echo here is some output
for x in $(seq 0 2000); do
echo an error msg >&2
done
echo end of line
This would be configured in suphp.conf with a "handler=execute:!self"
line. The symptoms are the same, but the message logged by apache is
different: "(70007)The timeout specified has expired:
ap_content_length_filter: apr_bucket_read() failed"
Now, some details of my setup; the server is running sarge.
ii apache2-mpm-pr 2.0.54-5sarge1 traditional model for Apache2
ii libapache2-mod 0.6.1-1.1 Apache2 module to run php scripts with the o
ii php5-cgi 5.1.4-0.0bpo1 server-side, HTML-embedded scripting languag
The php5 packages are those from backports.org. The suphp packages were
taken from testing and recompiled on the sarge machine; at the same time
they were configured with --setid-mode=force.
[reportbug footer deleted since I'm running it on another machine]
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]