#24189 [Opn->Asn]: big problem on stream function
| From: | sniper@php.net | Date: | Wed, 15 Sep 2004 13:33:51 +0000 |
| Subject: | #24189 [Opn->Asn]: big problem on stream function | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-66209@lists.php.net to get a copy of this message | ||
ID: 24189
Updated by: sniper@php.net
Reported By: anton at valuehost dot ru
-Status: Open
+Status: Assigned
Bug Type: Sockets related
Operating System: FreeBSD 4.8
-PHP Version: 4.3.2
+PHP Version: 5CVS, 4CVS
-Assigned To:
+Assigned To: wez
Previous Comments:
------------------------------------------------------------------------
[2004-07-01 13:53:43] jorton at redhat dot com
This is a real bug.
The issue is that fd_set is a fixed-size array, and if FD_SET is passed
an fd number greater than FD_SETSIZE, it has undefined behaviour, i.e.
it overruns the array and corrupts memory.
All uses of select() in PHP look to be unsafe because of this. The
proper fix is to use poll() on platforms where it is available, and to
always check that fd < FD_SETSIZE before using FD_SET.
------------------------------------------------------------------------
[2003-06-15 07:31:00] anton at valuehost dot ru
Description:
------------
phpinfo:
http://v6test.valuehost.ru/phpinfo.php
The problem has the following character, after long work php as mod_php
in apache, various variations of sockets, fsockopen, include, fopen and
etc cease to work.
As did not work and curl, but it managed to be solved rebuild libcurl
with FD_SETSIZE=16384 (sys/types.h).
Such sensation that descriptors come to an end.
At occurrence of this problem fsockopen starts to return a mistake "
Operation now in progress "
Function include in general causes Segmentation fault (11)
Unfortunately there is no opportunity to include an option debug as
ZendOptimazer does not work in debug a mode.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=24189&edit=1