Bug #77182 [Com]: Running opcache_compile_file() on the command line segfaults

From: Date: Thu, 22 Nov 2018 11:26:29 +0000
Subject: Bug #77182 [Com]: Running opcache_compile_file() on the command line segfaults
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-218083@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77182&edit=1 ID: 77182 Comment by: benjamin dot morel at gmail dot com Reported by: benjamin dot morel at gmail dot com Summary: Running opcache_compile_file() on the command line segfaults Status: Open 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: 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 Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#218083) next »