Topic: Segfault in php70-php-opcache-7.0.0-0.25.RC8.el6.remi.x86_64

Hi,

Just fyi, php70-php-opcache-7.0.0-0.25.RC8 crashes on CentOS 6, backtrace:

Core was generated by `/opt/remi/php70/root/usr/bin/php -v'.
Program terminated with signal 11, Segmentation fault.
#0  zend_llist_del_element (l=0x9dc8e0, element=0x0, compare=0x7fcb85d40590 <accelerator_remove_cb>) at /usr/src/debug/php-7.0.0RC8/Zend/zend_llist.c:91
91    {
Missing separate debuginfos, use: debuginfo-install GeoIP-1.6.5-1.el6.x86_64 ImageMagick-last-libs-6.9.2.6-1.el6.remi.x86_64 aspell-0.60.6-12.el6.x86_64 audit-libs-2.3.7-5.el6.x86_64 bzip2-libs-1.0.5-7.el6_0.x86_64 cyrus-sasl-lib-2.1.23-15.el6_6.2.x86_64 db4-4.7.25-20.el6_7.x86_64 enchant-1.5.0-5.el6.x86_64 expat-2.0.1-11.el6_2.x86_64 fastlz-0.1.0-0.1.20070619svnrev12.el6.remi.x86_64 fftw-3.2.1-3.1.el6.x86_64 fontconfig-2.8.0-5.el6.x86_64 freetype-2.3.11-15.el6_6.1.x86_64 gd-last-2.1.1-2.el6.remi.x86_64 glib2-2.28.8-4.el6.x86_64 gmp-4.3.1-7.el6_2.2.x86_64 keyutils-libs-1.4-5.el6.x86_64 lcms2-2.3-2.el6.x86_64 libICE-1.0.6-1.el6.x86_64 libSM-1.2.1-2.el6.x86_64 libX11-1.6.0-6.el6.x86_64 libXau-1.0.6-4.el6.x86_64 libXext-1.3.2-2.1.el6.x86_64 libXpm-3.5.10-2.el6.x86_64 libXt-1.1.4-6.1.el6.x86_64 libc-client-2007e-11.el6.x86_64 libcurl-7.19.7-46.el6.x86_64 libedit-2.11-4.20080712cvs.1.el6.x86_64 libgcrypt-1.4.5-11.el6_4.x86_64 libgpg-error-1.7-4.el6.x86_64 libicu-last-50.1.2-11.el6.remi.x86_64 libidn-1.18-2.el6.x86_64 libjpeg-turbo-1.2.1-3.el6_5.x86_64 libmcrypt-2.5.8-9.el6.x86_64 libmemcached-1.0.17-1.rhel6.x86_64 libpng-1.2.49-1.el6_2.x86_64 libselinux-2.0.94-5.8.el6.x86_64 libssh2-1.4.2-1.el6_6.1.x86_64 libtidy-0.99.0-19.20070615.1.el6.x86_64 libtiff-3.9.4-10.el6_5.x86_64 libtool-ltdl-2.2.6-15.5.el6.x86_64 libuuid-2.17.2-12.18.el6.x86_64 libvpx-1.3.0-5.el6_5.x86_64 libxcb-1.9.1-3.el6.x86_64 libxslt-1.1.26-2.el6_3.1.x86_64 libzip-last-1.0.1-1.el6.remi.x86_64 net-snmp-libs-5.5-54.el6_7.1.x86_64 nspr-4.10.8-2.el6_7.x86_64 nss-3.19.1-5.el6_7.x86_64 nss-util-3.19.1-2.el6_7.x86_64 openldap-2.4.40-7.el6_7.x86_64 pam-1.1.1-20.el6_7.1.x86_64 php70-php-pecl-apcu-5.1.0-1.el6.remi.x86_64 php70-php-pecl-geoip-1.1.0-9.el6.remi.x86_64 php70-php-pecl-imagick-3.3.0-0.6.20150930gitfccdde3.el6.remi.x86_64 php70-php-pecl-memcached-2.2.0-11.20150628git3c79a97.el6.remi.x86_64 php70-php-pecl-msgpack-2.0.0-1.el6.remi.x86_64 php70-php-pecl-uploadprogress-1.0.3.1-11.el6.remi.x86_64 php70-php-pecl-uuid-1.0.4-6.el6.remi.x86_64 php70-php-pecl-zip-1.13.1-3.el6.remi.x86_64 postgresql93-libs-9.3.10-1PGDG.rhel6.x86_64 sqlite-3.6.20-1.el6_7.2.x86_64 tokyocabinet-1.4.33-6.el6.x86_64 unixODBC-2.2.14-14.el6.x86_64
(gdb) bt
#0  zend_llist_del_element (l=0x9dc8e0, element=0x0, compare=0x7fcb85d40590 <accelerator_remove_cb>) at /usr/src/debug/php-7.0.0RC8/Zend/zend_llist.c:91
#1  0x00007fcb85d425b1 in zps_startup_failure (extension=<value optimized out>) at /usr/src/debug/php-7.0.0RC8/ext/opcache/ZendAccelerator.c:2336
#2  accel_startup (extension=<value optimized out>) at /usr/src/debug/php-7.0.0RC8/ext/opcache/ZendAccelerator.c:2621
#3  0x00000000005edbb1 in zend_extension_startup (extension=0x28a0190) at /usr/src/debug/php-7.0.0RC8/Zend/zend_extensions.c:176
#4  0x00000000005d7123 in zend_llist_apply_with_del (l=0x9dc8e0, func=0x5edba0 <zend_extension_startup>) at /usr/src/debug/php-7.0.0RC8/Zend/zend_llist.c:171
#5  0x00000000005edb97 in zend_startup_extensions () at /usr/src/debug/php-7.0.0RC8/Zend/zend_extensions.c:197
#6  0x0000000000585815 in php_module_startup (sf=<value optimized out>, additional_modules=<value optimized out>, num_additional_modules=<value optimized out>) at /usr/src/debug/php-7.0.0RC8/main/main.c:2197
#7  0x00000000006761bd in php_cli_startup (sapi_module=<value optimized out>) at /usr/src/debug/php-7.0.0RC8/sapi/cli/php_cli.c:423
#8  0x00000000006778e1 in main (argc=2, argv=0x28589e0) at /usr/src/debug/php-7.0.0RC8/sapi/cli/php_cli.c:1325

Also posted at https://bugs.php.net/bug.php?id=70818

Re: Segfault in php70-php-opcache-7.0.0-0.25.RC8.el6.remi.x86_64

Try setting opcache.huge_code_pages=0


I think you are hit by https://bugs.php.net/bug.php?id=70973 https://bugs.php.net/bug.php?id=70977 because of old kernel in El-6

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Segfault in php70-php-opcache-7.0.0-0.25.RC8.el6.remi.x86_64

I'm uploading new EL-6 build (base packages 0.16, scl packages 0.26) which set this to 0 by default.

I will keep this setting for 7.0.0 GA (later this week), as the upstream fix will be only in 7.0.1.

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Segfault in php70-php-opcache-7.0.0-0.25.RC8.el6.remi.x86_64

Thanks Remi, setting opcache.huge_code_pages=0 fixes the crash on the existing build. However, it may not be kernel version dependent, since on one of the test CentOS 6 machines, running as Xen domU, the extension crashes on all the kernels tested:
kernel-debug-2.6.32-573.8.1.el6.x86_64
kernel-3.18.21-16.el6.x86_64
kernel-ml-4.3.0-1.el6.elrepo.x86_64

Re: Segfault in php70-php-opcache-7.0.0-0.25.RC8.el6.remi.x86_64

Yes, perhaps not the kernel, could be glibc, in all case this crash is EL-6 only.

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Segfault in php70-php-opcache-7.0.0-0.25.RC8.el6.remi.x86_64

Remi wrote:

I'm uploading new EL-6 build (base packages 0.16, scl packages 0.26) which set this to 0 by default.

Thanks, opcache.huge_code_pages=0 confirmed in 7.0.0-0.26.RC8.el6.remi

Re: Segfault in php70-php-opcache-7.0.0-0.25.RC8.el6.remi.x86_64

smile

Closing.

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Segfault in php70-php-opcache-7.0.0-0.25.RC8.el6.remi.x86_64

FYI 7.0.1RC1 is available in "remi-test" (SCL packages) and "remi-php70-test" (base packages)

Feedback on this RC is welcome
It will be nice to have some feedback about this RC, especially on EL-6 and huge_page=1 (enabled at build time, but still disabled in configuration, for safety, 7.0.1 planed for next week)

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Segfault in php70-php-opcache-7.0.0-0.25.RC8.el6.remi.x86_64

Received by mail:

> PHP 7.0.1RC1 w. opcache.huge_code_pages=1
> Hi Remi, sorry to bug you with the email, but the related topic is now closed. 7.0.1RC1 is now warning, which afaik is the expected behaviour:
> [root@centos6dev yum.repos.d]# /opt/remi/php70/root/usr/bin/php -v
> PHP Warning:  Zend OPcache huge_code_pages: mmap(HUGETLB) failed: Cannot allocate memory (12) in Unknown on line 0

Yes, seems the expected behavior. And so opcache.huge_code_pages have to be set to 0.
Thanks for the feedback.

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi