You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class Root1_Constant_Referencer extends Root2_Empty_Empty
// Removing the extends clause will cause preloading to succeed// Changing the extends clause to Root1_Constant_Empty will cause preloading to succeed// Changing the extends clause to a non-existent class will continue causing preloading to segfault
{
protected$propertyReferencingAnExternalConstant = Root1_Constant_Definer::CONSTANT;
// Removing this line will cause preloading to succeed// Changing this to a hardcoded value will cause preloading to succeed
}
$ docker-compose up
Recreating preload-segfault-minimum-reproduction_webpreloader_1 ...
Recreating preload-segfault-minimum-reproduction_webpreloader_1 ... done
Attaching to preload-segfault-minimum-reproduction_webpreloader_1
webpreloader_1 | Preload started.
webpreloader_1 | Finished preloading
preload-segfault-minimum-reproduction_webpreloader_1 exited with code 139
But I expected this output instead:
(No segmentation Fault. The following output occurs if you comment out the opcache_compile_file call in preload.php)
Running the docker-compose command in the linked repository will consistently reproduce the issue. This is a blocker for our PHP 8.1 migration. Will you please assist?
PHP Version
PHP 8.1.1 8.1.12 8.2
Operating System
Docker php:8.1.1-fpm-alpine3.15
The text was updated successfully, but these errors were encountered:
michdingpayc
changed the title
Segmentation Fault during OPCache Preload in PHP 8.1/PHP8.2
Segmentation Fault during OPCache Preload in PHP 8.1+
Nov 17, 2022
Here is a relevant detail I believe wasn't clear in my original posting.
After a composer install, Root2_Empty_Empty is not listed in the vendor/composer/autoload_classmap.php file. This is by design. I would expect the following warning:
Can't preload unlinked class Root1_Constant_Referencer: Unknown parent Root2_Empty_Empty in /var/www/html/lib/packages/Root1/src/Constant/Referencer.php on line 3
Indeed this warning shows (with no segmentation fault) when the reference to Root1_Constant_Definer::CONSTANT is removed from the problematic file. However, instead we see a segmentation fault. Interestingly, the file containing Root1_Constant_Definer is listed in the vendor/composer/autoload_classmap.php file and should be preloaded.
It seems to be related to BOTH an unknown parent class AND an external constant reference.
Description
Dear PHP Maintainers,
The following code, a barebones reproduction is available at https://github.com/michdingpayc/preload-segfault-minimum-reproduction
The problematic preloaded file:
preload.php:
Resulted in this output:
But I expected this output instead:
(No segmentation Fault. The following output occurs if you comment out the
opcache_compile_file
call in preload.php)Recommendations attempted: (in all cases the result is the same)
php:8.1.1-fpm-alpine3.15
tophp:8.1.12-fpm-alpine3.15
andphp:8.2-rc-fpm-alpine3.15
.opcache.jit
directive:disable
,0
,0000
,0205
,1205
.opcache.jit_buffer_size
directive to0
.Similar to #7817 though narrower in scope.
Running the docker-compose command in the linked repository will consistently reproduce the issue. This is a blocker for our PHP 8.1 migration. Will you please assist?
PHP Version
PHP 8.1.1 8.1.12 8.2
Operating System
Docker php:8.1.1-fpm-alpine3.15
The text was updated successfully, but these errors were encountered: