Bug #77312 [Opn]: accel_replace_string_by_process_permanent: Assertion `0' failed

From: Date: Wed, 09 Jan 2019 09:05:58 +0000
Subject: Bug #77312 [Opn]: accel_replace_string_by_process_permanent: Assertion `0' failed
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-218859@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77312&edit=1

 ID:                 77312
 Updated by:         nikic@php.net
 Reported by:        sjon at hortensius dot net
 Summary:            accel_replace_string_by_process_permanent: Assertion
                     `0' failed
 Status:             Open
 Type:               Bug
 Package:            opcache
 Operating System:   archlinux
 PHP Version:        7.3.0
 Block user comment: N
 Private report:     N

 New Comment:

Could you please provide a backtrace for the assertion failure? That way we'd know which string
it is trying to replace.


Previous Comments:
------------------------------------------------------------------------
[2019-01-09 08:50:59] sjon at hortensius dot net

@lauri thanks for trying - but we don't use persistent MySQL connections in our code. I also
find it highly unlikely that could cause opcache errors

------------------------------------------------------------------------
[2019-01-07 19:29:04] lauri dot kentta at gmail dot com

This could be related to bug #77289. In that case, disabling persistent MySQL connections should fix
it. Can you try that?

------------------------------------------------------------------------
[2018-12-27 17:05:04] lauri dot kentta at gmail dot com

I'm afraid that backtrace is for a different bug 77359 (for which I've sent a patch
already).

It might be useful to get a backtrace of this specific problem and/or to see what variable str
contains just before that assertion in ext/opcache/ZendAccelerator.c:737 (and to know what that
value represents in the project, i.e. is it a function or a class name or what).

------------------------------------------------------------------------
[2018-12-18 15:43:41] bugs dot php dot net at mundpropaganda dot net

This might be related to bug #77289 which I reported earlier. I'm also using Archlinux. Crashes
happen with official pkgs and manually compiled binaries.

Reading your report I did another run with a debug-enabled build (didn't think about enabling
it before) and got these results:

Debug log:

[18-Dec-2018 16:32:26] WARNING: [pool amm-php73] child 30823 said into stderr: "3:
/home/krist/tmp/php-7.3.0/Zend/zend_string.h:260: zend_string_free: Assertion
`zend_gc_refcount(&(s)->gc) <= 1' failed."
[18-Dec-2018 16:32:27] WARNING: [pool amm-php73] child 30823 exited on signal 6 (SIGABRT - core
dumped) after 9.728186 seconds from start

GDB backtrace:

Reading symbols from /opt/php/php-7.3/sbin/php-fpm...done.
[New LWP 30851]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Core was generated by `php-fpm: pool amm-php73                                                    
'.
Program terminated with signal SIGABRT, Aborted.
#0  0x00007f43e1367d7f in raise () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007f43e1367d7f in raise () from /usr/lib/libc.so.6
#1  0x00007f43e1352672 in abort () from /usr/lib/libc.so.6
#2  0x00007f43e1352548 in __assert_fail_base.cold.0 () from /usr/lib/libc.so.6
#3  0x00007f43e1360396 in __assert_fail () from /usr/lib/libc.so.6
#4  0x000055e6e1fc1f49 in zend_string_free (s=0x7f43d7bdb4b0)
    at /home/krist/tmp/php-7.3.0/Zend/zend_string.h:260
#5  0x000055e6e1fc355c in zif_spl_autoload (execute_data=0x7f43e0a1fbb0,
    return_value=0x7ffed7d4a340) at /home/krist/tmp/php-7.3.0/ext/spl/php_spl.c:338
#6  0x000055e6e2280f1b in ZEND_DO_ICALL_SPEC_RETVAL_UNUSED_HANDLER ()
    at /home/krist/tmp/php-7.3.0/Zend/zend_vm_execute.h:645
#7  0x000055e6e22ee472 in execute_ex (ex=0x7f43e0a1fb20)
    at /home/krist/tmp/php-7.3.0/Zend/zend_vm_execute.h:55414
#8  0x000055e6e2201914 in zend_call_function (fci=0x7ffed7d4a680, fci_cache=0x7ffed7d4a660)
    at /home/krist/tmp/php-7.3.0/Zend/zend_execute_API.c:756
#9  0x000055e6e1fc3a47 in zif_spl_autoload_call (execute_data=0x7f43e0a1fac0,
    return_value=0x7ffed7d4a860) at /home/krist/tmp/php-7.3.0/ext/spl/php_spl.c:448
#10 0x000055e6e2201a01 in zend_call_function (fci=0x7ffed7d4a890, fci_cache=0x7ffed7d4a870)
    at /home/krist/tmp/php-7.3.0/Zend/zend_execute_API.c:770
#11 0x000055e6e22021d3 in zend_lookup_class_ex (name=0x7f43d7bdb4b0, key=0x0, use_autoload=1)
    at /home/krist/tmp/php-7.3.0/Zend/zend_execute_API.c:926
#12 0x000055e6e22022be in zend_lookup_class (name=0x7f43d7bdb4b0)
    at /home/krist/tmp/php-7.3.0/Zend/zend_execute_API.c:947
#13 0x000055e6e223b4b4 in zif_class_exists (execute_data=0x7f43e0a1fa60,
    return_value=0x7f43e0a1fa40) at /home/krist/tmp/php-7.3.0/Zend/zend_builtin_functions.c:1446
#14 0x000055e6e228113a in ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER ()
    at /home/krist/tmp/php-7.3.0/Zend/zend_vm_execute.h:690
#15 0x000055e6e22ee47f in execute_ex (ex=0x7f43e0a1f030)
    at /home/krist/tmp/php-7.3.0/Zend/zend_vm_execute.h:55418
#16 0x000055e6e22f3aa5 in zend_execute (op_array=0x7f43e0a75000, return_value=0x0)
    at /home/krist/tmp/php-7.3.0/Zend/zend_vm_execute.h:60834
#17 0x000055e6e2219688 in zend_execute_scripts (type=8, retval=0x0, file_count=3)
    at /home/krist/tmp/php-7.3.0/Zend/zend.c:1568
#18 0x000055e6e217fbb6 in php_execute_script (primary_file=0x7ffed7d4d0c0)
    at /home/krist/tmp/php-7.3.0/main/main.c:2630
#19 0x000055e6e2306d91 in main (argc=3, argv=0x7ffed7d4d558)
    at /home/krist/tmp/php-7.3.0/sapi/fpm/fpm/fpm_main.c:1950

I hope this helps!

------------------------------------------------------------------------
[2018-12-17 15:48:39] sjon at hortensius dot net

Description:
------------
since my fpm childs started segfaulting I've installed a debug-build which yielded the given
message. Since this is a production machine and this happens infrequently I would like to know how
much (and what) context is required to fix this. The full message:

ext/opcache/ZendAccelerator.c:737: accel_replace_string_by_process_permanent: Assertion `0'
failed.

this happens on only a subset of pools in the fpm configuration. It segfaults roughly once every ~
100 hits and asserts roughly every hit



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=77312&edit=1


Thread (26 messages)

« previous php.bugs (#218859) next »