Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfaults with Symfony 7.2 and PHP 8.4 #1024

Open
mvanduijker opened this issue Feb 17, 2025 · 8 comments
Open

Segfaults with Symfony 7.2 and PHP 8.4 #1024

mvanduijker opened this issue Feb 17, 2025 · 8 comments
Labels
bug Something isn't working support Redirect issue to support channels

Comments

@mvanduijker
Copy link

Segfaults with Symfony 7.2 and PHP 8.4

Description

Looks like a combination with symfony request payload resolver and normalizer/serializer in PHP 8.4 with new relic enabled leads to segfaults. Using extension version 11.5.0.18 with PHP 8.4.4 and Symfony 7.2.3.
Using php 8.3 with the new relic extension the same code works. Using php 8.4 and new relic extension disabled also works. I guess there is something wrong with the latest extension of new relic.

Steps to Reproduce

Create a symfony project with an endpoint using MapQueryString with php 8.4

Expected Behavior

no segfaults

Relevant Logs / Console output

php-fpm log

Process 36 (version 11.5.0.18) received signal 11: segmentation violation
process id 1 fatal signal (SIGSEGV, SIGFPE, SIGILL, SIGBUS, ...)  - stack dump follows (code=0xffffb7960000 bss=0xffffb7a7e22c):
/usr/local/lib/php/extensions/no-debug-non-zts-20240924/newrelic.so(+0x7c194)[0xffffb79dc194]
/usr/local/lib/php/extensions/no-debug-non-zts-20240924/newrelic.so(+0x4ab24)[0xffffb79aab24]
linux-vdso.so.1(__kernel_rt_sigreturn+0x0)[0xffffbc059868]
php-fpm: pool www(+0x16249c)[0xaaaae49a249c]
php-fpm: pool www(execute_ex+0xbd30)[0xaaaae4de2860]
php-fpm: pool www(zend_execute+0x11c)[0xaaaae4dd51c0]
php-fpm: pool www(zend_execute_script+0x68)[0xaaaae4e41c68]
php-fpm: pool www(php_execute_script_ex+0x138)[0xaaaae4ccc908]
php-fpm: pool www(+0x166314)[0xaaaae49a6314]
/lib/aarch64-linux-gnu/libc.so.6(+0x27740)[0xffffbb327740]
/lib/aarch64-linux-gnu/libc.so.6(__libc_start_main+0x98)[0xffffbb327818]
php-fpm: pool www(_start+0x30)[0xaaaae49a6eb0]
PHP execution trace follows...
#0 Symfony\Component\TypeInfo\TypeIdentifier->from()
#1 Symfony\Component\TypeInfo\TypeResolver\ReflectionTypeResolver->resolve() called at [/var/www/vendor/symfony/type-info/TypeResolver/ReflectionParameterTypeResolver.php:42]
#2 Symfony\Component\TypeInfo\TypeResolver\ReflectionParameterTypeResolver->resolve() called at [/var/www/vendor/symfony/type-info/TypeResolver/TypeResolver.php:59]
#3 Symfony\Component\TypeInfo\TypeResolver\TypeResolver->resolve() called at [/var/www/vendor/symfony/property-info/Extractor/ReflectionExtractor.php:638]
#4 Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor->extractTypeFromConstructor() called at [/var/www/vendor/symfony/property-info/Extractor/ReflectionExtractor.php:236]
#5 Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor->getType() called at [/var/www/vendor/symfony/property-info/PropertyInfoExtractor.php:70]
#6 Symfony\Component\PropertyInfo\PropertyInfoExtractor->getType() called at [/var/www/vendor/symfony/property-info/PropertyInfoCacheExtractor.php:87]
#7 Symfony\Component\PropertyInfo\PropertyInfoCacheExtractor->getType() called at [/var/www/vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php:990]
#8 Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer->getPropertyType() called at [/var/www/vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php:960]
#9 Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer->getType() called at [/var/www/vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php:929]
#10 Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer->denormalizeParameter() called at [/var/www/vendor/symfony/serializer/Normalizer/AbstractNormalizer.php:374]
#11 Symfony\Component\Serializer\Normalizer\AbstractNormalizer->instantiateObject() called at [/var/www/vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php:243]
#12 Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer->instantiateObject() called at [/var/www/vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php:339]
#13 Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer->denormalize() called at [/var/www/vendor/symfony/serializer/Serializer.php:220]
#14 Symfony\Component\Serializer\Serializer->denormalize() called at [/var/www/vendor/symfony/http-kernel/Controller/ArgumentResolver/RequestPayloadValueResolver.php:191]
#15 Symfony\Component\HttpKernel\Controller\ArgumentResolver\RequestPayloadValueResolver->mapQueryString() called at [/var/www/vendor/symfony/http-kernel/Controller/ArgumentResolver/RequestPayloadValueResolver.php:126] declared at [/var/www/vendor/symfony/http-kernel/Controller/ArgumentResolver/RequestPayloadValueResolver.php:185]
#16 Symfony\Component\HttpKernel\Controller\ArgumentResolver\RequestPayloadValueResolver->onKernelControllerArguments() called at [/var/www/vendor/symfony/event-dispatcher/EventDispatcher.php:246] declared at [/var/www/vendor/symfony/http-kernel/Controller/ArgumentResolver/RequestPayloadValueResolver.php:100]
#17 Symfony\Component\EventDispatcher\EventDispatcher->{closure:Symfony\Component\EventDispatcher\EventDispatcher::optimizeListeners():241}() called at [/var/www/vendor/symfony/event-dispatcher/EventDispatcher.php:206] declared at [/var/www/vendor/symfony/event-dispatcher/EventDispatcher.php:241]
#18 Symfony\Component\EventDispatcher\EventDispatcher->callListeners() called at [/var/www/vendor/symfony/event-dispatcher/EventDispatcher.php:56]
#19 Symfony\Component\EventDispatcher\EventDispatcher->dispatch() called at [/var/www/vendor/symfony/http-kernel/HttpKernel.php:178]
#20 Symfony\Component\HttpKernel\HttpKernel->handleRaw() called at [/var/www/vendor/symfony/http-kernel/HttpKernel.php:76]
#21 Symfony\Component\HttpKernel\HttpKernel->handle() called at [/var/www/vendor/symfony/http-kernel/Kernel.php:182]
#22 Symfony\Component\HttpKernel\Kernel->handle() called at [/var/www/vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35]
#23 Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() called at [/var/www/vendor/autoload_runtime.php:29]
#24 require_once() called at [/var/www/public/index.php:5]
#25 unknown() called at [/var/www/public/index.php:5]

