|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79873 mod_php: crashes with non-debug build
Submitted: 2020-07-18 15:17 UTC Modified: -
From: bugreports2 at gmail dot com Assigned:
Status: Open Package: Compile Failure
PHP Version: 8.0Git-2020-07-18 (Git) OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2020-07-18 15:17 UTC] bugreports2 at gmail dot com
sadly the crashes below don't happen with non-optimized --enable-debug builds and so the informations are very few

php8-head carshes for many weeks here at the point of fire up httpd with the intermediate binary for pgo profiling while the identical environment porduces 7.2/7.3/7.4 binaries witout any issues


at least there is one warning at build time for apache2handler

/BUILD/php-8.0.0/sapi/apache2handler/mod_php.c:38:1: warning: missing initializer for field ‘flags’ of ‘module’ {aka ‘struct module_struct’} [-Wmissing-field-initializers]
   38 | };
      | ^
In file included from /BUILD/php-8.0.0/sapi/apache2handler/php_apache.h:21,
                 from /BUILD/php-8.0.0/sapi/apache2handler/mod_php.c:28:
/usr/include/httpd/http_config.h:420:9: note: ‘flags’ declared here
  420 |     int flags;
      |         ^~~~~


Jul 18 16:19:32 testserver kernel: httpd[78211]: segfault at 0 ip 00007f69a7922841 sp 00007ffc3fd71440 error 4 in[7f69a7660000+563000]
Jul 18 16:19:32 testserver kernel: Code: 0c 0e 88 4a 02 48 89 fa eb 93 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 53 66 48 8d 3d 5f 0a 53 00 66 66 48 e8 5f 01 d4 ff <48> 83 38 00 74 11 48 8d 35 e2 ff ff ff bf 06 38 09 54 e8 58 0e d4
Jul 18 16:19:32 testserver systemd[1]: Started Process Core Dump (PID 78213/UID 0).
Jul 18 16:19:32 testserver systemd-coredump[78214]: Process 78211 (httpd) of user 5000 dumped core.#012#012Stack trace of thread 78211:#012#0  0x00007f69a7922841 n/a (/BUILD/php-8.0.0/libs/  0x00007f69a867ff84 dl_open_worker (  0x00007f69a85c74f8 _dl_catch_exception (  0x00007f69a867f8fe _dl_open (  0x00007f69a80ef39c dlopen_doit (  0x00007f69a85c74f8 _dl_catch_exception (  0x00007f69a85c75c3 _dl_catch_error (  0x00007f69a80efb09 _dlerror_run (  0x00007f69a80ef42a dlopen@@GLIBC_2.2.5 (  0x00007f69a832701d apr_dso_load ( 0x0000557f79aea29f n/a (httpd)#012#11 0x0000557f79aea511 n/a (httpd)#012#12 0x0000557f79b0ce54 n/a (httpd)#012#13 0x0000557f79b0db62 n/a (httpd)#012#14 0x0000557f79b0de07 ap_build_config (httpd)#012#15 0x0000557f79b0e514 ap_process_resource_config (httpd)#012#16 0x0000557f79b0eb6f ap_read_config (httpd)#012#17 0x0000557f79aa8fa9 main (httpd)#012#18 0x00007f69a84b21a3 __libc_start_main ( 0x0000557f79aa94ee _start (httpd)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-07-18 16:31 UTC] bugreports2 at gmail dot com
from the moment on you enable PGO mod_php crashes even without all other optimizations removed

