#41932 [NEW]: fsockopen - apache2 poblem with many vhosts
| From: | yaboll at interia dot pl | Date: | Mon, 09 Jul 2007 07:43:45 +0000 |
| Subject: | #41932 [NEW]: fsockopen - apache2 poblem with many vhosts | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-114767@lists.php.net to get a copy of this message | ||
From: yaboll at interia dot pl
Operating system: linux
PHP version: 4.4.7
PHP Bug Type: Sockets related
Bug description: fsockopen - apache2 poblem with many vhosts
Description:
------------
I found problem in fsockopen() when I use php as module mod_php in
apache2.
When I create many vhost fsckopen() doesn't work good and generate child
sigterm error.
I made some experimets with vhost number:
vhosts number - error
less than 1005 - work fine
1006-1007 - white page (no error)
1008 - around 1164 - "Operation now in progress (115)"
around 1150 - around 1164 - "Bad file descriptor (9)"
around 1164 - around 1200 - "Operation now in progress (115)"
1200 and more - apache child sigterm
core in sigterm:
(gdb) bt
#0 php_hostconnect (host=Cannot access memory at address 0xc
) at /srv/dev-dev/php4-debug/php4/php4-4.4.7/main/network.c:490
Cannot access memory at address 0x4
(gdb)
When I use php in cgi/cli mode all works fine.
Reproduce code:
---------------
<?php
$fp = fsockopen("www.onet.pl", 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = "GET / HTTP/1.1\r\n";
$out .= "Host: www.onet.pl\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);
}
?>
--
Edit bug report at http://bugs.php.net/?id=41932&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41932&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41932&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41932&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41932&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=41932&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41932&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41932&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41932&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41932&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41932&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=41932&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=41932&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41932&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41932&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41932&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41932&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41932&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41932&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41932&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41932&r=mysqlcfg