Bug #78014 [NEW]: Preloaded classes may depend on non-preloaded classes due to unresolved consts
From: nikic
Operating system:
PHP version: master-Git-2019-05-15 (Git)
Package: Scripting Engine problem
Bug Type: Bug
Bug description:Preloaded classes may depend on non-preloaded classes due to unresolved consts
Description:
------------
Test scripts in
https://gist.github.com/nikic/39960cf61b18803fa522e6287cdb17cc.
Run with
-d opcache.preload=p1.php p3.php.
To make the failure more obvious, add
$r = new ReflectionClass('C');
var_dump((string) $r->getParentClass());
to p3.php, as this will trigger an assertion failure.
The problem is that class B is removed from the preload state, because
it has unresolved constants. However, class C is already linked to it.
Then, at runtime, we may replace B with a different class.
--
Edit bug report at https://bugs.php.net/bug.php?id=78014&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=78014&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=78014&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=78014&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=78014&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=78014&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=78014&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=78014&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=78014&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=78014&r=support
Expected behavior: https://bugs.php.net/fix.php?id=78014&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=78014&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=78014&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=78014&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=78014&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=78014&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=78014&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=78014&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=78014&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=78014&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=78014&r=mysqlcfg
Thread (2 messages)
- nikic@php.net