[builduser@testserver:/rpmbuild/SPECS]$ rpmbuild -bb php.spec 
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.wuTF9u
+ umask 022
+ cd /home/builduser/rpmbuild/BUILD
+ cd /home/builduser/rpmbuild/BUILD
+ rm -rf php-8.0.0
+ /usr/bin/xz -dc /home/builduser/rpmbuild/SOURCES/php-8.0.0.tar.xz
+ /usr/bin/tar -xof -
+ '[' 0 -ne 0 ']'
+ cd php-8.0.0
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ echo 'Patch #2 (php-73-realpath-cache-openbasedir.patch):'
Patch #2 (php-73-realpath-cache-openbasedir.patch):
+ /usr/bin/patch --no-backup-if-mismatch -p1 -b --suffix .realpath-73 --fuzz=0
patching file main/main.c
Hunk #1 succeeded at 1737 (offset -61 lines).
Hunk #2 succeeded at 2220 (offset -72 lines).
+ rm -f TSRM/tsrm_win32.h TSRM/tsrm_config.w32.h Zend/zend_config.w32.h ext/mysqlnd/config-win.h ext/standard/winver.h main/win32_internal_function_disabled.h main/win95nt.h
+ find . -name '*.[ch]' -exec chmod 644 '{}' ';'
+ xargs rm -rf
+ RPM_EC=0
++ jobs -p
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.FYhfzu
+ umask 022
+ cd /home/builduser/rpmbuild/BUILD
+ cd php-8.0.0
+ libtoolize --force --copy --quiet
++ aclocal --print-ac-dir
++ aclocal --print-ac-dir
++ aclocal --print-ac-dir
++ aclocal --print-ac-dir
++ aclocal --print-ac-dir
+ cat /usr/share/aclocal/libtool.m4 /usr/share/aclocal/ltoptions.m4 /usr/share/aclocal/ltsugar.m4 /usr/share/aclocal/ltversion.m4 /usr/share/aclocal/lt~obsolete.m4
++ aclocal --print-ac-dir
++ aclocal --print-ac-dir
++ aclocal --print-ac-dir
++ aclocal --print-ac-dir
++ aclocal --print-ac-dir
+ cat /usr/share/aclocal/libtool.m4 /usr/share/aclocal/ltoptions.m4 /usr/share/aclocal/ltsugar.m4 /usr/share/aclocal/ltversion.m4 /usr/share/aclocal/lt~obsolete.m4
+ touch
+ ./buildconf --force
buildconf: Checking installation
buildconf: autoconf version 2.69 (ok)
buildconf: Forcing buildconf. The configure files will be regenerated.
buildconf: Cleaning cache and configure files
buildconf: Rebuilding configure
buildconf: Rebuilding main/
buildconf: Run ./configure to proceed with customizing the PHP build.
+ sed -i -E 's/EXTRA_VERSION=".*"/EXTRA_VERSION="-thelounge-sandybridge-fc31"/' configure
+ sed -i -E 's/PHP_EXTRA_VERSION=\$4/PHP_EXTRA_VERSION=-thelounge-sandybridge-fc31/' configure
+ '[' -f /usr/bin/php ']'
+ /usr/bin/php -d display_errors=0 Zend/zend_vm_gen.php
zend_vm_opcodes.h generated successfully.
zend_vm_opcodes.c generated successfully.
zend_vm_execute.h generated successfully.
+ export 'CFLAGS=-march=sandybridge -mtune=sandybridge -pipe -m64 -O1 -fPIC -g0 -w -Wformat -Werror=format-security'
+ CFLAGS='-march=sandybridge -mtune=sandybridge -pipe -m64 -O1 -fPIC -g0 -w -Wformat -Werror=format-security'
++ date +%s
+ export 'LDFLAGS=-Wl,--as-needed -Wl,-z,now -Wl,-z,relro -pie -fPIE' CC=gcc CXX=gcc LANG=C.UTF-8 EXTENSION_DIR=/usr/lib64/php/modules SOURCE_DATE_EPOCH=1595088756
+ LDFLAGS='-Wl,--as-needed -Wl,-z,now -Wl,-z,relro -pie -fPIE'
+ CC=gcc
+ CXX=gcc
+ EXTENSION_DIR=/usr/lib64/php/modules
+ SOURCE_DATE_EPOCH=1595088756
+ ./configure --quiet --build=x86_64-redhat-linux --host=x86_64-redhat-linux --target=x86_64-redhat-linux --program-prefix= --prefix=/usr --libdir=/usr/lib64/php --disable-all --enable-apcu --enable-bcmath --enable-calendar=shared --enable-cli --enable-ctype=shared --enable-dom=shared --enable-exif=shared --enable-fileinfo=shared --enable-filter --enable-gcc-global-regs --enable-gd=shared --enable-hash --enable-huge-code-pages --enable-inline-optimization --enable-intl=shared --enable-json=shared --enable-libxml --enable-mbregex --enable-mbstring=shared --enable-mysqlnd --enable-opcache --disable-opcache-jit --enable-pcntl=shared --enable-pdo=shared --enable-phar=shared --enable-posix=shared --enable-re2c-cgoto --enable-session=shared --enable-shared --enable-simplexml=shared --enable-soap=shared --enable-sockets=shared --enable-tokenizer=shared --enable-xml=shared --enable-xmlreader=shared --enable-xmlwriter=shared --enable-zip=shared --with-apxs2=/usr/bin/apxs --with-bz2=shared,/usr --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.lounge.d --with-curl=shared,/usr --with-freetype --with-freetype-dir=/usr --with-gd=shared --with-gnu-ld --with-iconv=shared --with-imap=shared,/usr --with-jpeg --with-jpeg-dir=/usr --with-layout=GNU --with-libdir=lib64 --with-libedit --with-libxml --with-libxml-dir=/usr --with-libzip=/usr --with-mysql-sock=/var/lib/mysql/mysql.sock --with-mysqli=mysqlnd --with-openssl=/usr --with-pcre-jit --with-pcre-regex --with-pdo-mysql=shared,mysqlnd --with-pic --with-png-dir=/usr --with-system-ciphers --with-tidy=shared,/usr --with-zip=shared --with-zlib-dir=/usr --with-zlib=shared --without-ffi --without-kerberos --without-pear --without-sodium --without-webp --without-webp-dir --without-xpm --disable-cgi --disable-gd-jis-conv --disable-mysqlnd-compression-support --disable-phpdbg --disable-rpath --disable-short-tags --disable-static --disable-debug --without-valgrind
configure: WARNING: unrecognized options: --enable-apcu, --enable-hash, --enable-inline-optimization, --enable-json, --enable-libxml, --enable-zip, --with-freetype-dir, --with-gd, --with-jpeg-dir, --with-libxml-dir, --with-libzip, --with-pcre-regex, --with-png-dir, --without-webp-dir
Updated main/php_version.h
This is the test message -- creating main/internal_functions.c
creating main/internal_functions_cli.c
|                        *** WARNING ***                             |
|                                                                    |
| You have built PHP for Apache's current non-threaded MPM.          |
| If you change Apache to use a threaded MPM you must reconfigure    |
| PHP with --enable-zts                                              |

| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE. By continuing this installation  |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |

Thank you for using PHP.

configure: WARNING: unrecognized options: --enable-apcu, --enable-hash, --enable-inline-optimization, --enable-json, --enable-libxml, --enable-zip, --with-freetype-dir, --with-gd, --with-jpeg-dir, --with-libxml-dir, --with-libzip, --with-pcre-regex, --with-png-dir, --without-webp-dir
+ make --quiet -j6 prof-gen
Generating phar.php
Generating phar.phar
PEAR package PHP_Archive not installed: generated phar will require PHP's phar extension be enabled.

Build complete.
Don't forget to run 'make test'.

+ /usr/bin/bash /rpmbuild/PHP-PGO/ --php_build /home/builduser/rpmbuild/BUILD/php-8.0.0

PHP-VERSION:    PHP 8.0.0-thelounge-sandybridge-fc31 (cli) (built: Jul 18 2020 16:12:36) ( NTS )
HTTPD-BINARY:   /usr/sbin/httpd
PHP-MODULE:     /home/builduser/rpmbuild/BUILD/php-8.0.0/libs/
PHP-EXTENSIONS: /home/builduser/rpmbuild/BUILD/php-8.0.0/modules
PHP-CLI:        /home/builduser/rpmbuild/BUILD/php-8.0.0/sapi/cli/php
CALLED:         /rpmbuild/PHP-PGO/ --php_build /home/builduser/rpmbuild/BUILD/php-8.0.0
/rpmbuild/PHP-PGO/ line 213: 369591 Segmentation fault      (core dumped) $HTTPD_BINARY -X -f "$PROFILE_ROOT/httpd.conf"
/rpmbuild/PHP-PGO/ line 275: 369701 Segmentation fault      (core dumped) $HTTPD_BINARY -X -f "$PROFILE_ROOT/httpd.conf" -k stop 2> '/dev/null'
error: Bad exit status from /var/tmp/rpm-tmp.FYhfzu (%build)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.FYhfzu (%build)
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Oct 29 07:01:24 2020 UTC