#42682 [Com]: stream_select() indicates bad number of readable descriptors

From: Date: Tue, 15 Apr 2008 10:52:41 +0000
Subject: #42682 [Com]: stream_select() indicates bad number of readable descriptors
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-124251@lists.php.net to get a copy of this message
ID: 42682 Comment by: hans at parse dot nl Reported By: Slig at free dot fr Status: Open Bug Type: Streams related Operating System: linux-64 PHP Version: 5CVS-2007-10-11 (snap) New Comment: Problem persists in 5.2.6RC4. Tested using the testcase above, on a freshly installed Athlon64 Gentoo system. Tested against the following openssl versions: openssl-0.9.8g openssl-0.9.8e openssl-0.9.7i Recompiled php-5.2.6RC4 ebuild after each openssl version change. All versions exhibit same erroneous behavior, as described in the initial bugreport. Compiling php without openssl support eliminates the problem, as reported earlier. Target: x86_64-pc-linux-gnu Thread model: posix gcc version 4.1.2 (Gentoo 4.1.2 p1.0.2) glibc-2.6.1 php-5.2.6RC4 (using dev-lang/php-5.2.6_rc4 gentoo ebuild) Previous Comments: ------------------------------------------------------------------------ [2008-02-22 10:50:32] hans at parse dot nl This is stil a pretty serious issue on x86_64. Just ran into this one while swapping out a bunch of x86 webservers for new x86_64 boxes. Both the new and the old boxes run Gentoo, with the same gcc version, same php version. The 32 bit boxes were fine, the new 64 bit boxes fail on all stream fread's due to this issue. Target: x86_64-pc-linux-gnu Thread model: posix gcc version 4.1.2 (Gentoo 4.1.2 p1.0.2) glibc-2.6.1 openssl-0.9.8g php-5.2.5 (using php-5.2.5-r1 gentoo ebuild) ------------------------------------------------------------------------ [2007-10-22 11:00:26] jani@php.net Is there difference between openssl versions on those Suse/Centos machines? ------------------------------------------------------------------------ [2007-10-12 18:25:57] margus at zone dot ee Perhaps it helps if I give test results on different machines and where and how it manifests: stream_select() works flawlessly without patching on: - my multiple 32bit machines. Those have SuSE90 or SuSE93 installed. - my multiple 64bit SuSE10 machines stream_select() works only when patched 'long this_fd;' or 'long this_fd=0;' on: - my multiple 64bit CentOS 4.5 systems (Xeon Quadcore) stream_select() works only when patched 'long this_fd=0;' (stream_select segfaults without variable initializing) on: - my one 64bit CentOS 4.5 machine (Opteron Dualcore). Origin of this bug must be somewhere in php_stream_cast() or even lower. I tried also compiling without OpenSSL support and yes, the bug along with SSL socket support can be "eliminated" this way too :) ------------------------------------------------------------------------ [2007-10-12 17:17:10] Slig at free dot fr No, just setting it to 0 doesn't work. And margus is true, using 'long this_fd;' it works (with or without setting it to 0). I don't say it's the right solution, perhaps it's more something to change in php_stream_cast(), i don't know. ------------------------------------------------------------------------ [2007-10-12 10:10:34] jani@php.net But it won't work in future. I tried to figure out why changing that int to long would help but AFAICT it's really supposed to be int since everything else using this_fd is expecting it to be int.. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/42682 -- Edit this bug report at http://bugs.php.net/?id=42682&edit=1

« previous php.bugs (#124251) next »