Bug #66337 [NEW]: Wrong size calculation on optimization of class constants
| From: | Terry at ellisons dot org dot uk | Date: | Sun, 22 Dec 2013 18:07:23 +0000 |
| Subject: | Bug #66337 [NEW]: Wrong size calculation on optimization of class constants | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-183433@lists.php.net to get a copy of this message | ||
From: Terry at ellisons dot org dot uk
Operating system: N/A
PHP version: master-Git-2013-12-22 (Git)
Package: opcache
Bug Type: Bug
Bug description:Wrong size calculation on optimization of class constants
Description:
------------
I've been trying the current 5.6 against apps such as Mediawiki and was
getting Wrong size calculation errors logged. After some horrible
debugging I've reduced this down to a simple test case as attached.
When I run this:
Sun Dec 22 18:04:53 2013 (11692): Warning Internal error: wrong size
calculation: /tmp/Terry_006.inc start=0x258a88d0, end=0x258a9088,
real=0x258a9078
Now that I've got a simple repeatable test case, I'll degub the bug and
post a patch.
Test script:
---------------
--TEST--
Wrong size calculation on optimization of class constants
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.optimization_level=-1
opcache.file_update_protection=0
--SKIPIF--
<?php if (!extension_loaded('Zend OPcache') || php_sapi_name() != "cli")
die("skip CLI only"); ?>
--FILE--
<?php
class X { const A = "Constant"; }
$file = str_replace( ".php", ".inc", __file__ );
file_put_contents( $file,
'<?php class B { function __constuct() { $a = X::A; } }');
require $file;
new B;
@unlink($file);
echo "done\n";
?>
--EXPECT--
done
--
Edit bug report at https://bugs.php.net/bug.php?id=66337&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66337&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66337&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66337&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66337&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66337&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66337&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66337&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66337&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66337&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66337&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66337&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66337&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66337&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66337&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66337&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66337&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66337&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66337&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66337&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66337&r=mysqlcfg