Bug #78121 [NEW]: 7.3.6 (but not 7.3.5) segfaults in php_module_shutdown with phalcon ext loaded

From: Date: Thu, 06 Jun 2019 13:53:38 +0000
Subject: Bug #78121 [NEW]: 7.3.6 (but not 7.3.5) segfaults in php_module_shutdown with phalcon ext loaded
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-221170@lists.php.net to get a copy of this message
From: dzuelke at gmail dot com Operating system: Ubuntu 16.04 PHP version: 7.3.6 Package: opcache Bug Type: Bug Bug description:7.3.6 (but not 7.3.5) segfaults in php_module_shutdown with phalcon ext loaded Description: ------------ With the following PHP build: ./configure --disable-phpdbg --with-curl --with-openssl --with-kerberos --with-readline --enable-sockets --enable-debug --enable-opcache-file --without-libzip --with-sodium=shared And having https://github.com/phalcon/cphalcon/ version 3.4.3 installed and loaded (see test script for reproduce instructions), a php -v or php --ri phalcon segfaults: # php -d"extension=phalcon.so" --ri phalcon phalcon … php: /tmp/bob-aEolPN/php-7.3.6/ext/opcache/ZendAccelerator.c:743: accel_replace_string_by_process_permanent: Assertion `!((char*)(str) >= (char*)(accel_shared_globals->interned_strings).start && (char*)(str) < (char*)(accel_shared_globals->interned_strings).top)' failed. Aborted (core dumped) I'm reporting this here because it worked in 7.3.5, and the changelog for 7.3.6 lists changes to OPcache specifically around possible crashes, so maybe these changes broke something unintentionally. Also tracked with phalcon maintainers already at https://github.com/phalcon/cphalcon/issues/14160 Test script: --------------- curl -L https://github.com/phalcon/cphalcon/archive/v3.4.3.tar.gz | tar xz cd cphalcon-3.4.3/build/php7/64bits/ export CC="gcc" export CFLAGS="-O2 -fvisibility=hidden" export CPPFLAGS="-DPHALCON_RELEASE" phpize ./configure --enable-phalcon make -s -j9 ulimit -c unlimited make install Expected result: ---------------- No segfault, like it's the case on PHP 7.3.5. Actual result: -------------- # php -d"extension=phalcon.so" --ri phalcon phalcon … php: /tmp/bob-aEolPN/php-7.3.6/ext/opcache/ZendAccelerator.c:743: accel_replace_string_by_process_permanent: Assertion `!((char*)(str) >= (char*)(accel_shared_globals->interned_strings).start && (char*)(str) < (char*)(accel_shared_globals->interned_strings).top)' failed. Aborted (core dumped) # gdb $(which php) core GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1 Copyright (C) 2016 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-linux-gnu". 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 /app/.heroku/php/bin/php...done. [New LWP 70485] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Core was generated by `php -dextension=phalcon.so --ri phalcon'. Program terminated with signal SIGABRT, Aborted. #0 0x00007f2846204428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54 54 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory. (gdb) bt #0 0x00007f2846204428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54 #1 0x00007f284620602a in __GI_abort () at abort.c:89 #2 0x00007f28461fcbd7 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x7f283edcf820 "!((char*)(str) >= (char*)(accel_shared_globals->interned_strings).start && (char*)(str) < (char*)(accel_shared_globals->interned_strings).top)", file=file@entry=0x7f283edcf7e8 "/tmp/bob-aEolPN/php-7.3.6/ext/opcache/ZendAccelerator.c", line=line@entry=743, function=function@entry=0x7f283edcff20 <__PRETTY_FUNCTION__.19051> "accel_replace_string_by_process_permanent") at assert.c:92 #3 0x00007f28461fcc82 in __GI___assert_fail ( assertion=0x7f283edcf820 "!((char*)(str) >= (char*)(accel_shared_globals->interned_strings).start && (char*)(str) < (char*)(accel_shared_globals->interned_strings).top)", file=0x7f283edcf7e8 "/tmp/bob-aEolPN/php-7.3.6/ext/opcache/ZendAccelerator.c", line=743, function=0x7f283edcff20 <__PRETTY_FUNCTION__.19051> "accel_replace_string_by_process_permanent") at assert.c:101 #4 0x00007f283ed3f731 in accel_replace_string_by_process_permanent ( str=0x7f28367cb210) at /tmp/bob-aEolPN/php-7.3.6/ext/opcache/ZendAccelerator.c:743 #5 0x00007f283ed3eef1 in accel_copy_permanent_strings ( ---Type <return> to continue, or q <return> to quit--- new_interned_string=0x7f283ed3f6b5 <accel_replace_string_by_process_permanent>) at /tmp/bob-aEolPN/php-7.3.6/ext/opcache/ZendAccelerator.c:646 #6 0x00007f283ed3f800 in accel_use_permanent_interned_strings () at /tmp/bob-aEolPN/php-7.3.6/ext/opcache/ZendAccelerator.c:771 #7 0x00000000009e4014 in zend_interned_strings_switch_storage ( request=0 '\000') at /tmp/bob-aEolPN/php-7.3.6/Zend/zend_string.c:336 #8 0x000000000090b9a1 in php_module_shutdown () at /tmp/bob-aEolPN/php-7.3.6/main/main.c:2473 #9 0x0000000000a85bfc in main (argc=4, argv=0x325e070) at /tmp/bob-aEolPN/php-7.3.6/sapi/cli/php_cli.c:1404 -- Edit bug report at https://bugs.php.net/bug.php?id=78121&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=78121&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=78121&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=78121&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=78121&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=78121&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=78121&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=78121&r=needscript Try newer version: https://bugs.php.net/fix.php?id=78121&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=78121&r=support Expected behavior: https://bugs.php.net/fix.php?id=78121&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=78121&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=78121&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=78121&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=78121&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=78121&r=dst IIS Stability: https://bugs.php.net/fix.php?id=78121&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=78121&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=78121&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=78121&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=78121&r=mysqlcfg

« previous php.bugs (#221170) next »