php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78995 opcache.preloading results in zend_mm_heap corrupted
Submitted: 2019-12-19 08:47 UTC Modified: 2020-01-28 16:05 UTC
Votes:7
Avg. Score:4.6 ± 0.7
Reproduced:6 of 6 (100.0%)
Same Version:5 (83.3%)
Same OS:0 (0.0%)
From: patrick dot fazzi at ped dot technology Assigned:
Status: Open Package: opcache
PHP Version: 7.4.1 OS: Ubuntu 18.4
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: patrick dot fazzi at ped dot technology
New email:
PHP Version: OS:

 

 [2019-12-19 08:47 UTC] patrick dot fazzi at ped dot technology
Description:
------------
I am testing the new preloading feature but it still doesn't work. If i run the built in web server with the following command:

php -dopcache.preload="/projects/PED/NutriBees/var/cache/prod/srcApp_KernelProdContainer.preload.php" -dopcache.enable=1 -S localhost:8090

I get this output:
[Thu Dec 19 09:44:04 2019] PHP Warning:  Can't preload already declared class Symfony\Bundle\FrameworkBundle\DependencyInjection\CompatibilityServiceSubscriberInterface in /projects/PED/NutriBees/vendor/symfony/framework-bundle/DependencyInjection/CompatibilityServiceSubscriberInterface.php on line 28
[Thu Dec 19 09:44:04 2019] PHP Warning:  Can't preload already declared class Doctrine\Common\Persistence\Mapping\Driver\SymfonyFileLocator in /projects/PED/NutriBees/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Mapping/Driver/SymfonyFileLocator.php on line 28
[Thu Dec 19 09:44:04 2019] PHP Warning:  Can't preload already declared class Doctrine\Common\Persistence\Mapping\Driver\AnnotationDriver in /projects/PED/NutriBees/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Mapping/Driver/AnnotationDriver.php on line 28
[Thu Dec 19 09:44:04 2019] PHP Warning:  Can't preload already declared class Doctrine\Common\Persistence\Mapping\Driver\FileLocator in /projects/PED/NutriBees/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Mapping/Driver/FileLocator.php on line 28
[Thu Dec 19 09:44:04 2019] PHP Warning:  Can't preload already declared class Doctrine\Common\Persistence\Mapping\Driver\FileDriver in /projects/PED/NutriBees/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php on line 28
[Thu Dec 19 09:44:04 2019] PHP Warning:  Can't preload already declared class Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain in /projects/PED/NutriBees/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php on line 28
[Thu Dec 19 09:44:04 2019] PHP Warning:  Can't preload already declared class Doctrine\Common\Persistence\Event\LifecycleEventArgs in /projects/PED/NutriBees/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php on line 28
[Thu Dec 19 09:44:04 2019] PHP Warning:  Can't preload already declared class Doctrine\Common\Persistence\Event\LoadClassMetadataEventArgs in /projects/PED/NutriBees/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php on line 28
[Thu Dec 19 09:44:04 2019] PHP Warning:  Can't preload already declared class Doctrine\Common\Persistence\Event\ManagerEventArgs in /projects/PED/NutriBees/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php on line 28
[Thu Dec 19 09:44:04 2019] PHP Warning:  Can't preload already declared class class@anonymous in /projects/PED/NutriBees/vendor/symfony/service-contracts/ServiceLocatorTrait.php on line 119
[Thu Dec 19 09:44:04 2019] PHP Warning:  Can't preload already declared class class@anonymous in /projects/PED/NutriBees/vendor/symfony/service-contracts/ServiceLocatorTrait.php on line 113
[Thu Dec 19 09:44:04 2019] PHP Warning:  Can't preload already declared class class@anonymous in /projects/PED/NutriBees/vendor/symfony/cache-contracts/CacheTrait.php on line 44
[Thu Dec 19 09:44:04 2019] PHP Warning:  Can't preload already declared class Symfony\Contracts\EventDispatcher\EventDispatcherInterface in /projects/PED/NutriBees/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php on line 20
[Thu Dec 19 09:44:04 2019] PHP Warning:  Can't preload already declared class Doctrine\Common\Persistence\Mapping\ClassMetadata in /projects/PED/NutriBees/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Mapping/ClassMetadata.php on line 28
[Thu Dec 19 09:44:04 2019] PHP Warning:  Can't preload already declared class Doctrine\Common\Persistence\Mapping\Driver\MappingDriver in /projects/PED/NutriBees/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriver.php on line 28
[Thu Dec 19 09:44:04 2019] PHP Warning:  Can't preload already declared class Doctrine\Common\Persistence\ObjectManager in /projects/PED/NutriBees/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/ObjectManager.php on line 28
[Thu Dec 19 09:44:04 2019] PHP Warning:  Can't preload already declared class Doctrine\Common\Persistence\ObjectRepository in /projects/PED/NutriBees/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/ObjectRepository.php on line 28
[Thu Dec 19 09:44:04 2019] PHP Warning:  Can't preload already declared class class@anonymous in /projects/PED/NutriBees/vendor/symfony/http-kernel/Kernel.php on line 540
[Thu Dec 19 09:44:04 2019] PHP Warning:  Can't preload already declared class League\Uri\Schemes\Ws in /projects/PED/NutriBees/vendor/league/uri-schemes/src/Schemes/deprecated.php on line 98
[Thu Dec 19 09:44:04 2019] PHP Warning:  Can't preload already declared class League\Uri\Schemes\UriException in /projects/PED/NutriBees/vendor/league/uri-schemes/src/Schemes/deprecated.php on line 88
[Thu Dec 19 09:44:04 2019] PHP Warning:  Can't preload already declared class League\Uri\Schemes\Uri in /projects/PED/NutriBees/vendor/league/uri-schemes/src/Schemes/deprecated.php on line 78
[Thu Dec 19 09:44:04 2019] PHP Warning:  Can't preload already declared class League\Uri\Schemes\Http in /projects/PED/NutriBees/vendor/league/uri-schemes/src/Schemes/deprecated.php on line 68
[Thu Dec 19 09:44:04 2019] PHP Warning:  Can't preload already declared class League\Uri\Schemes\Ftp in /projects/PED/NutriBees/vendor/league/uri-schemes/src/Schemes/deprecated.php on line 58
[Thu Dec 19 09:44:04 2019] PHP Warning:  Can't preload already declared class League\Uri\Schemes\File in /projects/PED/NutriBees/vendor/league/uri-schemes/src/Schemes/deprecated.php on line 48
[Thu Dec 19 09:44:04 2019] PHP Warning:  Can't preload already declared class League\Uri\Schemes\Data in /projects/PED/NutriBees/vendor/league/uri-schemes/src/Schemes/deprecated.php on line 38
[Thu Dec 19 09:44:04 2019] PHP Warning:  Can't preload already declared class League\Uri\Schemes\AbstractUri in /projects/PED/NutriBees/vendor/league/uri-schemes/src/Schemes/deprecated.php on line 28
zend_mm_heap corrupted



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-12-19 08:52 UTC] nikic@php.net
Some issues related to preloading with Symfony will only be resolved in 7.4.2. It's hard to say whether the problem you're seeing is one of those or something new.
 [2019-12-19 14:18 UTC] n_avatar at mail dot ru
