|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57249 Sutdown bug with runkit_import on a function-static variable
Submitted: 2006-09-20 06:26 UTC Modified: 2013-02-25 03:10 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: nicolas dot legland at free dot fr Assigned: pollita (profile)
Status: Closed Package: runkit (PECL)
PHP Version: 5.1.6 OS: Windows 2K/XP
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: nicolas dot legland at free dot fr
New email:
PHP Version: OS:


 [2006-09-20 06:26 UTC] nicolas dot legland at free dot fr
Using :
- Windows 2K or XP
- PHP CLI from binary package
- PHP_RUNKIT.DLL from PECL4Win binary package 2006-09-19 06:09:15 for php-5.1.2 (branch 5_1)

Reproduce code:

	// Import buggy method using runkit
	runkit_import('', RUNKIT_IMPORT_CLASS_METHODS);

	// Create buggy class object
	$g_oBuggyObject = new cBuggyClass();

	// Try to trigger the bug once

	// Buggy class initial definition
	class cBuggyClass



	// Add a method to cBuggyclass
	class cBuggyClass
		// Member function using a static cache
		public function mBuggyMethod()
			static $ls_a_iCache;

			// Debug trace
			echo 'mBuggyMethod();'.PHP_EOL;


Expected result:

Actual result:

and then a Windows error popup

"Instruction at 0x784ad989 reference memoty 0x178e6ba. The memory cannot be written."


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-20 06:36 UTC] nicolas dot legland at free dot fr
In fact, you don't actually need to instanciate the cBuggyClass, nor to invocate the mBuggyMethod. On the other hand, as soon as you remove the initial class definition, everything works fine. This is so far what I found to be stricly enough to trigger the error :

// In bug.php
class cBuggyClass

// In
class cBuggyClass
	public function mBuggyMethod()
		static $ls_Whatever;
 [2006-09-20 12:08 UTC] nicolas dot legland at free dot fr
Fixed typo in summary
 [2006-09-20 12:08 UTC]
Yeah, property importing is still a bit wonky...
 [2013-02-25 03:10 UTC]
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

The importing, along with a number of assumptions were indeed, a bit wonky.
 [2013-02-25 03:10 UTC]
-Status: Analyzed +Status: Closed -Assigned To: +Assigned To: pollita
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 20:01:31 2024 UTC