Apache / PHP segfaults (PHP 8.0 and 8.1, but also 7.4)
Description
PHP 7.4.27 / 8.0.15 / 8.1.3 Apache 2.4.52 OpenBSD 7.0 / amd64
If running any of the above PHP versions under Apache (as module), I noticed that every time when apache rotate it's logs it crashes. To be sure of this issue I set the log rotation at a fixed hour (not by size). In the last 3 days, each day at the exactly same hour apache crashed and did not crashed in the rest. Finally I did not loaded the opcache.so and it did not crashed on log rotation. After further investigation I noticed this:
The problem is somwehere in opcache.so. All the above versions are affected. The PHP 7.3.33 works OK, it does not crash.
How to reproduce the issue:
- load the opcache.so PHP extensions
- apachectl2 graceful OR kill -HUP 12345 (where 12345 is the process ID number)
- apache crashes
If I do not load opcache.so it does not crashes.
PHP Version
8.0.15
Operating System
OpenBSD 7.0
OK.
PHP 8.0.15 DBG (built with --enable-debug=yes)
I hope this helps
PHP Version 8.0.15
PHP Version 8.0.15 System OpenBSD uxm-server.uxm 7.0 GENERIC.MP#5 amd64 Build Date Mar 4 2022 23:14:16 Build System OpenBSD obsd70.my.domain 7.0 GENERIC#5 amd64 Configure Command './configure' '--with-pcre-jit=no' '--without-valgrind' '--enable-debug=yes' '--with-zip=shared' '--enable-gd=shared' '--with-jpeg=/usr/local' '--with-png=/usr/local' '--with-webp=/usr/local' '--with-freetype=/usr/X11R6' '--enable-shared' '--disable-static' '--disable-rpath' '--with-config-file-path=/etc' '--enable-inline-optimization' '--with-pic' '--with-pear=/usr/local/share/php-8.0' '--with-config-file-scan-dir=/etc/php-8.0' '--with-pdo-sqlite' '--with-sqlite3' '--with-password-argon2' '--program-suffix=-8.0' '--with-readline' '--with-apxs2=/usr/local/sbin/apxs2' '--with-openssl' '--with-zlib' '--enable-xml' '--enable-wddx' '--enable-cli' '--with-iconv=/usr/local' '--with-gettext=/usr/local' '--enable-bcmath' '--enable-session' '--enable-calendar' '--enable-ctype' '--enable-ftp' '--with-pcre-regex' '--enable-sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-mbstring' '--enable-exif' '--enable-cgi' '--enable-fpm' '--with-fpm-user=www' '--with-fpm-group=www' '--with-bz2=shared,/usr/local' '--with-curl=shared,/usr/local' '--enable-dba=shared' '--with-gdbm=/usr/local' '--with-external-gd' '--with-gd=shared' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local' '--with-webp-dir=/usr/local' '--with-zlib-dir=/usr' '--with-t1lib=/usr/local' '--with-freetype-dir=/usr/X11R6' '--with-xpm-dir=/usr/X11R6' '--with-gmp=shared,/usr/local' '--enable-intl=shared' '--with-icu-dir=/usr/local' '--with-imap=shared,/usr/local' '--with-imap-ssl' '--with-ldap=shared,/usr/local' '--with-mysqli=shared' '--disable-iodbc' '--enable-pcntl=shared' '--with-pdo-mysql=shared' '--with-pdo-pgsql=shared,/usr/local' '--with-pgsql=shared,/usr/local' '--with-pspell=shared,/usr/local' '--enable-shmop=shared,/usr/local' '--enable-soap=shared,/usr/local' '--with-snmp=shared,/usr/local' '--with-tidy=shared,/usr/local' '--with-xsl=shared' '--enable-dom' '--enable-zip=shared,/usr/local' '--prefix=/usr/local' '--sysconfdir=/etc' '--mandir=/usr/local/man' '--infodir=/usr/local/info' '--localstatedir=/var' '--disable-silent-rules' '--disable-gtk-doc' 'CFLAGS=-O2 -pipe -I/usr/local/include -pthread' Server API Apache 2.0 Handler Virtual Directory Support disabled Configuration File (php.ini) Path /etc Loaded Configuration File /etc/php-8.0.ini Scan this dir for additional .ini files /etc/php-8.0 Additional .ini files parsed /etc/php-8.0/bz2.ini, /etc/php-8.0/curl.ini, /etc/php-8.0/dba.ini, /etc/php-8.0/gd.ini, /etc/php-8.0/gmp.ini, /etc/php-8.0/intl.ini, /etc/php-8.0/mongodb.ini, /etc/php-8.0/mysqli.ini, /etc/php-8.0/opcache.ini, /etc/php-8.0/pdo_mysql.ini, /etc/php-8.0/pdo_pgsql.ini, /etc/php-8.0/pgsql.ini, /etc/php-8.0/scrypt.ini, /etc/php-8.0/zip.ini PHP API 20200930 PHP Extension 20200930 Zend Extension 420200930 Zend Extension Build API420200930,NTS,debug PHP Extension Build API20200930,NTS,debug Debug Build yes Thread Safety disabled Zend Signal Handling enabled Zend Memory Manager enabled Zend Multibyte Support provided by mbstring IPv6 Support enabled DTrace Support disabled Registered PHP Streams https, ftps, compress.zlib, compress.bzip2, php, file, glob, data, http, ftp, phar, zip Registered Stream Socket Transports tcp, udp, unix, udg, ssl, tls, tlsv1.0, tlsv1.1, tlsv1.2, tlsv1.3 Registered Stream Filters zlib., convert.iconv., bzip2., string.rot13, string.toupper, string.tolower, convert., consumed, dechunk Zend logo This program makes use of the Zend Scripting Language Engine: Zend Engine v4.0.15, Copyright (c) Zend Technologies with Zend OPcache v8.0.15, Copyright (c), by Zend Technologies
See below the Debug Info
gdb /usr/local/sbin/httpd2 /httpd2.core
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "amd64-unknown-openbsd7.0"...(no debugging symbols found)
Core was generated by `httpd2'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib/libpthread.so.26.1...done.
Loaded symbols for /usr/lib/libpthread.so.26.1
Loaded symbols for /usr/local/sbin/httpd2
Reading symbols from /usr/local/lib/libpcre.so.3.0...done.
Loaded symbols for /usr/local/lib/libpcre.so.3.0
Reading symbols from /usr/local/lib/libaprutil-1.so.6.1...done.
Loaded symbols for /usr/local/lib/libaprutil-1.so.6.1
Symbols already loaded for /usr/lib/libpthread.so.26.1
Reading symbols from /usr/lib/libexpat.so.14.0...done.
Loaded symbols for /usr/lib/libexpat.so.14.0
Reading symbols from /usr/local/lib/libiconv.so.7.0...done.
Loaded symbols for /usr/local/lib/libiconv.so.7.0
Reading symbols from /usr/local/lib/libapr-1.so.7.0...done.
Loaded symbols for /usr/local/lib/libapr-1.so.7.0
Reading symbols from /usr/local/lib/libdb.so.5.0...done.
Loaded symbols for /usr/local/lib/libdb.so.5.0
Reading symbols from /usr/lib/libc.so.96.1...done.
Loaded symbols for /usr/lib/libc.so.96.1
Reading symbols from /usr/libexec/ld.so...Error while reading shared library symbols:
Dwarf Error: wrong version in compilation unit header (is 4, should be 2) [in module /usr/libexec/ld.so]
Reading symbols from /usr/local/lib/php-8.0/modules/opcache.so...done.
Loaded symbols for /usr/local/lib/php-8.0/modules/opcache.so
Reading symbols from /usr/local/lib/apache2/mod_authn_file.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_authn_file.so
Reading symbols from /usr/local/lib/apache2/mod_authn_core.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_authn_core.so
Reading symbols from /usr/local/lib/apache2/mod_authz_host.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_authz_host.so
Reading symbols from /usr/local/lib/apache2/mod_authz_user.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_authz_user.so
Reading symbols from /usr/local/lib/apache2/mod_authz_core.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_authz_core.so
Reading symbols from /usr/local/lib/apache2/mod_access_compat.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_access_compat.so
Reading symbols from /usr/local/lib/apache2/mod_auth_basic.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_auth_basic.so
Reading symbols from /usr/local/lib/apache2/mod_auth_digest.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_auth_digest.so
Reading symbols from /usr/local/lib/apache2/mod_allowmethods.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_allowmethods.so
Reading symbols from /usr/local/lib/apache2/mod_file_cache.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_file_cache.so
Reading symbols from /usr/local/lib/apache2/mod_cache.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_cache.so
Reading symbols from /usr/local/lib/apache2/mod_cache_disk.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_cache_disk.so
Reading symbols from /usr/local/lib/apache2/mod_cache_socache.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_cache_socache.so
Reading symbols from /usr/local/lib/apache2/mod_socache_shmcb.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_socache_shmcb.so
Reading symbols from /usr/local/lib/apache2/mod_socache_memcache.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_socache_memcache.so
Reading symbols from /usr/local/lib/apache2/mod_buffer.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_buffer.so
Reading symbols from /usr/local/lib/apache2/mod_reqtimeout.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_reqtimeout.so
Reading symbols from /usr/local/lib/apache2/mod_request.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_request.so
Reading symbols from /usr/local/lib/apache2/mod_include.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_include.so
Reading symbols from /usr/local/lib/apache2/mod_filter.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_filter.so
Reading symbols from /usr/local/lib/apache2/mod_deflate.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_deflate.so
Reading symbols from /usr/lib/libz.so.6.0...done.
Loaded symbols for /usr/lib/libz.so.6.0
Reading symbols from /usr/local/lib/apache2/mod_mime.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_mime.so
Reading symbols from /usr/local/lib/apache2/mod_log_config.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_log_config.so
Reading symbols from /usr/local/lib/apache2/mod_env.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_env.so
Reading symbols from /usr/local/lib/apache2/mod_mime_magic.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_mime_magic.so
Reading symbols from /usr/local/lib/apache2/mod_expires.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_expires.so
Reading symbols from /usr/local/lib/apache2/mod_headers.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_headers.so
Reading symbols from /usr/local/lib/apache2/mod_unique_id.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_unique_id.so
Reading symbols from /usr/local/lib/apache2/mod_setenvif.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_setenvif.so
Reading symbols from /usr/local/lib/apache2/mod_version.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_version.so
Reading symbols from /usr/local/lib/apache2/mod_session.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_session.so
Reading symbols from /usr/local/lib/apache2/mod_ssl.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_ssl.so
Reading symbols from /usr/lib/libssl.so.50.0...done.
Loaded symbols for /usr/lib/libssl.so.50.0
Reading symbols from /usr/lib/libcrypto.so.47.0...done.
Loaded symbols for /usr/lib/libcrypto.so.47.0
Reading symbols from /usr/local/lib/apache2/mod_mpm_prefork.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_mpm_prefork.so
Reading symbols from /usr/local/lib/apache2/mod_unixd.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_unixd.so
Reading symbols from /usr/local/lib/apache2/mod_dav.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_dav.so
Reading symbols from /usr/local/lib/apache2/mod_status.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_status.so
Reading symbols from /usr/local/lib/apache2/mod_autoindex.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_autoindex.so
Reading symbols from /usr/local/lib/apache2/mod_dav_fs.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_dav_fs.so
Reading symbols from /usr/local/lib/apache2/mod_dav_lock.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_dav_lock.so
Reading symbols from /usr/local/lib/apache2/mod_vhost_alias.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_vhost_alias.so
Reading symbols from /usr/local/lib/apache2/mod_negotiation.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_negotiation.so
Reading symbols from /usr/local/lib/apache2/mod_dir.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_dir.so
Reading symbols from /usr/local/lib/apache2/mod_alias.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_alias.so
Reading symbols from /usr/local/lib/apache2/mod_rewrite.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_rewrite.so
Reading symbols from /usr/local/lib/php-8.0/libphp.so...done.
Loaded symbols for /usr/local/lib/php-8.0/libphp.so
Reading symbols from /usr/local/lib/libargon2.so.0.0...done.
Loaded symbols for /usr/local/lib/libargon2.so.0.0
Reading symbols from /usr/lib/libreadline.so.4.0...done.
Loaded symbols for /usr/lib/libreadline.so.4.0
Reading symbols from /usr/lib/libcurses.so.14.0...done.
Loaded symbols for /usr/lib/libcurses.so.14.0
Reading symbols from /usr/local/lib/libintl.so.7.0...done.
Loaded symbols for /usr/local/lib/libintl.so.7.0
Reading symbols from /usr/lib/libutil.so.15.1...done.
Loaded symbols for /usr/lib/libutil.so.15.1
Reading symbols from /usr/lib/libm.so.10.1...done.
Loaded symbols for /usr/lib/libm.so.10.1
Reading symbols from /usr/local/lib/libonig.so.7.2...done.
Loaded symbols for /usr/local/lib/libonig.so.7.2
Reading symbols from /usr/local/lib/libsqlite3.so.37.15...done.
Loaded symbols for /usr/local/lib/libsqlite3.so.37.15
Reading symbols from /usr/local/lib/libxml2.so.17.0...done.
Loaded symbols for /usr/local/lib/libxml2.so.17.0
Reading symbols from /usr/local/lib/liblzma.so.2.1...done.
Loaded symbols for /usr/local/lib/liblzma.so.2.1
Reading symbols from /usr/local/lib/apache2/mod_dav_svn.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_dav_svn.so
Reading symbols from /usr/local/lib/libsvn_repos-1.so.6.0...done.
Loaded symbols for /usr/local/lib/libsvn_repos-1.so.6.0
Reading symbols from /usr/local/lib/libsvn_fs-1.so.6.0...done.
Loaded symbols for /usr/local/lib/libsvn_fs-1.so.6.0
Reading symbols from /usr/local/lib/libsvn_fs_util-1.so.6.0...done.
Loaded symbols for /usr/local/lib/libsvn_fs_util-1.so.6.0
Reading symbols from /usr/local/lib/libsvn_subr-1.so.6.0...done.
Loaded symbols for /usr/local/lib/libsvn_subr-1.so.6.0
Reading symbols from /usr/local/lib/liblz4.so.3.1...done.
Loaded symbols for /usr/local/lib/liblz4.so.3.1
Reading symbols from /usr/local/lib/libsvn_delta-1.so.6.0...done.
Loaded symbols for /usr/local/lib/libsvn_delta-1.so.6.0
Reading symbols from /usr/local/lib/libsvn_fs_fs-1.so.6.0...done.
Loaded symbols for /usr/local/lib/libsvn_fs_fs-1.so.6.0
Reading symbols from /usr/local/lib/libsvn_fs_x-1.so.6.0...done.
Loaded symbols for /usr/local/lib/libsvn_fs_x-1.so.6.0
Reading symbols from /usr/local/lib/libsvn_fs_base-1.so.6.0...done.
Loaded symbols for /usr/local/lib/libsvn_fs_base-1.so.6.0
Reading symbols from /usr/local/lib/apache2/mod_authz_svn.so...done.
Loaded symbols for /usr/local/lib/apache2/mod_authz_svn.so
Reading symbols from /usr/local/lib/php-8.0/modules/bz2.so...done.
Loaded symbols for /usr/local/lib/php-8.0/modules/bz2.so
Reading symbols from /usr/local/lib/libbz2.so.10.4...done.
Loaded symbols for /usr/local/lib/libbz2.so.10.4
Reading symbols from /usr/local/lib/php-8.0/modules/curl.so...done.
Loaded symbols for /usr/local/lib/php-8.0/modules/curl.so
Reading symbols from /usr/local/lib/libcurl.so.26.13...done.
Loaded symbols for /usr/local/lib/libcurl.so.26.13
Reading symbols from /usr/local/lib/libnghttp2.so.0.18...done.
Loaded symbols for /usr/local/lib/libnghttp2.so.0.18
Reading symbols from /usr/local/lib/php-8.0/modules/dba.so...done.
Loaded symbols for /usr/local/lib/php-8.0/modules/dba.so
Reading symbols from /usr/local/lib/libgdbm.so.7.0...done.
Loaded symbols for /usr/local/lib/libgdbm.so.7.0
Reading symbols from /usr/local/lib/php-8.0/modules/gd.so...done.
Loaded symbols for /usr/local/lib/php-8.0/modules/gd.so
Reading symbols from /usr/local/lib/libgd.so.22.2...done.
Loaded symbols for /usr/local/lib/libgd.so.22.2
Reading symbols from /usr/X11R6/lib/libfreetype.so.30.0...done.
Loaded symbols for /usr/X11R6/lib/libfreetype.so.30.0
Reading symbols from /usr/local/lib/libpng.so.18.0...done.
Loaded symbols for /usr/local/lib/libpng.so.18.0
Reading symbols from /usr/local/lib/libjpeg.so.70.0...done.
Loaded symbols for /usr/local/lib/libjpeg.so.70.0
Reading symbols from /usr/local/lib/libtiff.so.41.0...done.
Loaded symbols for /usr/local/lib/libtiff.so.41.0
Reading symbols from /usr/X11R6/lib/libfontconfig.so.13.0...done.
Loaded symbols for /usr/X11R6/lib/libfontconfig.so.13.0
Reading symbols from /usr/local/lib/libwebp.so.4.3...done.
Loaded symbols for /usr/local/lib/libwebp.so.4.3
Reading symbols from /usr/lib/libc++.so.8.0...done.
Loaded symbols for /usr/lib/libc++.so.8.0
Reading symbols from /usr/lib/libc++abi.so.5.0...done.
Loaded symbols for /usr/lib/libc++abi.so.5.0
Reading symbols from /usr/local/lib/libzstd.so.6.1...done.
Loaded symbols for /usr/local/lib/libzstd.so.6.1
Reading symbols from /usr/local/lib/php-8.0/modules/gmp.so...done.
Loaded symbols for /usr/local/lib/php-8.0/modules/gmp.so
Reading symbols from /usr/local/lib/libgmp.so.11.0...done.
Loaded symbols for /usr/local/lib/libgmp.so.11.0
Reading symbols from /usr/local/lib/php-8.0/modules/intl.so...done.
Loaded symbols for /usr/local/lib/php-8.0/modules/intl.so
Reading symbols from /usr/local/lib/libicuio.so.20.0...done.
Loaded symbols for /usr/local/lib/libicuio.so.20.0
Reading symbols from /usr/local/lib/libicui18n.so.20.0...done.
Loaded symbols for /usr/local/lib/libicui18n.so.20.0
Reading symbols from /usr/local/lib/libicuuc.so.20.0...done.
Loaded symbols for /usr/local/lib/libicuuc.so.20.0
Reading symbols from /usr/local/lib/libicudata.so.20.0...done.
Loaded symbols for /usr/local/lib/libicudata.so.20.0
Reading symbols from /usr/local/lib/php-8.0/modules/mysqli.so...done.
Loaded symbols for /usr/local/lib/php-8.0/modules/mysqli.so
Reading symbols from /usr/local/lib/php-8.0/modules/pdo_mysql.so...done.
Loaded symbols for /usr/local/lib/php-8.0/modules/pdo_mysql.so
Reading symbols from /usr/local/lib/php-8.0/modules/pdo_pgsql.so...done.
Loaded symbols for /usr/local/lib/php-8.0/modules/pdo_pgsql.so
Reading symbols from /usr/local/lib/libpq.so.6.10...done.
Loaded symbols for /usr/local/lib/libpq.so.6.10
Reading symbols from /usr/local/lib/php-8.0/modules/pgsql.so...done.
Loaded symbols for /usr/local/lib/php-8.0/modules/pgsql.so
Reading symbols from /usr/local/lib/php-8.0/modules/zip.so...done.
Loaded symbols for /usr/local/lib/php-8.0/modules/zip.so
Reading symbols from /usr/local/lib/libzip.so.4.1...done.
Loaded symbols for /usr/local/lib/libzip.so.4.1
#0 0x0000016f89cb7aa0 in ?? ()
(gdb) list
1 ext/zip/php_zip.c: No such file or directory.
in ext/zip/php_zip.c
(gdb) bt
#0 0x0000016f89cb7aa0 in ?? ()
#1 0x0000016f76872ede in start_accel_module () at ext/opcache/zend_accelerator_module.c:518
#2 0x0000016f7686594f in accel_startup (extension=0x16f4bdd0510) at ext/opcache/ZendAccelerator.c:2901
#3 0x0000016f39047819 in zend_extension_startup (extension=0x16f4bdd0510) at Zend/zend_extensions.c:196
#4 0x0000016f39014754 in zend_llist_apply_with_del (l=0x16f3925d548, func=0x16f390477e0 <zend_extension_startup>) at Zend/zend_llist.c:169
#5 0x0000016f390477c5 in zend_startup_extensions () at Zend/zend_extensions.c:217
#6 0x0000016f38f65003 in php_module_startup (sf=0x16f39243d30, additional_modules=0x16f39243e48, num_additional_modules=1) at main/main.c:2261
#7 0x0000016f3917c90e in php_apache2_startup (sapi_module=0x16f39243d30) at sapi/apache2handler/sapi_apache2.c:376
#8 0x0000016f3917bef5 in php_apache_server_startup (pconf=0x16ef9a6c028, plog=0x16f20dda028, ptemp=0x16f68890028, s=0x16ed7637110) at sapi/apache2handler/sapi_apache2.c:490
#9 0x0000016caf170955 in ap_run_post_config () from /usr/local/sbin/httpd2
#10 0x0000016caf16f6a5 in main () from /usr/local/sbin/httpd2
(gdb) bt full
#0 0x0000016f89cb7aa0 in ?? ()
No symbol table info available.
#1 0x0000016f76872ede in start_accel_module () at ext/opcache/zend_accelerator_module.c:518
No locals.
#2 0x0000016f7686594f in accel_startup (extension=0x16f4bdd0510) at ext/opcache/ZendAccelerator.c:2901
No locals.
#3 0x0000016f39047819 in zend_extension_startup (extension=0x16f4bdd0510) at Zend/zend_extensions.c:196
No locals.
#4 0x0000016f39014754 in zend_llist_apply_with_del (l=0x16f3925d548, func=0x16f390477e0 <zend_extension_startup>) at Zend/zend_llist.c:169
element = (zend_llist_element *) 0x16f4bdd0500
next = (zend_llist_element *) 0x0
#5 0x0000016f390477c5 in zend_startup_extensions () at Zend/zend_extensions.c:217
No locals.
#6 0x0000016f38f65003 in php_module_startup (sf=0x16f39243d30, additional_modules=0x16f39243e48, num_additional_modules=1) at main/main.c:2261
zuf = {error_function = 0x16f38f65360 <php_error_cb>, printf_function = 0x16f38f62300 <php_printf>, write_function = 0x16f38f86cc0 <php_output_write>,
fopen_function = 0x16f38f65e80 <php_fopen_wrapper_for_zend>, message_handler = 0x16f38f65f00 <php_message_handler_for_zend>,
get_configuration_directive = 0x16f38f66580 <php_get_configuration_directive_for_zend>, ticks_function = 0x16f38f82f90 <php_run_ticks>, on_timeout = 0x16f38f63d80 <php_on_timeout>,
stream_open_function = 0x16f38f665c0 <php_stream_open_for_zend>, printf_to_smart_string_function = 0x16f38f6d610 <php_printf_to_smart_string>,
printf_to_smart_str_function = 0x16f38f700d0 <php_printf_to_smart_str>, getenv_function = 0x16f38f791d0 <sapi_getenv>, resolve_path_function = 0x16f38f66610 <php_resolve_path_for_zend>}
zuv = {html_errors = true}
retval = 0
module_number = 0
php_os = 0x16f38156eb0 "OpenBSD"
module = (zend_module_entry *) 0x20
#7 0x0000016f3917c90e in php_apache2_startup (sapi_module=0x16f39243d30) at sapi/apache2handler/sapi_apache2.c:376
No locals.
#8 0x0000016f3917bef5 in php_apache_server_startup (pconf=0x16ef9a6c028, plog=0x16f20dda028, ptemp=0x16f68890028, s=0x16ed7637110) at sapi/apache2handler/sapi_apache2.c:490
data = (void *) 0x1
userdata_key = 0x16f3818a8da "apache2hook_post_config"
#9 0x0000016caf170955 in ap_run_post_config () from /usr/local/sbin/httpd2
No symbol table info available.
#10 0x0000016caf16f6a5 in main () from /usr/local/sbin/httpd2
No symbol table info available.
END
This above (debug) build was using the official OpenBSD 7.0 / PHP 8.0 package (includding specific platform patches), except I added one extra flag: "--enable-debug=yes". The official OpenBSD 7.0 platform specific patches for PHP 8.0 can be found here: https://github.com/openbsd/ports/tree/master/lang/php/8.0/patches or here: http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/lang/php/8.0/patches/?hideattic=1#dirlist
Here is a second debug log that the OpenBSD package maintainer sent me, using a newer GDB version:
PHP 8.0.15 (debug) with newer GDB 9.2
> Reading symbols from /usr/local/lib/php-8.0/modules/zip.so...done.
> Loaded symbols for /usr/local/lib/php-8.0/modules/zip.so
> Reading symbols from /usr/local/lib/libzip.so.4.1...done.
> Loaded symbols for /usr/local/lib/libzip.so.4.1
> #0 0x0000016f89cb7aa0 in ?? ()
> (gdb) list
> 1 ext/zip/php_zip.c: No such file or directory.
> in ext/zip/php_zip.c
> (gdb) bt
> #0 0x0000016f89cb7aa0 in ?? ()
> #1 0x0000016f76872ede in start_accel_module () at ext/opcache/zend_accelerator_module.c:518
> #2 0x0000016f7686594f in accel_startup (extension=0x16f4bdd0510) at ext/opcache/
> ZendAccelerator.c:2901
> #3 0x0000016f39047819 in zend_extension_startup (extension=0x16f4bdd0510) at Zend/
> zend_extensions.c:196
[..]
$ egdb httpd2 /httpd2.core
GNU gdb (GDB) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-unknown-openbsd7.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from httpd2...
Reading symbols from /usr/local/sbin/.debug/httpd2.dbg...
[New process 199520]
Core was generated by `httpd2'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00000cebe2b39380 in ?? ()
(gdb) bt
#0 0x00000cebe2b39380 in ?? ()
#1 0x00000cec80fed18e in start_accel_module () at ext/opcache/zend_accelerator_module.c:518
#2 0x00000cec80fdf63f in accel_startup (extension=0xcec16ffe210) at ext/opcache/ZendAccelerator.c:3114
#3 0x00000cebe081fd29 in zend_extension_startup (extension=0xcec16ffe210) at Zend/zend_extensions.c:196
#4 0x00000cebe07d85df in zend_llist_apply_with_del (l=0xcebe0bf37c8 <zend_extensions>,
func=0xcebe081fcf0 <zend_extension_startup>) at Zend/zend_llist.c:171
#5 0x00000cebe081fcd5 in zend_startup_extensions () at Zend/zend_extensions.c:217
#6 0x00000cebe06fd468 in php_module_startup (sf=0xcebe0bdaba8 <apache2_sapi_module>,
additional_modules=0xcebe0bdacc0 <php_apache_module>, num_additional_modules=1) at main/main.c:2259
#7 0x00000cebe0b0aa0e in php_apache2_startup (sapi_module=0xcebe0bdaba8 <apache2_sapi_module>)
at sapi/apache2handler/sapi_apache2.c:376
#8 0x00000cebe0b09fd5 in php_apache_server_startup (pconf=0xcec6f92c028, plog=0xcec23c36028, ptemp=0xcec66ee5028,
s=0xcec6ecd3110) at sapi/apache2handler/sapi_apache2.c:490
#9 0x00000ce9da79c935 in ap_run_post_config (pconf=0xcec6f92c028, plog=0xcec23c36028, ptemp=0xcec66ee5028, s=0xcec6ecd3110)
at config.c:102
#10 0x00000ce9da797843 in main (argc=3, argv=0x7f7ffffd4838) at main.c:807
(gdb) bt full
#0 0x00000cebe2b39380 in ?? ()
No symbol table info available.
#1 0x00000cec80fed18e in start_accel_module () at ext/opcache/zend_accelerator_module.c:518
No locals.
#2 0x00000cec80fdf63f in accel_startup (extension=0xcec16ffe210) at ext/opcache/ZendAccelerator.c:3114
No locals.
#3 0x00000cebe081fd29 in zend_extension_startup (extension=0xcec16ffe210) at Zend/zend_extensions.c:196
No locals.
#4 0x00000cebe07d85df in zend_llist_apply_with_del (l=0xcebe0bf37c8 <zend_extensions>,
func=0xcebe081fcf0 <zend_extension_startup>) at Zend/zend_llist.c:171
element = 0xcec16ffe200
next = 0x0
#5 0x00000cebe081fcd5 in zend_startup_extensions () at Zend/zend_extensions.c:217
No locals.
#6 0x00000cebe06fd468 in php_module_startup (sf=0xcebe0bdaba8 <apache2_sapi_module>,
additional_modules=0xcebe0bdacc0 <php_apache_module>, num_additional_modules=1) at main/main.c:2259
zuf = {
error_function = 0xcebe06fd830 <php_error_cb>,
printf_function = 0xcebe06faa80 <php_printf>,
write_function = 0xcebe0720570 <php_output_write>,
fopen_function = 0xcebe06fe610 <php_fopen_wrapper_for_zend>,
message_handler = 0xcebe06fe670 <php_message_handler_for_zend>,
get_configuration_directive = 0xcebe06fe9d0 <php_get_configuration_directive_for_zend>,
ticks_function = 0xcebe071cad0 <php_run_ticks>,
on_timeout = 0xcebe06fc0e0 <php_on_timeout>,
stream_open_function = 0xcebe06fea10 <php_stream_open_for_zend>,
printf_to_smart_string_function = 0xcebe07051f0 <php_printf_to_smart_string>,
printf_to_smart_str_function = 0xcebe0708920 <php_printf_to_smart_str>,
getenv_function = 0xcebe07118a0 <sapi_getenv>,
resolve_path_function = 0xcebe06fea50 <php_resolve_path_for_zend>
}
zuv = {
html_errors = true
}
retval = 0
module_number = 0
php_os = 0xcebdf8e08ea "OpenBSD"
module = 0xcebdf901034
#7 0x00000cebe0b0aa0e in php_apache2_startup (sapi_module=0xcebe0bdaba8 <apache2_sapi_module>)
at sapi/apache2handler/sapi_apache2.c:376
No locals.
#8 0x00000cebe0b09fd5 in php_apache_server_startup (pconf=0xcec6f92c028, plog=0xcec23c36028, ptemp=0xcec66ee5028,
s=0xcec6ecd3110) at sapi/apache2handler/sapi_apache2.c:490
data = 0x1
userdata_key = 0xcebdf90aaf6 "apache2hook_post_config"
#9 0x00000ce9da79c935 in ap_run_post_config (pconf=0xcec6f92c028, plog=0xcec23c36028, ptemp=0xcec66ee5028, s=0xcec6ecd3110)
at config.c:102
rv = <error reading variable rv (Cannot access memory at address 0x0)>
pHook = <optimized out>
n = 9
#10 0x00000ce9da797843 in main (argc=3, argv=0x7f7ffffd4838) at main.c:807
rc = <optimized out>
temp_error_log = <optimized out>
showdirectives = <optimized out>
showcompile = <optimized out>
def_server_root = 0xce9da77d483 "/var/www"
confname = 0xce9da7843c0 "/etc/apache2/httpd2.conf"
process = <optimized out>
pconf = 0xcec6f92c028
pcommands = <optimized out>
error = <optimized out>
opt = <optimized out>
opt_arg = 0x0
c = 0 '\000'
rv = <optimized out>
plog = 0x0
ptemp = 0x0
signal_server = <optimized out>
mod = <optimized out>
Would it be possible for you to create an additional patch in your repository named patch-ex_opcache_ZendAccelerator_c with the following content (for the 8.0.15 version) :
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 6883979e7d..21f92755be 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -2941,7 +2941,7 @@ static int accel_startup(zend_extension *extension) zend_post_startup_cb = accel_post_startup;
/* Prevent unloading */
- extension->handle = 0;
-
//extension->handle = 0;
return SUCCESS; }
and try with a new build ? Just to check something
Yes. Thanks. I will try this patch and get back with an update. If this work perhaps will be needed also for PHP 8.1 ...
note that s not a fix, just to verify something.
I get back with a feedback
I used this patch, based on the patch you proposed:
--- ext/opcache/ZendAccelerator.c.orig
+++ ext/opcache/ZendAccelerator.c
@@ -2940,9 +2940,6 @@
orig_post_startup_cb = zend_post_startup_cb;
zend_post_startup_cb = accel_post_startup;
- /* Prevent unloading */
- extension->handle = 0;
-
return SUCCESS;
}
PHP 8.0.15 and 8.0.16 were compiled successfuly (I tested with both versions).
But now any of the above PHP versions are crashing not only in pkill -HUP 1234 (where 1234 is apache2 PID)
- but also crashing on "rcctl restart apache2"
- and also crashing on "rcctl stop apache2"
Thanks ! @dstogov any idea what would be the cause ?
I noticed that something changed in ZendAccelerator.c because in PHP 7.3, this line extension->handle = 0; is not present. And the PHP 7.3 is not crashing at all ...
Since in PHP 7.4 / PHP 8.0 / PHP 8.1 this line extension->handle = 0; appears and is needed (because without this line will crash in more situations), I presume something inside the ZendAccelerator loading mechanism was changed since PHP 7.3 and that part is doing the crash on SIGHUP ... sorry, I am not a C expert ... but my expertise is in Go lang, PHP and Javascript only ... for the rest like C / C++ I have only medium skills ... and this situation is too complex
Perhaps I forgot to mention (not sure if relevant for this issue or not): on OpenBSD the PHP Opcache can use only 'mmap' or 'posix" memory models that can be set with opcache.preferred_memory_model. The 'shm' memory model is not working at all on OpenBSD.
The default looks to be 'mmap'. I also tried 'posix' but the results are identical for the situations where it crashes.
I was looking over the changes between PHP 7.3 / 7.4 / 8.0 in ZendAccelerator.c, especially on the parts that handle the SIGKILL.
In 7.3 appears:
if (kill(mem_usage_check->l_pid, SIGKILL)) {
and in 7.4 and 8.0 was changed to
if (kill(mem_usage_check->l_pid, signal)) {
/* If SIGTERM was not sufficient, use SIGKILL. */
signal = SIGKILL;
@unix-world can you please check if graceful Apache restart (kill -USR1) works or not.
I've just checked.
kill -USR1 1234 still crashes the apache2 ...
but kill -TERM 1234 does not crash apache2 ...
OpenBSD is not using systemd. It is using SystemV like scripts ... but in the way of other BSD platforms (NetBSD or FreeBSD).
The content of /etc/rc.d/apache2 startup script:
#!/bin/ksh
#
# $OpenBSD: apache2.rc,v 1.6 2020/12/13 08:45:14 giovanni Exp $
daemon="/usr/local/sbin/httpd2"
. /etc/rc.d/rc.subr
# mod_perl resets $0 to argv[0]
pexp=".*${daemon}.*"
rc_reload=NO
rc_start() {
/usr/local/sbin/apachectl2 graceful ${daemon_flags}
}
rc_stop() {
/usr/local/sbin/apachectl2 graceful-stop ${daemon_flags}
}
rc_cmd $1
Thus when doing rcctl restart apache2 it uses /usr/local/sbin/apachectl2 graceful-stop which as appears in the logs, will do [mpm_prefork:notice] [pid 80895] AH00170: caught SIGWINCH, shutting down gracefully
If I try kill -WINCH 1234 will also not crash apache
When building from the source the PHP 8.0, I recorded several warnings I have seen:
/_PORTS/pobj/php-8.0.16/php-8.0.16/sapi/apache2handler/apache_config.c:213:7: warning: missing field 'func' initializer [-Wmissing-field-initializers]
{NULL}
^
/_PORTS/pobj/php-8.0.16/php-8.0.16/ext/shmop/shmop.c:203:20: warning: result of comparison of constant 9223372036854775807 with expression of type 'int' is always false [-Wtautological-constant-out-of-range-compare]
if (shm.shm_segsz > ZEND_LONG_MAX) {
~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~
In file included from /_PORTS/pobj/php-8.0.16/php-8.0.16/ext/opcache/jit/zend_jit.c:215:
In file included from ext/opcache/jit/zend_jit_disasm_x86.c:25:
ext/opcache/jit/libudis86/syn.c:144:49: warning: format specifies type 'long' but the argument has type 'int64_t' (aka 'long long') [-Wformat]
ud_asmprintf(u, "%s%+" FMT64 "d", name, offset);
~~~~~~~~~~~~ ^~~~~~
%+lld
ext/opcache/jit/libudis86/syn.c:151:36: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
ud_asmprintf(u, "0x%" FMT64 "x", addr);
~~~~~~~~~~~ ^~~~
%llx
ext/opcache/jit/libudis86/syn.c:184:51: warning: format specifies type 'long' but the argument has type 'int64_t' (aka 'long long') [-Wformat]
ud_asmprintf(u, "%s%+" FMT64 "d", name, offset);
~~~~~~~~~~~~ ^~~~~~
%+lld
ext/opcache/jit/libudis86/syn.c:192:36: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
ud_asmprintf(u, "0x%" FMT64 "x", v);
~~~~~~~~~~~ ^
%llx
ext/opcache/jit/libudis86/syn.c:216:51: warning: format specifies type 'long' but the argument has type 'int64_t' (aka 'long long') [-Wformat]
ud_asmprintf(u, "%s%+" FMT64 "d", name, offset);
~~~~~~~~~~~~ ^~~~~~
%+lld
ext/opcache/jit/libudis86/syn.c:224:38: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
ud_asmprintf(u, "0x%" FMT64 "x", v);
~~~~~~~~~~~ ^
%llx
ext/opcache/jit/libudis86/syn.c:240:51: warning: format specifies type 'long' but the argument has type 'int64_t' (aka 'long long') [-Wformat]
ud_asmprintf(u, "%s%+" FMT64 "d", name, offset);
~~~~~~~~~~~~ ^~~~~~
%+lld
ext/opcache/jit/libudis86/syn.c:249:41: warning: format specifies type 'unsigned long' but the argument has type 'int64_t' (aka 'long long') [-Wformat]
ud_asmprintf(u, "-0x%" FMT64 "x", -v);
~~~~~~~~~~~ ^~
%llx
ext/opcache/jit/libudis86/syn.c:251:58: warning: format specifies type 'unsigned long' but the argument has type 'int64_t' (aka 'long long') [-Wformat]
ud_asmprintf(u, "%s0x%" FMT64 "x", sign? "+" : "", v);
~~~~~~~~~~~ ^
%llx
9 warnings generated.
In file included from /_PORTS/pobj/php-8.0.16/php-8.0.16/ext/opcache/jit/zend_jit.c:215:
In file included from ext/opcache/jit/zend_jit_disasm_x86.c:25:
ext/opcache/jit/libudis86/syn.c:144:49: warning: format specifies type 'long' but the argument has type 'int64_t' (aka 'long long') [-Wformat]
ud_asmprintf(u, "%s%+" FMT64 "d", name, offset);
~~~~~~~~~~~~ ^~~~~~
%+lld
ext/opcache/jit/libudis86/syn.c:151:36: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
ud_asmprintf(u, "0x%" FMT64 "x", addr);
~~~~~~~~~~~ ^~~~
%llx
ext/opcache/jit/libudis86/syn.c:184:51: warning: format specifies type 'long' but the argument has type 'int64_t' (aka 'long long') [-Wformat]
ud_asmprintf(u, "%s%+" FMT64 "d", name, offset);
~~~~~~~~~~~~ ^~~~~~
%+lld
ext/opcache/jit/libudis86/syn.c:192:36: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
ud_asmprintf(u, "0x%" FMT64 "x", v);
~~~~~~~~~~~ ^
%llx
ext/opcache/jit/libudis86/syn.c:216:51: warning: format specifies type 'long' but the argument has type 'int64_t' (aka 'long long') [-Wformat]
ud_asmprintf(u, "%s%+" FMT64 "d", name, offset);
~~~~~~~~~~~~ ^~~~~~
%+lld
ext/opcache/jit/libudis86/syn.c:224:38: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
ud_asmprintf(u, "0x%" FMT64 "x", v);
~~~~~~~~~~~ ^
%llx
ext/opcache/jit/libudis86/syn.c:240:51: warning: format specifies type 'long' but the argument has type 'int64_t' (aka 'long long') [-Wformat]
ud_asmprintf(u, "%s%+" FMT64 "d", name, offset);
~~~~~~~~~~~~ ^~~~~~
%+lld
ext/opcache/jit/libudis86/syn.c:249:41: warning: format specifies type 'unsigned long' but the argument has type 'int64_t' (aka 'long long') [-Wformat]
ud_asmprintf(u, "-0x%" FMT64 "x", -v);
~~~~~~~~~~~ ^~
%llx
ext/opcache/jit/libudis86/syn.c:251:58: warning: format specifies type 'unsigned long' but the argument has type 'int64_t' (aka 'long long') [-Wformat]
ud_asmprintf(u, "%s0x%" FMT64 "x", sign? "+" : "", v);
~~~~~~~~~~~ ^
%llx
9 warnings generated.
/_PORTS/pobj/php-8.0.16/php-8.0.16/sapi/fpm/fpm/fpm_log.c:217:56: warning: format specifies type 'unsigned long' but the argument has type 'unsigned long long' [-Wformat]
len2 = snprintf(b, FPM_LOG_BUFFER - len, "%lu", proc.duration.tv_sec * 1000000UL + proc.duration.tv_usec);
~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%llu
1 warning generated.
Differences between PHP 7.3.33 and 8.0.16 in ext/opcache/ZendAccelerator.c that may cause the crashing issue:
in PHP 8.0.16 (crashing) there is:
zend_result accel_post_deactivate(void)
{
if (ZCG(cwd)) {
zend_string_release_ex(ZCG(cwd), 0);
ZCG(cwd) = NULL;
}
if (!ZCG(enabled) || !accel_startup_ok) {
return SUCCESS;
}
zend_shared_alloc_safe_unlock(); /* be sure we didn't leave cache locked */
accel_unlock_all();
ZCG(counted) = 0;
return SUCCESS;
}
in PHP 7.3.33 (not crashing)
int accel_post_deactivate(void)
{
if (!ZCG(enabled) || !accel_startup_ok) {
return SUCCESS;
}
zend_shared_alloc_safe_unlock(); /* be sure we didn't leave cache locked */
accel_unlock_all();
ZCG(counted) = 0;
return SUCCESS;
}
In my opinion (not sure yet) somewhere at these lines the crash is producing for PHP 8.0.16, perhaps in some circumstances cwd is NULL somehow ... because in PHP 8.0 this part is in post-deactivate (crashing) while in PHP 7.3.33 (not crashing) is in a different method :
zend_result accel_post_deactivate(void)
{
if (ZCG(cwd)) {
zend_string_release_ex(ZCG(cwd), 0);
ZCG(cwd) = NULL;
}
PHP 7.3.33
static void accel_deactivate(void)
{
/* ensure that we restore function_table and class_table
* In general, they're restored by persistent_compile_file(), but in case
* the script is aborted abnormally, they may become messed up.
*/
if (ZCG(cwd)) {
zend_string_release_ex(ZCG(cwd), 0);
ZCG(cwd) = NULL;
}
}
This bug is somehow similar with the PHP behavior by calling cwd in a class destructor that also (still) fails ... https://bugs.php.net/bug.php?id=34206 (accessing cwd after destruct).
Thus in my opinion calling (ZCG(cwd)) in post_deactivate (as in PHP 8.0.x) produces the crash ... instead calling it in a separate method like in PHP 7.3.x (accel_deactivate).
I presume this bug is not visible on linux platform (but is still there ...) because the systemd is much more slower (compared with rc.d) on restarting a service like apache ...
https://httpd.apache.org/docs/2.4/stopping.html The kill -HUP is the correct way as apache documentation specify to do when rotating logs. On kill -HUP is expected as apache will stop all the childrens but the main process will not exit and the "Users of mod_status will notice that the server statistics are set to zero when a HUP is sent".
Until this bug is fixed inside PHP opcache, I can only do rcctl restart apache2 everytime when logs are rotated ... but this is not ok (but only as a temporary fix) because proceeding like this the main process of apache is stopped (incl. childrens) and a completely new process is started when proceeding like this ... and if website visitors are connected they will see a temporary error.