docker-library / php

Docker Official Image packaging for PHP
https://php.net
MIT License
3.79k stars 2k forks source link

FPM 8.1 Bullseye: segfault on scripts encoded with IonCube Encoder 12 #1386

Closed Wexter closed 1 year ago

Wexter commented 1 year ago

PHP-FPM (and CLI) always fails to execute scripts encoded with IonCube 12 with segmentation fault. I've lost full day trying to find the cause of this issue, tried with different versions of PHP (from 8.1.0 to 8.1.17) and different IonCube Loader (12.0.1 to 12.0.5). Discovered that issue is present ONLY on php:8.1-fpm image, php:8.1 works fine without segfault. I guessed that problem is probably in compile configuration flags. Checked what's the difference between php:8.1 and php:8.1-fpm and saw that php:8.1 has flags --enable-phpdbg --enable-phpdbg-readline --enable-embed, which php:8.1-fpm doesn't have. So I cloned project, added these flags to 8.1/bullseye/fpm/Dockerfile, built image and PHP-FPM stopped failing with encoded scripts. Don't know what these flags do and why they are not added to FPM image. But I think that they need to be there.

Wexter commented 1 year ago

After some digging found that ioncube_loader conflicts with xhprof extension. Don't know how it keeped segafult after i removed all extensions during image build. Probably was some docker cache

wmfairuz commented 5 months ago

@Wexter I'm having the same segfault issue with php8.1 and ioncube 13. Can I know how do you debug to know why it segfaulted? Thanks

Wexter commented 5 months ago

@wmfairuz I've just disabled extensions one by one, until it stopped segfaulting when I disabled xhprof