ID:               42682
 Comment by:       cory dot mcdonald at perfectmale54 dot com
 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:

Hi,

Is PHP going to fix this bug in a new build if PHP?

Thanks,
corymcd


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

[2007-10-22 11:00:26] [EMAIL PROTECTED]

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:20:28] [EMAIL PROTECTED]

Try this patch (just manually change the 2 lines :):

Index: streamsfuncs.c
===================================================================
RCS file: /repository/php-src/ext/standard/streamsfuncs.c,v
retrieving revision 1.58.2.6.2.15.2.4
diff -u -a -r1.58.2.6.2.15.2.4 streamsfuncs.c
--- streamsfuncs.c      10 Oct 2007 12:58:41 -0000     
1.58.2.6.2.15.2.4
+++ streamsfuncs.c      12 Oct 2007 10:19:55 -0000
@@ -573,7 +573,7 @@
 {
        zval **elem;
        php_stream *stream;
-       php_socket_t this_fd;
+       php_socket_t this_fd = 0;
        int cnt = 0;
 
        if (Z_TYPE_P(stream_array) != IS_ARRAY) {
@@ -610,7 +610,7 @@
        zval **elem, **dest_elem;
        php_stream *stream;
        HashTable *new_hash;
-       php_socket_t this_fd;
+       php_socket_t this_fd = 0;
        int ret = 0;
 
        if (Z_TYPE_P(stream_array) != IS_ARRAY) {


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

[2007-10-12 10:10:34] [EMAIL PROTECTED]

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

Reply via email to