Symfony => cache:clear => Segmentation fault (core dumped) : after upgrading from 10.17.0.7 to 10.18.0.8
fshsyno opened this issue ยท 7 comments
Description
- Prob 1 : cache:clear of symfony app not working (show a "segmentation default" error)
- Prob 2 : Lot of E_WARNING errors on other frameworks
Steps to Reproduce
mkdir testapp
cd testapp
git clone -b v2.4.0 https://github.com/symfony/demo.git my_project
cd my_project
composer install
php bin/console cache:clear
Expected Behavior
cache generated
Relevant Logs / Console output
no
Your Environment
PHP 8.1.2
Ubuntu 22
Additional context
Works with :
php -d newrelic.enabled=0 console cache:clear
Thank you for engaging here, we will investigate the segfault issue.
Regarding the E_WARNING, can you please provide some of the warnings and the name/version of the other frameworks?
Thank you for engaging here, we will investigate the segfault issue.
Regarding the E_WARNING, can you please provide some of the warnings and the name/version of the other frameworks?
E_WARNING :
Framework : Zend Framework (https://github.com/Shardj/zf1-future / version:1.21.4)
Message : "Trying to access array offset on value of type bool"
in DefaultController::postDispatch called at vendor/shardj/zf1-future/library/Zend/Controller/Action.php (521)
in Zend_Controller_Action::dispatch called at vendor/shardj/zf1-future/library/Zend/Controller/Dispatcher/Standard.php (308)
in Zend_Controller_Dispatcher_Standard::dispatch called at vendor/shardj/zf1-future/library/Zend/Controller/Front.php (954)
...
The Symfony demo app provided for replication lists PHP 8.2+ as a requirement, however it seems that you are running it with PHP 8.1. During testing, the seg-fault only seems to manifest when run on PHP 8.1, and not when run on PHP 8.2. Is there a particular reason why PHP 8.1 is being used here? Are you able to reproduce this issue in any other way while also meeting PHP version requirements?
Framework : Zend Framework (https://github.com/Shardj/zf1-future / version:1.21.4)
The Zend Framework being used is a community fork that seems to be breaking some of our instrumentation for Zend. This instrumentation was made around support for the official (and EOLed) Zend Framework, and the New Relic PHP Agent has never supported this community fork. Unfortunately this means that, even if our agent previously provided proper instrumentation in this case, there is no guarantee that it will now or in the future.
As we refresh and update the agent, we make changes to framework instrumentation to support newer PHP versions; however, code for older frameworks that do not support these later PHPs are not updated or tested on PHPs that those frameworks do not officially support. These combinations are not supported or guaranteed to work.
After further investigations, the segfault appears to be an issue outside of the PHP Agent. Even with the PHP Agent disabled, I am able to reproduce the issue (following the steps originally listed) by simply hooking into PHP's Observer API with an otherwise empty extension. The latest release (10.18.0.8) is the first time that the PHP Agent has utilized PHP's Observer API. Further, PHP Agent code only appears in the stack trace during the handling of the segfault.
This evidence leads me to recommend using PHP 8.2. That is the listed requirement for the symfony app and the issue has not presented itself with that PHP version.
The Symfony demo app provided for replication lists PHP 8.2+ as a requirement, however it seems that you are running it with PHP 8.1. During testing, the seg-fault only seems to manifest when run on PHP 8.1, and not when run on PHP 8.2. Is there a particular reason why PHP 8.1 is being used here? Are you able to reproduce this issue in any other way while also meeting PHP version requirements?
I used the symfony demo application (tag v2.4.0 for php8.1) for testing but the problem occurs on all our symfony projects under PHP 8.1.
The reason we're using PHP 8.1 is that our web hosting provider mutualizes the management of default PHP versions for Ubuntu OS (unfortunately Ubuntu 22 will never update PHP to version 8.2).
Regarding the WARNINGs of the Zend Framework fork, we will see if the problem cannot be corrected directly in the latter.
Thanks for your investigations about Observer API and the recommandation to upgrade to PHP 8.2.
We will see what we can do.
I used the symfony demo application (tag v2.4.0 for php8.1) for testing but the problem occurs on all our symfony projects under PHP 8.1.
Sorry I missed the change in the README. But the results of the investigation still hold. I am going to close out this issue, feel free to reopen if the problem persists into PHP 8.2