php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72568 segmentation fault of self-recursive call
Submitted: 2016-07-09 18:02 UTC Modified: 2016-07-10 02:46 UTC
Votes:3
Avg. Score:4.0 ± 0.8
Reproduced:1 of 2 (50.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: rana dot ram at gmail dot com Assigned:
Status: Open Package: pthreads (PECL)
PHP Version: 7.0.8 OS: CentOS 6.4
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2016-07-09 18:02 UTC] rana dot ram at gmail dot com
Description:
------------
Segmentation fault on self recursive call by a class instance method to itself.

Test script:
---------------
<?php

class ABC {
    public function self_recursive() {
        $this->self_recursive();
    }
}

$obj = new ABC();
$obj->self_recursive();



Expected result:
----------------
- Memory exhausted error
- or, Max execution limit reached
- or,  a infinite recursion exception

Actual result:
--------------
Starting program: /usr/local/bin/php test.php

Program received signal SIGSEGV, Segmentation fault.
0x00000000008d51b3 in ZEND_DO_FCALL_SPEC_HANDLER (execute_data=0x7fffe3c710d0) at /usr/local/src/php-7.0.8/Zend/zend_vm_execute.h:800
800                                     zend_execute_ex(call);


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-07-09 18:14 UTC] nikic@php.net
-Status: Open +Status: Feedback
 [2016-07-09 18:14 UTC] nikic@php.net
Please make sure that you're using no third-party extensions, in particular debuggers or profilers. This happens only if an extension overwrites zend_execute_ex.
 [2016-07-10 02:43 UTC] rana dot ram at gmail dot com
you are right!  one of the extension (pthreads) causing this.
Thanks!
 [2016-07-10 02:46 UTC] rana dot ram at gmail dot com
-Status: Feedback +Status: Open -Package: Reproducible crash +Package: pthreads
 [2016-07-10 02:46 UTC] rana dot ram at gmail dot com
updated "Package" to "pthreads"
 [2016-11-09 11:53 UTC] odigiman at gmail dot com
Reproduced on a range of Linux distributions. (PHP 7.0.12, pthreads 3.1.6)

On Windows, a crash is also observed, but with a php exit 127. This does not happen without pthreads.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Feb 24 12:01:25 2020 UTC