ID:               25072
 Updated by:       [EMAIL PROTECTED]
 Reported By:      eduard at sitesupra dot com
 Status:           Feedback
 Bug Type:         Reproducible crash
 Operating System: WinXP
 PHP Version:      4.3.3RC4-dev
 New Comment:

As another developer just reminded me, generating backtraces on windows
isn't an option.

You mention having access to a linux machine, can you recompile your
PHP on that box using the configure option "--enable-experimental-zts"
(this will make it behave like its Win32 counterpart) and see if its
possible to recreate the crash there.  If so generate a backtrace from
that please.



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

[2003-08-13 13:26:31] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.

On the first point, the extra reads are include() being cautious.  It
doesn't EXPECT any data, but on the off chance the EOF status changed
(socket streams are allowed to do that) it double checks.

As to the crash though, that definately shouldn't be happening.  Could
you provide a backtrace using the instructions above?  It'll help track
the problem down.


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

[2003-08-13 05:49:41] eduard at sitesupra dot com

on 4.3.3RC4-dev same result as 4.3.2

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

[2003-08-13 05:30:36] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

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

[2003-08-13 05:26:23] eduard at sitesupra dot com

Description:
------------
On windows:

When you have include() from userstream
result of stream_eof() is ignored and stream_read() called 2 times
more

When few requests occur simultaneosly - apache crushes.

On Linux - this works correctly

Reproduce code:
---------------
<?php
class userstream
{
        var $position = 0;
        var $data = "If you can read this, it worked";
        function stream_open($path, $mode, $options, &$opened_path)
        {
                return true;
        }
        function stream_read($count)
        {
                $ret = substr($this->data, $this->position, $count);
                $this->position += strlen($ret);
                echo "READ {$this->position}\n";
                return $ret;
        }
        function stream_eof()
        {
                echo "EOF\n";
                return $this->position >= strlen($this->data);
        }
        function stream_seek($offset,$whence)
        {
                echo "SEEK\n";
        }
        function stream_tell()
        {
                echo "TELL\n";
                return $this->position;
        }
        function stream_stat()
        {
                echo "STAT\n";
                return NULL;
        }
        function stream_close()
        {
                echo "CLOSE\n";
        }
}
stream_register_wrapper("cookietest", "userstream");
include("cookietest://foo");
?>


Expected result:
----------------
SEEK
TELL
READ 31
EOF
CLOSE
If you can read this, it worked


Actual result:
--------------
SEEK
TELL
STAT
READ 31
EOF
READ 31
EOF
READ 31
EOF
CLOSE
If you can read this, it worked



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


-- 
Edit this bug report at http://bugs.php.net/?id=25072&edit=1

Reply via email to