Have same problem.
Found that doctrine/persistence >=1.3 lead to "zend_mm_heap corrupted".
"doctrine/persistence": "^1.2 <1.3" - fine
 [2019-12-19 14:42 UTC] nikic@php.net
This is likely related to class aliases added by Doctrine, in which case 7.4.2 should resolve the issue.
 [2020-01-05 02:47 UTC] myaddressmail at gmail dot com
Same with Twig (without doctrine) => Zend_mm_heap corrupted at server startup

Without Twig (removed from the preloading) => it works
 [2020-01-11 19:38 UTC] tobias dot nyholm at gmail dot com
I just tried in PHP 7.4.2RC1. I have the same problem. 

Im using OSX 10.15 and I tried preloading on a Symfony 4.4 application. I got the following output when trying to start PHP-fpm. 



➜  7.4.2RC1 ./sbin/php-fpm
[11-Jan-2020 20:28:43] NOTICE: PHP message: PHP Warning:  Can't preload already declared class Symfony\Bundle\FrameworkBundle\DependencyInjection\CompatibilityServiceSubscriberInterface in /project/vendor/symfony/framework-bundle/DependencyInjection/CompatibilityServiceSubscriberInterface.php on line 28
[11-Jan-2020 20:28:43] NOTICE: PHP message: PHP Warning:  Can't preload already declared class Translation\Bundle\Translator\TranslatorInterface in /project/vendor/php-translation/symfony-bundle/Translator/TranslatorInterface.php on line 32
[11-Jan-2020 20:28:43] NOTICE: PHP message: PHP Warning:  Can't preload already declared class Doctrine\Common\Persistence\Event\LoadClassMetadataEventArgs in /project/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php on line 13
[11-Jan-2020 20:28:43] NOTICE: PHP message: PHP Warning:  Can't preload already declared class Doctrine\Common\Persistence\Event\ManagerEventArgs in /project/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php on line 13
[11-Jan-2020 20:28:43] NOTICE: PHP message: PHP Warning:  Can't preload already declared class Doctrine\Common\Persistence\Mapping\ClassMetadata in /project/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Mapping/ClassMetadata.php on line 13
[11-Jan-2020 20:28:43] NOTICE: PHP message: PHP Warning:  Can't preload already declared class Doctrine\Common\Persistence\Mapping\Driver\MappingDriver in /project/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriver.php on line 13
[11-Jan-2020 20:28:43] NOTICE: PHP message: PHP Warning:  Can't preload already declared class Doctrine\Common\Persistence\AbstractManagerRegistry in /project/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php on line 13
[11-Jan-2020 20:28:43] NOTICE: PHP message: PHP Warning:  Can't preload already declared class Doctrine\Common\Persistence\ManagerRegistry in /project/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/ManagerRegistry.php on line 13
[11-Jan-2020 20:28:43] NOTICE: PHP message: PHP Warning:  Can't preload already declared class Doctrine\Common\Persistence\ConnectionRegistry in /project/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/ConnectionRegistry.php on line 13
[11-Jan-2020 20:28:43] NOTICE: PHP message: PHP Warning:  Can't preload already declared class Twig_Extension_GlobalsInterface in /project/vendor/twig/twig/lib/Twig/Extension/GlobalsInterface.php on line 11
[11-Jan-2020 20:28:43] NOTICE: PHP message: PHP Warning:  Can't preload already declared class class@anonymous in /project/vendor/symfony/contracts/Service/ServiceLocatorTrait.php on line 119
[11-Jan-2020 20:28:43] NOTICE: PHP message: PHP Warning:  Can't preload already declared class class@anonymous in /project/vendor/symfony/contracts/Service/ServiceLocatorTrait.php on line 113
[11-Jan-2020 20:28:43] NOTICE: PHP message: PHP Warning:  Can't preload already declared class Symfony\Contracts\EventDispatcher\EventDispatcherInterface in /project/vendor/symfony/contracts/EventDispatcher/EventDispatcherInterface.php on line 20
[11-Jan-2020 20:28:43] NOTICE: PHP message: PHP Warning:  Can't preload already declared class class@anonymous in /project/vendor/symfony/contracts/Cache/CacheTrait.php on line 44
[11-Jan-2020 20:28:43] NOTICE: PHP message: PHP Warning:  Can't preload already declared class class@anonymous in /project/vendor/symfony/http-kernel/Kernel.php on line 540
[11-Jan-2020 20:28:43] NOTICE: PHP message: PHP Warning:  Can't preload already declared class Doctrine\Common\Persistence\ObjectManager in /project/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/ObjectManager.php on line 13
[11-Jan-2020 20:28:43] NOTICE: PHP message: PHP Warning:  Can't preload already declared class APCUIterator in /project/vendor/symfony/polyfill-apcu/bootstrap.php on line 41
<br />
<b>Warning</b>:  Can't preload already declared class Symfony\Bundle\FrameworkBundle\DependencyInjection\CompatibilityServiceSubscriberInterface in <b>/project/vendor/symfony/framework-bundle/DependencyInjection/CompatibilityServiceSubscriberInterface.php</b> on line <b>28</b><br />
<br />
<b>Warning</b>:  Can't preload already declared class Translation\Bundle\Translator\TranslatorInterface in <b>/project/vendor/php-translation/symfony-bundle/Translator/TranslatorInterface.php</b> on line <b>32</b><br />
<br />
<b>Warning</b>:  Can't preload already declared class Doctrine\Common\Persistence\Event\LoadClassMetadataEventArgs in <b>/project/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php</b> on line <b>13</b><br />
<br />
<b>Warning</b>:  Can't preload already declared class Doctrine\Common\Persistence\Event\ManagerEventArgs in <b>/project/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php</b> on line <b>13</b><br />
<br />
<b>Warning</b>:  Can't preload already declared class Doctrine\Common\Persistence\Mapping\ClassMetadata in <b>/project/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Mapping/ClassMetadata.php</b> on line <b>13</b><br />
<br />
<b>Warning</b>:  Can't preload already declared class Doctrine\Common\Persistence\Mapping\Driver\MappingDriver in <b>/project/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriver.php</b> on line <b>13</b><br />
<br />
<b>Warning</b>:  Can't preload already declared class Doctrine\Common\Persistence\AbstractManagerRegistry in <b>/project/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php</b> on line <b>13</b><br />
<br />
<b>Warning</b>:  Can't preload already declared class Doctrine\Common\Persistence\ManagerRegistry in <b>/project/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/ManagerRegistry.php</b> on line <b>13</b><br />
<br />
<b>Warning</b>:  Can't preload already declared class Doctrine\Common\Persistence\ConnectionRegistry in <b>/project/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/ConnectionRegistry.php</b> on line <b>13</b><br />
<br />
<b>Warning</b>:  Can't preload already declared class Twig_Extension_GlobalsInterface in <b>/project/vendor/twig/twig/lib/Twig/Extension/GlobalsInterface.php</b> on line <b>11</b><br />
<br />
<b>Warning</b>:  Can't preload already declared class class@anonymous in <b>/project/vendor/symfony/contracts/Service/ServiceLocatorTrait.php</b> on line <b>119</b><br />
<br />
<b>Warning</b>:  Can't preload already declared class class@anonymous in <b>/project/vendor/symfony/contracts/Service/ServiceLocatorTrait.php</b> on line <b>113</b><br />
<br />
<b>Warning</b>:  Can't preload already declared class Symfony\Contracts\EventDispatcher\EventDispatcherInterface in <b>/project/vendor/symfony/contracts/EventDispatcher/EventDispatcherInterface.php</b> on line <b>20</b><br />
<br />
<b>Warning</b>:  Can't preload already declared class class@anonymous in <b>/project/vendor/symfony/contracts/Cache/CacheTrait.php</b> on line <b>44</b><br />
<br />
<b>Warning</b>:  Can't preload already declared class class@anonymous in <b>/project/vendor/symfony/http-kernel/Kernel.php</b> on line <b>540</b><br />
<br />
<b>Warning</b>:  Can't preload already declared class Doctrine\Common\Persistence\ObjectManager in <b>/project/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/ObjectManager.php</b> on line <b>13</b><br />
<br />
<b>Warning</b>:  Can't preload already declared class APCUIterator in <b>/project/vendor/symfony/polyfill-apcu/bootstrap.php</b> on line <b>41</b><br />
[11-Jan-2020 20:28:43] NOTICE: PHP message: PHP Warning:  Can't preload already declared class Throwable in /project/vendor/hoa/consistency/Consistency.php on line 286
zend_mm_heap corrupted
 [2020-01-11 19:49 UTC] tobias dot nyholm at gmail dot com
