From: alexander dot netkachev at gmail dot com
Operating system: Windows XP SP2
PHP version: 5.1.6
PHP Bug Type: Streams related
Bug description: Engine crash when "require" file with syntax error through
stream wrapper
Description:
------------
including or requiring a syntactically incorrect PHP file through stream
wrapper generate uncatchable system exception - program crash.
Reproduce code:
---------------
class Loader {
private $position;
private $data;
public function stream_open($path, $mode, $options, &$opened_path) {
$this->data = '<' . "?php \n\"\";ll l\n ?" . '>';
$this->position = 0;
return true;
}
function stream_read($count) {
$ret = substr($this->data, $this->position, $count);
$this->position += strlen($ret);
return $ret;
}
function stream_eof() {
return $this->position >= strlen($this->data);
}
}
stream_wrapper_register('Loader', 'Loader');
require_once 'Loader://qqq.php';
Expected result:
----------------
Just the "Parse error", not the program crash.
Actual result:
--------------
System exception with the following description:
AppName: php.exe
AppVer: 5.1.6.6
ModName: php5ts.dll
ModVer: 5.1.6.6
Offset: 000ad9cf
--
Edit bug report at http://bugs.php.net/?id=38779&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=38779&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=38779&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=38779&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38779&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=38779&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=38779&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=38779&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=38779&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=38779&r=support
Expected behavior: http://bugs.php.net/fix.php?id=38779&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=38779&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=38779&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38779&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38779&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38779&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=38779&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=38779&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=38779&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=38779&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=38779&r=mysqlcfg