php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78014 Preloaded classes may depend on non-preloaded classes due to unresolved consts
Submitted: 2019-05-15 09:56 UTC Modified: 2019-05-15 09:57 UTC
From: nikic@php.net Assigned: dmitry (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: master-Git-2019-05-15 (Git) OS:
Private report: No CVE-ID: None
 [2019-05-15 09:56 UTC] nikic@php.net
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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-05-15 09:57 UTC] nikic@php.net
-Assigned To: +Assigned To: dmitry
 [2019-05-20 15:16 UTC] dmitry@php.net
Automatic comment on behalf of dmitry@zend.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=f53b9939fe4f66e1a539a42d607fefbe45be6239
Log: Fixed bug #78014 (Preloaded classes may depend on non-preloaded classes due to unresolved consts)
 [2019-05-20 15:16 UTC] dmitry@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun May 26 18:01:26 2019 UTC