|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-09-20 06:26 UTC] nicolas dot legland at free dot fr
Description:
------------
Using :
- Windows 2K or XP
- PHP CLI 5.1.6.6 from binary package
- PHP_RUNKIT.DLL 5.1.2.2 from PECL4Win binary package 2006-09-19 06:09:15 for php-5.1.2 (branch 5_1)
Reproduce code:
---------------
FROM MAIN "BUG.PHP"
<?php
// Import buggy method using runkit
runkit_import('bug.inc', RUNKIT_IMPORT_CLASS_METHODS);
// Create buggy class object
$g_oBuggyObject = new cBuggyClass();
// Try to trigger the bug once
$g_oBuggyObject->mBuggyMethod();
// Buggy class initial definition
class cBuggyClass
{
}
?>
FROM INCLUDED FILE "BUG.INC"
<?php
// Add a method to cBuggyclass
class cBuggyClass
{
// Member function using a static cache
public function mBuggyMethod()
{
// CRASH WITH THIS LINE UNCOMMENTED
static $ls_a_iCache;
// Debug trace
echo 'mBuggyMethod();'.PHP_EOL;
}
}
?>
Expected result:
----------------
"mBuggyMethod();"
Actual result:
--------------
"mBuggyMethod();"
and then a Windows error popup
"Instruction at 0x784ad989 reference memoty 0x178e6ba. The memory cannot be written."
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 17:00:01 2025 UTC |
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 runkit_import('bug.inc', RUNKIT_IMPORT_CLASS_METHODS); class cBuggyClass { } // In bug.inc class cBuggyClass { public function mBuggyMethod() { static $ls_Whatever; } }