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
a backtrace would help, if I recall correctly, openbsd tends to generate a coredump as <process name>.core (so php.core most likely here) where the said process had been called. What might help further in your case eventually is to write to [email protected] so they might help you generate a version with debug symbols so we can get more useful informations. And maybe opcache settings.
There is no php.core, only httpd2.core. I tried looking but there are not enough debug symbols within ... perhaps need a binary package with DEBUG=on ... The opcache settings I excluded since I can switch between PHP 7.3.33 / 7.4.27 / 8.0.15 / 8.1.2 and with the same opcache settings the PHP 7.3.33 is not crashing apache.
This crash is very weird. If I do 'rcctl restart apache2' it does not crash ... (this is like in linux: systemctl restart apache2' If I do kill -HUP 12345 (where 12345 is the process ID number) it crashes with a core dump, but only with PHP 7.4 / 8.0 / 8.1 and not with 7.3 ! ... (and only if opcache is loaded as a PHP extension, not in the rest).
This is the output of GDB
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-7.4/modules/opcache.so...done. Loaded symbols for /usr/local/lib/php-7.4/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-7.4/libphp7.so...done. Loaded symbols for /usr/local/lib/php-7.4/libphp7.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/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/php-7.4/modules/bz2.so...done. Loaded symbols for /usr/local/lib/php-7.4/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-7.4/modules/curl.so...done. Loaded symbols for /usr/local/lib/php-7.4/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-7.4/modules/dba.so...done. Loaded symbols for /usr/local/lib/php-7.4/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-7.4/modules/gd.so...done. Loaded symbols for /usr/local/lib/php-7.4/modules/gd.so 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/libwebp.so.4.3...done. Loaded symbols for /usr/local/lib/libwebp.so.4.3 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/X11R6/lib/libfreetype.so.30.0...done. Loaded symbols for /usr/X11R6/lib/libfreetype.so.30.0 Reading symbols from /usr/local/lib/php-7.4/modules/gmp.so...done. Loaded symbols for /usr/local/lib/php-7.4/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-7.4/modules/intl.so...done. Loaded symbols for /usr/local/lib/php-7.4/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/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/php-7.4/modules/mongodb.so...done. Loaded symbols for /usr/local/lib/php-7.4/modules/mongodb.so Reading symbols from /usr/lib/libtls.so.22.0...done. Loaded symbols for /usr/lib/libtls.so.22.0 Reading symbols from /usr/local/lib/php-7.4/modules/mysqli.so...done. Loaded symbols for /usr/local/lib/php-7.4/modules/mysqli.so Reading symbols from /usr/local/lib/php-7.4/modules/pdo_mysql.so...done. Loaded symbols for /usr/local/lib/php-7.4/modules/pdo_mysql.so Reading symbols from /usr/local/lib/php-7.4/modules/pdo_pgsql.so...done. Loaded symbols for /usr/local/lib/php-7.4/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-7.4/modules/pgsql.so...done. Loaded symbols for /usr/local/lib/php-7.4/modules/pgsql.so Reading symbols from /usr/local/lib/php-7.4/modules/zip.so...done. Loaded symbols for /usr/local/lib/php-7.4/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 0x00000ce72b51aeb0 in ?? ()
There is nothing more ... in the GDB output !
Also maybe this can help you:
(gdb) list 1 /usr/src/lib/libtls/tls.c: No such file or directory. in /usr/src/lib/libtls/tls.c (gdb) info locals No symbol table info available. (gdb) bt #0 0x000008f23da53eb0 in ?? () #1 0x000008f2ef2029e7 in accel_startup () from /usr/local/lib/php-7.4/modules/opcache.so #2 0x000008f2931d9126 in zend_extension_startup () from /usr/local/lib/php-7.4/libphp7.so #3 0x000008f2931bbf59 in zend_llist_apply_with_del () from /usr/local/lib/php-7.4/libphp7.so #4 0x000008f2931d90e5 in zend_startup_extensions () from /usr/local/lib/php-7.4/libphp7.so #5 0x000008f29315039e in php_module_startup () from /usr/local/lib/php-7.4/libphp7.so #6 0x000008f293275853 in php_apache2_startup () from /usr/local/lib/php-7.4/libphp7.so #7 0x000008f2932750e7 in php_apache_server_startup () from /usr/local/lib/php-7.4/libphp7.so #8 0x000008f02f5b4955 in ap_run_post_config () from /usr/local/sbin/httpd2 #9 0x000008f02f5b36a5 in main () from /usr/local/sbin/httpd2 (gdb)
(gdb) bt full #0 0x000008f23da53eb0 in ?? () No symbol table info available. #1 0x000008f2ef2029e7 in accel_startup () from /usr/local/lib/php-7.4/modules/opcache.so No symbol table info available. #2 0x000008f2931d9126 in zend_extension_startup () from /usr/local/lib/php-7.4/libphp7.so No symbol table info available. #3 0x000008f2931bbf59 in zend_llist_apply_with_del () from /usr/local/lib/php-7.4/libphp7.so No symbol table info available. #4 0x000008f2931d90e5 in zend_startup_extensions () from /usr/local/lib/php-7.4/libphp7.so No symbol table info available. #5 0x000008f29315039e in php_module_startup () from /usr/local/lib/php-7.4/libphp7.so No symbol table info available. #6 0x000008f293275853 in php_apache2_startup () from /usr/local/lib/php-7.4/libphp7.so No symbol table info available. #7 0x000008f2932750e7 in php_apache_server_startup () from /usr/local/lib/php-7.4/libphp7.so No symbol table info available. #8 0x000008f02f5b4955 in ap_run_post_config () from /usr/local/sbin/httpd2 No symbol table info available. #9 0x000008f02f5b36a5 in main () from /usr/local/sbin/httpd2 No symbol table info available.
Even if i use just this in opcache.ini zend_extension=opcache.so
or if I use: zend_extension=opcache.so opcache.enable = 1 opcache.enable_cli = 0 opcache.memory_consumption = 512 opcache.interned_strings_buffer = 16 opcache.max_accelerated_files = 5000 opcache.max_wasted_percentage = 5 opcache.use_cwd = 1 opcache.validate_timestamps = 1 opcache.revalidate_freq = 2 opcache.revalidate_path = 0 opcache.save_comments = 0 opcache.load_comments = 0 opcache.fast_shutdown = 0 opcache.enable_file_override = 0 ;opcache.optimization_level = 0x00000000 opcache.inherited_hack = 1 opcache.blacklist_filename = "" opcache.max_file_size = 0 opcache.consistency_checks = 0 opcache.force_restart_timeout = 180 opcache.error_log = "/var/log/apache2/php-opcache-errors.log" opcache.log_verbosity_level = 1 opcache.preferred_memory_model = "" opcache.protect_memory = 0
It crashes with any of these configs (default or custom) for opcache.ini ... This opcache.ini I am using since many years and worked OK. I recently turned on PHP 7.4 and I noticed this crash. Since I am able to still test this crash also with PHP 7.3 it does not crashes but only crashes with 7.4 / 8.0 / 8.1 if opcache.so is loaded :-(
Core
| PHP Version | 7.4.27 |
|---|
Core PHP Version 7.4.27 Directive Local Value Master Value allow_url_fopen Off Off allow_url_include Off Off arg_separator.input & & arg_separator.output & & auto_append_file no value no value auto_globals_jit On On auto_prepend_file no value no value browscap no value no value default_charset UTF-8 UTF-8 default_mimetype text/html text/html disable_classes no value no value disable_functions no value no value display_errors Off Off display_startup_errors Off Off doc_root no value no value docref_ext no value no value docref_root no value no value enable_dl Off Off enable_post_data_reading On On error_append_string no value no value error_log no value no value error_prepend_string no value no value error_reporting 22527 22527 expose_php On On extension_dir /usr/local/lib/php-7.4/modules /usr/local/lib/php-7.4/modules file_uploads On On hard_timeout 2 2 highlight.comment #FF8000 #FF8000 highlight.default #0000BB #0000BB highlight.html #000000 #000000 highlight.keyword #007700 #007700 highlight.string #DD0000 #DD0000 html_errors On On ignore_repeated_errors Off Off ignore_repeated_source Off Off ignore_user_abort Off Off implicit_flush Off Off include_path .:/pear/lib:/var/www/pear/lib .:/pear/lib:/var/www/pear/lib input_encoding no value no value internal_encoding no value no value log_errors On On log_errors_max_len 1024 1024 mail.add_x_header Off Off mail.force_extra_parameters no value no value mail.log no value no value max_execution_time 30 30 max_file_uploads 20 20 max_input_nesting_level 64 64 max_input_time 60 60 max_input_vars 1000 1000 memory_limit 256M 256M open_basedir no value no value output_buffering 4096 4096 output_encoding no value no value output_handler no value no value post_max_size 178M 178M precision 14 14 realpath_cache_size 4096K 4096K realpath_cache_ttl 120 120 register_argc_argv Off Off report_memleaks On On report_zend_debug On On request_order GP GP sendmail_from no value no value sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i serialize_precision -1 -1 short_open_tag Off Off SMTP localhost localhost smtp_port 25 25 sys_temp_dir no value no value syslog.facility LOG_USER LOG_USER syslog.filter no-ctrl no-ctrl syslog.ident php php track_errors Off Off unserialize_callback_func no value no value upload_max_filesize 172M 172M upload_tmp_dir no value no value user_dir no value no value user_ini.cache_ttl 300 300 user_ini.filename .user.ini .user.ini variables_order GPCS GPCS xmlrpc_error_number 0 0 xmlrpc_errors Off Off zend.assertions -1 -1 zend.detect_unicode On On zend.enable_gc On On zend.exception_ignore_args On On zend.multibyte Off Off zend.script_encoding no value no value zend.signal_check Off Off
pcre
| PCRE (Perl Compatible Regular Expressions) Support | enabled |
|---|---|
| PCRE Library Version | 10.35 2020-05-09 |
| PCRE Unicode Version | 13.0.0 |
| PCRE JIT Support | not compiled in |
pcre PCRE (Perl Compatible Regular Expressions) Support enabled PCRE Library Version 10.35 2020-05-09 PCRE Unicode Version 13.0.0 PCRE JIT Support not compiled in
Zend OPcache
| Opcode Caching | Up and Running |
|---|---|
| Optimization | Enabled |
| SHM Cache | Enabled |
| File Cache | Disabled |
| Startup | OK |
| Shared memory model | mmap |
| Cache hits | 0 |
| Cache misses | 1 |
| Used memory | 17160440 |
| Free memory | 519710472 |
| Wasted memory | 0 |
| Interned Strings Used memory | 387632 |
| Interned Strings Free memory | 12194832 |
| Cached scripts | 1 |
| Cached keys | 2 |
| Max keys | 7963 |
| OOM restarts | 0 |
| Hash keys restarts | 0 |
| Manual restarts | 0 |
Zend OPcache Opcode Caching Up and Running Optimization Enabled SHM Cache Enabled File Cache Disabled Startup OK Shared memory model mmap Cache hits 0 Cache misses 1 Used memory 17160440 Free memory 519710472 Wasted memory 0 Interned Strings Used memory 387632 Interned Strings Free memory 12194832 Cached scripts 1 Cached keys 2 Max keys 7963 OOM restarts 0 Hash keys restarts 0 Manual restarts 0 Directive Local Value Master Value opcache.blacklist_filename no value no value opcache.consistency_checks 0 0 opcache.dups_fix Off Off opcache.enable On On opcache.enable_cli Off Off opcache.enable_file_override Off Off opcache.error_log /var/log/apache2/php-opcache-errors.log /var/log/apache2/php-opcache-errors.log opcache.file_cache no value no value opcache.file_cache_consistency_checks On On opcache.file_cache_only Off Off opcache.file_update_protection 2 2 opcache.force_restart_timeout 180 180 opcache.huge_code_pages Off Off opcache.interned_strings_buffer 16 16 opcache.lockfile_path /tmp /tmp opcache.log_verbosity_level 1 1 opcache.max_accelerated_files 5000 5000 opcache.max_file_size 0 0 opcache.max_wasted_percentage 5 5 opcache.memory_consumption 512 512 opcache.opt_debug_level 0 0 opcache.optimization_level 0x7FFEBFFF 0x7FFEBFFF opcache.preferred_memory_model no value no value opcache.preload no value no value opcache.preload_user no value no value opcache.protect_memory Off Off opcache.restrict_api no value no value opcache.revalidate_freq 2 2 opcache.revalidate_path Off Off opcache.save_comments Off Off opcache.use_cwd On On opcache.validate_permission Off Off opcache.validate_root Off Off opcache.validate_timestamps On On
The only difference I see between rcctl restart apache2 (not crashing) and kill -HUP 12345 (crashing) is in errors.log as:
restarting via rcctl says in log: caught SIGWINCH, shutting down gracefully (ok, not crashing)
but with kill -HUP says in log: SIGHUP received. Attempting to restart (in this situation is crashing all the time ...)
(gdb) bt full #0 0x000008f23da53eb0 in ?? () No symbol table info available. #1 0x000008f2ef2029e7 in accel_startup () from /usr/local/lib/php-7.4/modules/opcache.so No symbol table info available. #2 0x000008f2931d9126 in zend_extension_startup () from /usr/local/lib/php-7.4/libphp7.so No symbol table info available. #3 0x000008f2931bbf59 in zend_llist_apply_with_del () from /usr/local/lib/php-7.4/libphp7.so No symbol table info available. #4 0x000008f2931d90e5 in zend_startup_extensions () from /usr/local/lib/php-7.4/libphp7.so No symbol table info available. #5 0x000008f29315039e in php_module_startup () from /usr/local/lib/php-7.4/libphp7.so No symbol table info available. #6 0x000008f293275853 in php_apache2_startup () from /usr/local/lib/php-7.4/libphp7.so No symbol table info available. #7 0x000008f2932750e7 in php_apache_server_startup () from /usr/local/lib/php-7.4/libphp7.so No symbol table info available. #8 0x000008f02f5b4955 in ap_run_post_config () from /usr/local/sbin/httpd2 No symbol table info available. #9 0x000008f02f5b36a5 in main () from /usr/local/sbin/httpd2 No symbol table info available.
thanks however would be best to focus on PHP 8.x, as said in another ticket PHP 7.4 is no longer supported.
There is no php.core, only httpd2.core. I tried looking but there are not enough debug symbols within ... perhaps need a binary package with DEBUG=on ...
That would be ideal if that is possible.
(gdb) bt full #0 0x000008f23da53eb0 in ?? () No symbol table info available. #1 0x000008f2ef2029e7 in accel_startup () from /usr/local/lib/php-7.4/modules/opcache.so No symbol table info available. #2 0x000008f2931d9126 in zend_extension_startup () from /usr/local/lib/php-7.4/libphp7.so No symbol table info available. #3 0x000008f2931bbf59 in zend_llist_apply_with_del () from /usr/local/lib/php-7.4/libphp7.so No symbol table info available. #4 0x000008f2931d90e5 in zend_startup_extensions () from /usr/local/lib/php-7.4/libphp7.so No symbol table info available. #5 0x000008f29315039e in php_module_startup () from /usr/local/lib/php-7.4/libphp7.so No symbol table info available. #6 0x000008f293275853 in php_apache2_startup () from /usr/local/lib/php-7.4/libphp7.so No symbol table info available. #7 0x000008f2932750e7 in php_apache_server_startup () from /usr/local/lib/php-7.4/libphp7.so No symbol table info available. #8 0x000008f02f5b4955 in ap_run_post_config () from /usr/local/sbin/httpd2 No symbol table info available. #9 0x000008f02f5b36a5 in main () from /usr/local/sbin/httpd2 No symbol table info available.
thanks however would be best to focus on PHP 8.x, as said in another ticket PHP 7.4 is no longer supported.
PHP 8.0 and PHP 8.1 are also crashing on OpenBSD 7.0 amd64 with Apache 2.4.52 !
PHP 8.0 GDB
$ 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/mongodb.so...done. Loaded symbols for /usr/local/lib/php-8.0/modules/mongodb.so Reading symbols from /usr/lib/libtls.so.22.0...done. Loaded symbols for /usr/lib/libtls.so.22.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/scrypt.so...done. Loaded symbols for /usr/local/lib/php-8.0/modules/scrypt.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 0x00000ef4ef0358a0 in ?? ()
This is the GDB output for PHP 8.0.15
(gdb) list 1 /usr/src/lib/libtls/tls.c: No such file or directory. in /usr/src/lib/libtls/tls.c (gdb) bt #0 0x00000ef4ef0358a0 in ?? () #1 0x00000ef429536606 in accel_startup () from /usr/local/lib/php-8.0/modules/opcache.so #2 0x00000ef44aa42976 in zend_extension_startup () from /usr/local/lib/php-8.0/libphp.so #3 0x00000ef44aa25889 in zend_llist_apply_with_del () from /usr/local/lib/php-8.0/libphp.so #4 0x00000ef44a9bb45e in php_module_startup () from /usr/local/lib/php-8.0/libphp.so #5 0x00000ef44aae7b43 in php_apache2_startup () from /usr/local/lib/php-8.0/libphp.so #6 0x00000ef44aae73d7 in php_apache_server_startup () from /usr/local/lib/php-8.0/libphp.so #7 0x00000ef1faf93955 in ap_run_post_config () from /usr/local/sbin/httpd2 #8 0x00000ef1faf926a5 in main () from /usr/local/sbin/httpd2 (gdb) bt full #0 0x00000ef4ef0358a0 in ?? () No symbol table info available. #1 0x00000ef429536606 in accel_startup () from /usr/local/lib/php-8.0/modules/opcache.so No symbol table info available. #2 0x00000ef44aa42976 in zend_extension_startup () from /usr/local/lib/php-8.0/libphp.so No symbol table info available. #3 0x00000ef44aa25889 in zend_llist_apply_with_del () from /usr/local/lib/php-8.0/libphp.so No symbol table info available. #4 0x00000ef44a9bb45e in php_module_startup () from /usr/local/lib/php-8.0/libphp.so No symbol table info available. #5 0x00000ef44aae7b43 in php_apache2_startup () from /usr/local/lib/php-8.0/libphp.so No symbol table info available. #6 0x00000ef44aae73d7 in php_apache_server_startup () from /usr/local/lib/php-8.0/libphp.so No symbol table info available. #7 0x00000ef1faf93955 in ap_run_post_config () from /usr/local/sbin/httpd2 No symbol table info available. #8 0x00000ef1faf926a5 in main () from /usr/local/sbin/httpd2 No symbol table info available.
PHP Version 8.0.15
PHP Version 8.0.15 System OpenBSD uxm-server.uxm 7.0 GENERIC.MP#5 amd64 Build Date Feb 17 2022 09:58:07 Build System OpenBSD openbsd70.my.domain 7.0 GENERIC.MP#5 amd64 Configure Command './configure' '--with-pcre-jit=no' '--without-valgrind' '--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 PHP Extension Build API20200930,NTS Debug Build no 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
PHP 8.0.15
Zend OPcache
| Opcode Caching | Up and Running |
|---|---|
| Optimization | Enabled |
| SHM Cache | Enabled |
| File Cache | Disabled |
| JIT | Disabled |
| Startup | OK |
| Shared memory model | mmap |
| Cache hits | 0 |
| Cache misses | 1 |
| Used memory | 9168624 |
| Free memory | 125049104 |
| Wasted memory | 0 |
| Interned Strings Used memory | 394656 |
| Interned Strings Free memory | 5896336 |
| Cached scripts | 1 |
| Cached keys | 2 |
| Max keys | 16229 |
| OOM restarts | 0 |
| Hash keys restarts | 0 |
| Manual restarts | 0 |
Zend OPcache Opcode Caching Up and Running Optimization Enabled SHM Cache Enabled File Cache Disabled JIT Disabled Startup OK Shared memory model mmap Cache hits 0 Cache misses 1 Used memory 9168624 Free memory 125049104 Wasted memory 0 Interned Strings Used memory 394656 Interned Strings Free memory 5896336 Cached scripts 1 Cached keys 2 Max keys 16229 OOM restarts 0 Hash keys restarts 0 Manual restarts 0 Directive Local Value Master Value opcache.blacklist_filename no value no value opcache.consistency_checks 0 0 opcache.dups_fix Off Off opcache.enable On On opcache.enable_cli Off Off opcache.enable_file_override Off Off opcache.error_log no value no value opcache.file_cache no value no value opcache.file_cache_consistency_checks On On opcache.file_cache_only Off Off opcache.file_update_protection 2 2 opcache.force_restart_timeout 180 180 opcache.huge_code_pages Off Off opcache.interned_strings_buffer 8 8 opcache.jit tracing tracing opcache.jit_bisect_limit 0 0 opcache.jit_blacklist_root_trace 16 16 opcache.jit_blacklist_side_trace 8 8 opcache.jit_buffer_size 0 0 opcache.jit_debug 0 0 opcache.jit_hot_func 127 127 opcache.jit_hot_loop 64 64 opcache.jit_hot_return 8 8 opcache.jit_hot_side_exit 8 8 opcache.jit_max_exit_counters 8192 8192 opcache.jit_max_loop_unrolls 8 8 opcache.jit_max_polymorphic_calls 2 2 opcache.jit_max_recursive_calls 2 2 opcache.jit_max_recursive_returns 2 2 opcache.jit_max_root_traces 1024 1024 opcache.jit_max_side_traces 128 128 opcache.jit_prof_threshold 0.005 0.005 opcache.lockfile_path /tmp /tmp opcache.log_verbosity_level 1 1 opcache.max_accelerated_files 10000 10000 opcache.max_file_size 0 0 opcache.max_wasted_percentage 5 5 opcache.memory_consumption 128 128 opcache.opt_debug_level 0 0 opcache.optimization_level 0x7FFEBFFF 0x7FFEBFFF opcache.preferred_memory_model no value no value opcache.preload no value no value opcache.preload_user no value no value opcache.protect_memory Off Off opcache.record_warnings Off Off opcache.restrict_api no value no value opcache.revalidate_freq 2 2 opcache.revalidate_path Off Off opcache.save_comments On On opcache.use_cwd On On opcache.validate_permission Off Off opcache.validate_root Off Off opcache.validate_timestamps On On
Just to answer for the fact you wrote that PHP 7.4 is no more supported ...
I repeat any of: PHP 8.1.2 / PHP 8.0.15 / PHP 7.4.27 are affected by this issue I reported.
Looks like the only unaffected version is PHP 7.3.33 !
I have all 4 versions installed on OpenBSD 7.0, I can switch and use any of these versions. Thus, PHP 7.4.27 is Crashing, PHP 8.0.15 is Crashing, PHP 8.1.2 is Crashing when doing: kill -HUP 12345 (where 12345 is the PID of Apache 2.4.52), apache MPM Prefork.
If I disable in opcache.ini the opcache.so no crash happen in any of these versions !
Thus this makes me think this is something related with the opcache module of PHP.
If I do
rcctl restart apache2
is not crashing because the event here is SIGWINCH
"[mpm_prefork:notice] [pid 31450] AH00170: caught SIGWINCH, shutting down gracefully"
When the apache logs are rotating, as usual it must be: kill -HUP 12345 (where the 12345 is the current Apache2 PID)
I am using OpenBSD since 10 years or so. Log rotation using kill -HUP 12345 did never crashed Apache MPM Prefork with PHP until now. And also now just PHP 7.4 / 8.0 / 8.1 are affected and PHP 7.3 is unaffected.
I recently switched from PHP 7.3.33 to 7.4.27 and I noticed this crash.
I was tought that this issue is perhaps just in PHP 7.4.x thus I installed also PHP 8.0.15 and PHP 8.1.2 to test if works. Except PHP 7.3.33 (which does not crash on SIGHUP), the PHP 7.4.27, PHP 8.0.15 and PHP 8.1.2 are all crashing with SIGHUP !
I will install over the weekend PHP 7.4.28 / 8.0.16 and 8.1.3 and test again but I am sure they will also be crashing because I had not seen any fix regarding the opcache area in the changes between.
This is not an OpenBSD 7.0 or Apache 2.4.52 issue ... PHP 7.3.33 is not crashing under the exact conditions, configurations, OS version and Apache version ... Thus if you would no more consider PHP 7.4 ... OK, but please consider PHP 8.0.x and 8.1.x are crashing on SIGHUP under OpenBSD 7.0 amd64 / Apache 2.4.52.
Perhaps you are confused how different PHP versions can coexist ... under OpenBSD the official packages can coexist all installed and can activate any of them. So this is how I am able to test any PHP version by just switching the Apache PHP module on-the-fly keeping the same configs... https://openports.se/lang/php
Question: which version of PHP would you like me to compile with DEBUG on ? 8.0.16 or 8.1.3 ? I am planning to do this over the weekend ...
since it s most likely a bug fix to consider, PHP 8.0 seems the way to go, at least for starter. we ll see if this is duplicated existing bug or not.