Bug #77182 [Opn->Dup]: Running opcache_compile_file() on the command line segfaults
Edit report at https://bugs.php.net/bug.php?id=77182&edit=1
ID: 77182
Updated by: nikic@php.net
Reported by: benjamin dot morel at gmail dot com
Summary: Running opcache_compile_file() on the command line
segfaults
-Status: Open
+Status: Duplicate
Type: Bug
Package: opcache
Operating System: Fedora 29
PHP Version: master-Git-2018-11-20 (Git)
Block user comment: N
Private report: N
New Comment:
I believe this is the same issue as bug #78429, which has been fixed in the meantime. (The relevant
detail absent from this report is that it requires opcache.enable_cli=0.)
Previous Comments:
------------------------------------------------------------------------
[2018-11-22 11:26:29] benjamin dot morel at gmail dot com
Core was generated by `php /var/www/html/preload.php'.
Program terminated with signal SIGSEGV, Segmentation fault.
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x00007f6be287849d in persistent_compile_file (file_handle=0x7fff4ef6fe80, type=2) at
/root/php-src-master/ext/opcache/ZendAccelerator.c:1890
#2 0x00007f6be288261a in zif_opcache_compile_file (execute_data=0x7f6be2620080,
return_value=0x7fff4ef6ff30) at /root/php-src-master/ext/opcache/zend_accelerator_module.c:860
#3 0x00000000009eb2af in ZEND_DO_ICALL_SPEC_RETVAL_UNUSED_HANDLER () at
/root/php-src-master/Zend/zend_vm_execute.h:655
#4 0x0000000000a53312 in execute_ex (ex=0x7f6be2620020) at
/root/php-src-master/Zend/zend_vm_execute.h:54811
#5 0x0000000000a58948 in zend_execute (op_array=0x7f6be2683300, return_value=0x0) at
/root/php-src-master/Zend/zend_vm_execute.h:60215
#6 0x0000000000987a79 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at
/root/php-src-master/Zend/zend.c:1616
#7 0x00000000008f7648 in php_execute_script (primary_file=0x7fff4ef73730) at
/root/php-src-master/main/main.c:2643
#8 0x0000000000a5b4a2 in do_cli (argc=2, argv=0x2670f10) at
/root/php-src-master/sapi/cli/php_cli.c:997
#9 0x0000000000a5c422 in main (argc=2, argv=0x2670f10) at
/root/php-src-master/sapi/cli/php_cli.c:1389
------------------------------------------------------------------------
[2018-11-21 18:02:19] cmb@php.net
Given that the built-in web server runs under the CLI SAPI, it may
well make sense to call opcache_compile_file().
Anyhow, I can't reproduce the segfault. Please provide a
backtrace[1].
[1] <https://bugs.php.net/bugs-generating-backtrace.php>
------------------------------------------------------------------------
[2018-11-20 15:26:24] benjamin dot morel at gmail dot com
Description:
------------
Even though it does not make sense to call opcache_compile_file() (i.e. attempting to run a preload
script) on the CLI, it would make sense to add a specific error message.
Currently I get a segfault:
Test script:
---------------
php -r "opcache_compile_file('test.php');"
Expected result:
----------------
An error message
Actual result:
--------------
Segmentation fault (core dumped)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77182&edit=1
Thread (4 messages)