php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67997 php crash
Submitted: 2014-09-10 13:55 UTC Modified: 2017-10-24 08:26 UTC
Votes:5
Avg. Score:4.2 ± 1.0
Reproduced:5 of 5 (100.0%)
Same Version:4 (80.0%)
Same OS:1 (20.0%)
From: ialntipov at gmail dot com Assigned:
Status: Suspended Package: xhprof (PECL)
PHP Version: 5.6.0 OS: Ubuntu 14.04.1
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2014-09-10 13:55 UTC] ialntipov at gmail dot com
Description:
------------
Web-pages using xhprof cause crash after update to php 5.6 and xhprof 0.9.4

kernel.log contains strings like segfault at 18 ip 00007ff549d2209e sp 00007fffa2cccb60 error 4 in xhprof.so[7ff549d1e000+6000]

#0  hp_execute_internal (execute_data=0x7fffa2cccc20, fci=0x7fffa2cccdb0, ret=1) at /usr/local/src/xhprof-0.9.4/extension/xhprof.c:1708
#1  0x00000000006c0fd5 in zend_call_function (fci=fci@entry=0x7fffa2cccdb0, fci_cache=fci_cache@entry=0x7fffa2cccd80) at /usr/local/src/php-5.6.0/Zend/zend_execute_API.c:852
#2  0x00000000006c17b2 in zend_lookup_class_ex (name=name@entry=0x7ff4dfd2ab88 "Dap", name_length=<optimized out>, key=0x7ff4d94bb478, use_autoload=use_autoload@entry=1, ce=ce@entry=0x7fffa2ccce48)
    at /usr/local/src/php-5.6.0/Zend/zend_execute_API.c:1008
#3  0x00000000006c1e92 in zend_fetch_class_by_name (class_name=0x7ff4dfd2ab88 "Dap", class_name_len=<optimized out>, key=<optimized out>, fetch_type=0) at /usr/local/src/php-5.6.0/Zend/zend_execute_API.c:1488
#4  0x000000000071c179 in ZEND_FETCH_CLASS_SPEC_CONST_HANDLER (execute_data=0x7ff5519cfb50) at /usr/local/src/php-5.6.0/Zend/zend_vm_execute.h:1409
#5  0x000000000070a668 in execute_ex (execute_data=0x7ff5519cfb50) at /usr/local/src/php-5.6.0/Zend/zend_vm_execute.h:363
#6  0x00000000006d1870 in zend_execute_scripts (type=type@entry=8, retval=retval@entry=0x0, file_count=file_count@entry=3) at /usr/local/src/php-5.6.0/Zend/zend.c:1330
#7  0x0000000000670315 in php_execute_script (primary_file=primary_file@entry=0x7fffa2ccf390) at /usr/local/src/php-5.6.0/main/main.c:2584
#8  0x0000000000427741 in main (argc=<optimized out>, argv=<optimized out>) at /usr/local/src/php-5.6.0/sapi/fpm/fpm/fpm_main.c:1949


Expected result:
----------------
should not crash

Actual result:
--------------
segfault

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-09-29 14:33 UTC] rainer-phpbugs at sevenval dot com
If one builds xhprof with debug info, the exact line number of the crash is displayed. Also using php 5.6.0 and xhprof-0.9.4

Program received signal SIGSEGV, Segmentation fault.
hp_execute_internal (execute_data=0x7fffffffa2b0, fci=0x7fffffffa410, ret=1) at /tmp/pear/xhprof-0.9.4/extension/xhprof.c:1708
1708	    temp_variable *retvar = &EX_T(opline->result.var);
(gdb) bt
#1  0x000000000068e56f in zend_call_function (fci=0x7fffffffa410, fci_cache=<value optimized out>) at build/src/external/php-5.6.0/Zend/zend_execute_API.c:852
#2  0x000000000068e7bc in zend_lookup_class_ex (name=0x7ffff7ef92f0 "ModelException", name_length=14, key=0xf9a220, use_autoload=1, ce=0x7fffffffa518) at build/src/external/php-5.6.0/Zend/zend_execute_API.c:1008
#3  0x000000000068ebff in zend_fetch_class_by_name (class_name=0x7ffff7ef92f0 "ModelException", class_name_len=<value optimized out>, key=<value optimized out>, fetch_type=0)
    at build/src/external/php-5.6.0/Zend/zend_execute_API.c:1488
#4  0x00000000006ea5eb in ZEND_FETCH_CLASS_SPEC_CONST_HANDLER (execute_data=0x7ffff7fa7d38) at build/src/external/php-5.6.0/Zend/zend_vm_execute.h:1409
#5  0x000000000070ce50 in execute_ex (execute_data=0x7ffff7fa7d38) at build/src/external/php-5.6.0/Zend/zend_vm_execute.h:363
#6  0x00007fffeb73329c in hp_execute_ex (execute_data=0x7ffff7fa7d38) at /tmp/pear/xhprof-0.9.4/extension/xhprof.c:1664
#7  0x000000000071dd8f in zend_do_fcall_common_helper_SPEC (execute_data=<value optimized out>) at build/src/external/php-5.6.0/Zend/zend_vm_execute.h:592
#8  0x000000000070ce50 in execute_ex (execute_data=0x7ffff7fa7a28) at build/src/external/php-5.6.0/Zend/zend_vm_execute.h:363
#9  0x00007fffeb73329c in hp_execute_ex (execute_data=0x7ffff7fa7a28) at /tmp/pear/xhprof-0.9.4/extension/xhprof.c:1664
#10 0x000000000071dd8f in zend_do_fcall_common_helper_SPEC (execute_data=<value optimized out>) at build/src/external/php-5.6.0/Zend/zend_vm_execute.h:592
#11 0x000000000070ce50 in execute_ex (execute_data=0x7ffff7fa6e08) at build/src/external/php-5.6.0/Zend/zend_vm_execute.h:363
#12 0x000000000069c20b in zend_execute_scripts (type=8, retval=0x0, file_count=3) at build/src/external/php-5.6.0/Zend/zend.c:1330
#13 0x0000000000634039 in php_execute_script (primary_file=0x7fffffffde10) at build/src/external/php-5.6.0/main/main.c:2607
#14 0x0000000000743a9d in do_cli (argc=5, argv=0xc21fa0) at build/src/external/php-5.6.0/sapi/cli/php_cli.c:994
#15 0x000000000074423f in main (argc=5, argv=0xc21fa0) at build/src/external/php-5.6.0/sapi/cli/php_cli.c:1378
(gdb) print opline
$1 = (zend_op *) 0x0
 [2015-04-28 11:00 UTC] 380659419 at qq dot com
<?php
error_reporting(E_ALL);

echo PHP_VERSION, PHP_EOL;

xhprof_enable();
    
try{

    class AA{
        public static function test(){}
    }
    //require  './Vendor/autoload.php';

    spl_autoload_register(array('AA', 'test'), true, true);


    echo class_exists('A2') ? 1 : 21; 
}catch(Exception $e){
    echo 'exception:';
    die($e->getMessage());
}
echo 333;exit;
======================================
[root@abc cloud]#  php55 index.php 
5.5.22
Segmentation fault
=============================
xhprof version: 0.9.3 and 0.9.4
 [2017-10-24 08:26 UTC] kalle@php.net
-Status: Open +Status: Suspended
 [2017-10-24 08:26 UTC] kalle@php.net
This package has not had a release for over 4 years, and the last bit of git activity was over 2 years ago, so I think its safe to say this extension is no longer in active development. If development picks back up, then please re-open this report
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Jun 16 17:01:30 2019 UTC