|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38779 Engine crash when "require" file with syntax error through stream wrapper
Submitted: 2006-09-11 11:17 UTC Modified: 2006-09-11 14:30 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: alexander dot netkachev at gmail dot com Assigned: tony2001 (profile)
Status: Closed Package: Streams related
PHP Version: 5.1.6 OS: Windows XP SP2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: alexander dot netkachev at gmail dot com
New email:
PHP Version: OS:


 [2006-09-11 11:17 UTC] alexander dot netkachev at gmail dot com
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
ModName: php5ts.dll
Offset: 000ad9cf


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-11 14:30 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

 [2012-08-07 11:37 UTC]
Automatic comment from SVN on behalf of ab
Log: fixed bug where apc requires url_stat to be implemented for userspace stream wrappers in require
related to bug #62502, bug #61398, bug #38779
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jun 18 19:01:32 2024 UTC