Bug #78429 [Ana->Csd]: opcache_compile_file(__FILE__); segfaults

From: Date: Mon, 16 Sep 2019 14:02:23 +0000
Subject: Bug #78429 [Ana->Csd]: opcache_compile_file(__FILE__); segfaults
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-222767@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78429&edit=1 ID: 78429 Updated by: cmb@php.net Reported by: sjon@php.net Summary: opcache_compile_file(__FILE__); segfaults -Status: Analyzed +Status: Closed Type: Bug Package: opcache PHP Version: 7.4.0beta2 Block user comment: N Private report: N New Comment: Automatic comment on behalf of cmbecker69@gmx.de Revision: http://git.php.net/?p=php-src.git;a=commit;h=20f73d3d8f2f2664288d1e70930f047605bfb44f Log: Fix #78429: opcache_compile_file(__FILE__); segfaults Previous Comments: ------------------------------------------------------------------------ [2019-08-20 15:59:31] cmb@php.net The following pull request has been associated: Patch Name: Fix #78429: opcache_compile_file(__FILE__); segfaults On GitHub: https://github.com/php/php-src/pull/4570 Patch: https://github.com/php/php-src/pull/4570.patch ------------------------------------------------------------------------ [2019-08-20 12:57:18] cmb@php.net We're calling accelator_orig_compile_file()[1], but the function pointer is NULL in this case. [1] <https://github.com/php/php-src/blob/ae923287cada2bb59877e806c8219b74f7d857d5/ext/opcache/ZendAccelerator.c#L1923> ------------------------------------------------------------------------ [2019-08-20 12:44:19] sjon@php.net interesting find. So probably this has never worked (compile on __FILE__ ) and removing that check exposed this bug ------------------------------------------------------------------------ [2019-08-20 12:38:05] cmb@php.net Allowing to call opcache_compile_file() even if OPcache is disabled has been a deliberate change: <http://git.php.net/?p=php-src.git;a=commit;h=03fc3d85d8a0624c7a1171576db9cf44575763b0> ------------------------------------------------------------------------ [2019-08-20 11:39:14] requinix@php.net (gdb) bt #0 0x0000000000000000 in ?? () #1 0x00007ffff4904164 in persistent_compile_file (file_handle=0x7ffffffea720, type=2) at /root/php/src/ext/opcache/ZendAccelerator.c:1923 #2 0x00007ffff491067c in zif_opcache_compile_file (execute_data=0x7ffff5214080, return_value=0x7ffffffea870) at /root/php/src/ext/opcache/zend_accelerator_module.c:868 #3 0x00000000086e2823 in ZEND_DO_ICALL_SPEC_RETVAL_UNUSED_HANDLER () at /root/php/src/Zend/zend_vm_execute.h:1274 #4 0x000000000874714d in execute_ex (ex=0x7ffff5214020) at /root/php/src/Zend/zend_vm_execute.h:53449 #5 0x000000000874b269 in zend_execute (op_array=0x7ffff5280300, return_value=0x0) at /root/php/src/Zend/zend_vm_execute.h:57553 #6 0x00000000086705c7 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /root/php/src/Zend/zend.c:1663 #7 0x00000000085d2988 in php_execute_script (primary_file=0x7ffffffed010) at /root/php/src/main/main.c:2611 #8 0x000000000874de75 in do_cli (argc=8, argv=0x965b970) at /root/php/src/sapi/cli/php_cli.c:962 #9 0x000000000874efde in main (argc=8, argv=0x965b970) at /root/php/src/sapi/cli/php_cli.c:1352 (gdb) f 1 #1 0x00007ffff4904164 in persistent_compile_file (file_handle=0x7ffffffea720, type=2) at /root/php/src/ext/opcache/ZendAccelerator.c:1923 1923 return accelerator_orig_compile_file(file_handle, type); (gdb) p accelerator_orig_compile_file $4 = (zend_op_array *(*)(zend_file_handle *, int)) 0x0 ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=78429 -- Edit this bug report at https://bugs.php.net/bug.php?id=78429&edit=1

« previous php.bugs (#222767) next »