Sorry, I was wrong. I was running PHP 7.4.2RC1 with Opcache 7.4.1

➜  7.4.2RC1 ./bin/php -v
PHP 7.4.2RC1 (cli) (built: Jan 11 2020 19:52:52) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.1, Copyright (c), by Zend Technologies
 [2020-01-28 13:29 UTC] anhchienhoang at gmail dot com
I have the same issue:


    [28-Jan-2020 13:21:50] NOTICE: PHP message: PHP Warning:  Can't preload already declared class Symfony\Bundle\FrameworkBundle\DependencyInjection\CompatibilityServiceSubscriberInterface in /project/vendor/symfony/framework-bundle/DependencyInjection/CompatibilityServiceSubscriberInterface.php on line 28
    [28-Jan-2020 13:21:50] NOTICE: PHP message: PHP Warning:  Can't preload unlinked class class@anonymous: Unknown interface Psr\Container\ContainerExceptionInterface in /project/vendor/symfony/service-contracts/ServiceLocatorTrait.php on line 119
    [28-Jan-2020 13:21:50] NOTICE: PHP message: PHP Warning:  Can't preload unlinked class class@anonymous: Unknown interface Psr\Container\NotFoundExceptionInterface in /project/vendor/symfony/service-contracts/ServiceLocatorTrait.php on line 113
    [28-Jan-2020 13:21:50] NOTICE: PHP message: PHP Warning:  Can't preload already declared class Doctrine\Common\Persistence\ObjectManager in /project/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/ObjectManager.php on line 13
    [28-Jan-2020 13:21:50] NOTICE: PHP message: PHP Warning:  Can't preload already declared class Doctrine\Common\Persistence\AbstractManagerRegistry in /project/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php on line 13
    [28-Jan-2020 13:21:50] NOTICE: PHP message: PHP Warning:  Can't preload already declared class Doctrine\Common\Persistence\ManagerRegistry in /project/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/ManagerRegistry.php on line 13
    [28-Jan-2020 13:21:50] NOTICE: PHP message: PHP Warning:  Can't preload already declared class Doctrine\Common\Persistence\ConnectionRegistry in /project/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/ConnectionRegistry.php on line 13
    [28-Jan-2020 13:21:50] NOTICE: PHP message: PHP Warning:  Can't preload already declared class Symfony\Contracts\EventDispatcher\EventDispatcherInterface in /project/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php on line 41
    [28-Jan-2020 13:21:50] NOTICE: PHP message: PHP Warning:  Can't preload unlinked class class@anonymous: Unknown parent Symfony\Component\Config\ConfigCache in /project/vendor/symfony/http-kernel/Kernel.php on line 540