Your Environment

  • Docker image with 8.4.4-fpm-bookworm
  • Symfony 7.2.3

Additional context

@mvanduijker mvanduijker added the bug Something isn't working label Feb 17, 2025
@newrelic-php-agent-bot
Copy link

Thank you for your issue report. A member of the New Relic PHP Agent Team will review your report and endeavor to respond in a timely manner.
Need troubleshooting help? Please review some of our common troubleshooting documentation, starting with generating debug logs. From there, additional resources and tips are available in our troubleshooting section, accessible from the left-hand panel of our documentation site. Additionally, please be sure to visit our Explorer's Hub, where other members of the community may have solved an issue similar to yours with the help of our Support team members.
Have a question regarding support for an Operating System, PHP Version, Framework, or Library? Please take a look at our Compatibility Docs.
Binary support for ARM-based CPU architecture is now available via the tarball installation method for PHP Versions 8.0+!
General installation instructions can be found on our Installation Overview page.
Need more information about an Agent INI setting? Our Configuration page contains an explanation for each INI setting and how to modify the defaults.
Looking for something else? All New Relic PHP Agent Documentation can be found under our Introduction page.

@ZNeumann ZNeumann added the support Redirect issue to support channels label Feb 21, 2025
@newrelic-php-agent-bot
Copy link

This issue has been identified as requiring additional information to debug. Due to the potentially sensitive nature of the information we may have to collect, such as PHPInfo and Debug Logs, please follow these steps to create a support case, where a member of our New Relic Support Team will work with you to gather the necessary information securely and help debug your issue.
If your subscription level does not include technical support, the other option available to customers is to use New Relic’s community support channel: Explorers Hub. From there, a member of our New Relic Support Team will work with you to gather the necessary information securely and help debug your issue. For all available options on how to get support, please see these resources.

@ZNeumann
Copy link
Contributor

Hi @mvanduijker we have been unable to reproduce this issue on our end. Please follow the steps listed above to get in contact with New Relic support so that we may collect more information to help fix this issue.

In the meantime, please take a look at this troubleshooting page. While the stack trace provided doesn't perfectly match the one in the doc, there is a consistency: the PHP Agent doesn't appear in the trace until after the segfault, where our signal handler kicks in.

@dbrkv
Copy link

dbrkv commented Feb 22, 2025

running into the same issue with nr ext 11.5.0.18

Docker 8.4-fpm-alpine
Symfony 7.2.3

@mvanduijker
Copy link
Author

@ZNeumann we are in contact with our account manager.
We made some progress, when we turn off opcache it's working again. It's also segfaulting with the zend_test.observer

@trisua
Copy link

trisua commented Feb 25, 2025

this issue is reproduced when using opcache.preload
if preload is disabled then everything works

@ZNeumann
Copy link
Contributor

@mvanduijker given that the segfault persists without the PHP Agent but with zend_test.observer, I am inclined to believe that this is an issue with php-src. The next step is likely to be working with them over on that repo. If you continue through New Relic support, we may be able to find a solution in the interim.

@mvanduijker
Copy link
Author

I can confirm that turning off opcache.preload stops the segfaults.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working support Redirect issue to support channels
Projects
None yet
Development

No branches or pull requests

5 participants