ID:               24189
 Updated by:       [EMAIL PROTECTED]
 Reported By:      anton at valuehost dot ru
 Status:           Closed
 Bug Type:         Sockets related
 Operating System: FreeBSD 4.8
 PHP Version:      5CVS, 4CVS
 Assigned To:      wez
 New Comment:

PS: this fix can't touch the libcurl internals, of course, just the
uses of select(2) by PHP.


Previous Comments:
------------------------------------------------------------------------

[2004-09-17 16:46:38] [EMAIL PROTECTED]

Fixed in PHP 5 HEAD; tested on linux and win32, should also work on
*bsd.

------------------------------------------------------------------------

[2004-09-16 13:45:32] [EMAIL PROTECTED]

win32 is a different beast here, but we can work around it.
I've been giving this matter some thought; I might be able to cook up a
fix in a weeks time.


------------------------------------------------------------------------

[2004-09-16 09:44:13] daniel at haxx dot se

Sorry, but the fix is not _that_ simple.

FD_SETSIZE is a maximum count. Not all operating systems keep the fd
numbers in the sequence 0 - (MAX-1).

Microsoft Windows is one such exception AFAIK.

Thus. It is a lot harder than that to know if you have reached the
FD_SETSIZE maximum in a platform independent way.

------------------------------------------------------------------------

[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

Reply via email to