php -v
PHP 7.4.2 (cli) (built: Jan 23 2020 11:21:13) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.2, Copyright (c), by Zend Technologies
    with Xdebug v2.9.1, Copyright (c) 2002-2020, by Derick Rethans
 [2020-01-28 13:36 UTC] nikic@php.net
@anhchienhoang at gmail dot com: These warnings can be ignored. Or do you get a crash afterwards?
 [2020-01-28 15:52 UTC] anhchienhoang at gmail dot com
@nikic I got crashes afterwards, php-fpm stop working.
 [2020-01-28 16:05 UTC] nikic@php.net
@anhchienhoang at gmail dot com: Do you use opcache.preload_user? If you do, then the crashes are due to bug #79128.
 [2020-01-28 16:48 UTC] anhchienhoang at gmail dot com
@nikic yes! I put www-data. Thanks for your info.
 [2020-12-18 16:05 UTC] tobias dot nyholm at gmail dot com
In a different application I got more `zend_mm_heap corrupted` errors. 
The application seams to be running fine, but having a corrupted heap is never fun. 

After disabling preloading, the error message went away. Ideally I'll provide you with a small reproducer, but I have not been able to create one. The application in question is open sourced and running on Symfony cloud. 

Related PR: https://github.com/carsonbot/carsonbot/pull/145


PHP 7.4.11 (cli) ( ZTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.11, Copyright (c), by Zend Technologies
 [2021-01-19 12:44 UTC] drmohctp at gmail dot com
same error code on Centos 7 running moodle 3.8. constant crash with zend_mm_heap corrupted during multiple plugins update. increase buffer output didn't help, as well as setting opcache.fast_shutdown to 0.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 18:01:29 2024 UTC