#25072 [Fbk->NoF]: include and user_space stream
| From: | sniper@php.net | Date: | Tue, 19 Aug 2003 00:45:50 +0000 |
| Subject: | #25072 [Fbk->NoF]: include and user_space stream | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-46158@lists.php.net to get a copy of this message | ||
ID: 25072
Updated by: sniper@php.net
Reported By: eduard at sitesupra dot com
-Status: Feedback
+Status: No Feedback
Bug Type: Reproducible crash
Operating System: WinXP
PHP Version: 4.3.3RC4-dev
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2003-08-13 13:52:57] pollita@php.net
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.
------------------------------------------------------------------------
[2003-08-13 13:26:31] pollita@php.net
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] sniper@php.net
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