Bug #78014 [Asn->Csd]: Preloaded classes may depend on non-preloaded classes due to unresolved consts

From: Date: Mon, 20 May 2019 15:16:09 +0000
Subject: Bug #78014 [Asn->Csd]: Preloaded classes may depend on non-preloaded classes due to unresolved consts
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-220919@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78014&edit=1

 ID:                 78014
 Updated by:         dmitry@php.net
 Reported by:        nikic@php.net
 Summary:            Preloaded classes may depend on non-preloaded
                     classes due to unresolved consts
-Status:             Assigned
+Status:             Closed
 Type:               Bug
 Package:            Scripting Engine problem
 PHP Version:        master-Git-2019-05-15 (Git)
 Assigned To:        dmitry
 Block user comment: N
 Private report:     N

 New Comment:

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)


Previous Comments:
------------------------------------------------------------------------
[2019-05-15 09:56:56] 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.



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=78014&edit=1


Thread (2 messages)

« previous php.bugs (#220919) next »