|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75837 Segfault with Opcache and error suppression
Submitted: 2018-01-17 22:50 UTC Modified: 2018-01-17 23:21 UTC
From: dzuelke at gmail dot com Assigned:
Status: Duplicate Package: opcache
PHP Version: 7.2.1 OS: macOS 10.13.2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: dzuelke at gmail dot com
New email:
PHP Version: OS:


 [2018-01-17 22:50 UTC] dzuelke at gmail dot com
Pretty simple to reproduce. Happens only when the variable is not initialized first. Also sometimes requires two or three invocations until it first crashes, no idea why. Needs opcache.enable_cli=1 of course to reproduce.

Does not happen on 7.1.13. Also happens on other OSes (e.g. Ubuntu 14/16, with self-built PHP).

Test script:

function foo() {


Actual result:
$ gdb php-7.2.1/bin/php
(gdb) run -dopcache.enable_cli=1 sigsegv72.php
Starting program: php-7.2.1/bin/php -dopcache.enable_cli=1 sigsegv72.php
[New Thread 0x1703 of process 46816]
warning: unhandled dyld version (15)

Thread 2 received signal SIGSEGV, Segmentation fault.
0x0000000100636c5b in execute_ex (ex=0x101222030)
    at Zend/zend_vm_execute.h:59726
59726			if (UNEXPECTED((ret = ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)) != 0)) {
(gdb) bt
#0  0x0000000100636c5b in execute_ex (ex=0x101222030)
    at Zend/zend_vm_execute.h:59726
#1  0x0000000100636e6a in zend_execute (op_array=0x10127b600, return_value=0x0)
    at Zend/zend_vm_execute.h:63763
#2  0x00000001005cdc92 in zend_execute_scripts (type=8, retval=0x0, 
    file_count=3) at Zend/zend.c:1496
#3  0x0000000100520932 in php_execute_script (primary_file=0x7ffeefbff318)
    at main/main.c:2590
#4  0x00000001006f3d9d in do_cli (argc=4, argv=0x7ffeefbffa40)
    at sapi/cli/php_cli.c:1011
#5  0x00000001006f2d2c in main (argc=4, argv=0x7ffeefbffa40)
    at sapi/cli/php_cli.c:1404


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-01-17 23:19 UTC]
I can't reproduce this with current 7.2 or master.
 [2018-01-17 23:21 UTC]
-Status: Open +Status: Duplicate
 [2018-01-17 23:21 UTC]
Ah, looks like this is a duplicate of bug #75698, which has been fixed in 7.2.2.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 13 16:01:31 2024 UTC