Skip to content
New issue

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

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

Already on GitHub? # to your account

SIGSEGV when running PHP 8.3/8.4 (with docker) #17875

Open
thueske opened this issue Feb 21, 2025 · 3 comments
Open

SIGSEGV when running PHP 8.3/8.4 (with docker) #17875

thueske opened this issue Feb 21, 2025 · 3 comments

Comments

@thueske
Copy link

thueske commented Feb 21, 2025

Description

Hey,

First of all, sorry if the issue is wrong here. Please let me know if this is better placed in the Docker-PHP repository.

I use the following image:
https://github.com/docker-library/wordpress/blob/470084224c4a2b4f0c2e19da2af9ab96298739e4/latest/php8.3/fpm-alpine/Dockerfile

For a few weeks now, I have been getting the following errors regularly:

app-1 | [18-Feb-2025 18:50:51] NOTICE: fpm is running, pid 1
app-1 | [18-Feb-2025 18:50:51] NOTICE: ready to handle connections
app-1 | [21-Feb-2025 03:40:39] WARNING: [pool www] child 4048 exited on signal 11 (SIGSEGV - core dumped) after 6183.845205 seconds from start
app-1 | [21-Feb-2025 03:40:39] NOTICE: [pool www] child 4176 started
app-1 | [21-Feb-2025 03:41:40] WARNING: [pool www] child 4145 exited on signal 11 (SIGSEGV - core dumped) after 1380.445253 seconds from start
app-1 | [21-Feb-2025 03:41:40] NOTICE: [pool www] child 4177 started
app-1 | [21-Feb-2025 03:42:40] WARNING: [pool www] child 3920 exited on signal 11 (SIGSEGV - core dumped) after 12647.115671 seconds from start
app-1 | [21-Feb-2025 03:42:40] NOTICE: [pool www] child 4178 started

Unfortunately, this happens ‘from time to time’ (approx. every 2-3 days) on all my WordPress websites with the same setup (approx. 30 of them). The nginx (other container) can then no longer establish a connection to the FPM and responds with 502. The only thing that helps is to restart the FPM container.

I have also tried the image https://github.com/serversideup/docker-php, which is basically just the PHP base image. I also have the problem there with both 8.3 and 8.4.

As I unfortunately don't know how I should continue debugging, I wanted to ask if you have any tips for me.

Thank you very much!

PHP Version

Latest PHP 8.3

Operating System

Alpine

@devnexen
Copy link
Member

Hi @thueske would it be possible to do these two things :

  • Sharing what you can in term of fpm configuration.
  • Generating a backtrace, e.g. like in this fashion.

@thueske
Copy link
Author

thueske commented Feb 25, 2025

Hi @thueske would it be possible to do these two things :

  • Sharing what you can in term of fpm configuration.
  • Generating a backtrace, e.g. like in this fashion.

Would love to do that. Are there any debug docker images that make this easy to do?

@devnexen
Copy link
Member

devnexen commented Feb 26, 2025

I am not necessarily a docker expert but what is possible is to get a shell in your container and attach gdb to a php process id.

gdb -p <php FPM main process id>
> set follow-fork-mode child
or
gdb -p <php FPM one of the child process id>
...
<eventually segmentation fault occurs>
...
> bt all
<shares with us the output>

Also core dumps could be generated eventually, depending on the /proc/sys/kernel/core_pattern content.
We can do something like this echo "core.%p" | sudo tee /proc/sys/kernel/core_pattern then ulimit -c unlimited that would generate a coredump with core.<process id> which you can use with gdb -c <core dump> <fpm executable, usually php-fpm>.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants