Bug #78514 [Asn->Csd]: Preloading segfaults with inherited typed property

From: Date: Mon, 09 Sep 2019 09:37:46 +0000
Subject: Bug #78514 [Asn->Csd]: Preloading segfaults with inherited typed property
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-222637@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78514&edit=1 ID: 78514 Updated by: nikic@php.net Reported by: kocsismate at woohoolabs dot com Summary: Preloading segfaults with inherited typed property -Status: Assigned +Status: Closed Type: Bug Package: opcache Operating System: Alpine Linux 3.10 PHP Version: 7.4.0RC1 Assigned To: nikic Block user comment: N Private report: N New Comment: Automatic comment on behalf of nikita.ppv@gmail.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=36a8cf5182f8320270031d29d04b3a6acb3168d2 Log: Fixed bug #78514 Previous Comments: ------------------------------------------------------------------------ [2019-09-09 09:28:37] nikic@php.net I believe what happens here is that a class-typed property is inherited and shared by two classes. We translate the class to SHM when visiting one class and then try to do it again when visiting the second, at which point the xlat lookup fails. ------------------------------------------------------------------------ [2019-09-09 09:00:03] nikic@php.net php: /home/nikic/php-7.4/ext/opcache/zend_persist.c:934: zend_update_parent_ce: Assertion `ce' failed. ------------------------------------------------------------------------ [2019-09-08 20:02:40] kocsismate at woohoolabs dot com Description: ------------ I tried out preloading by generating the preload file for a personal project of mine using my DI container (https://github.com/woohoolabs/zen#generating-a-preload-file). After some struggle, I got it work, so I managed to preload all the files I wanted with PHP 7.4 beta 1 (via Docker). However, something could happen after some time because preloading stopped working, and I got a segfault on each PHP startup. I don't know if it is only a coincidence, but the first time I noticed it is around when I introduced property type declarations everywhere in my app and in some of my open-source libraries (which are also preloaded). Now, that I still have this problem on PHP 7.4 RC1, I thought it's time to report it. Test script: --------------- This is the most minimal example I could come up with: - Download and unzip the following gist: https://gist.github.com/kocsismate/d7f71f5da9e1cefbbdbee040b49c1984 - Run "composer install" - Run "docker-compose up" ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=78514&edit=1

« previous php.bugs (#222637) next »