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: 2021-02-03 12:37 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: cmb (profile)
Status: Wont fix 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.
 [2021-02-03 12:37 UTC] cmb@php.net
-Status: Open +Status: Wont fix -Assigned To: +Assigned To: cmb
 [2021-02-03 12:37 UTC] cmb@php.net
The maintainer of PECL/pthreads has ceased its developement for
good reasons[1].  Consider to use PECL/parallel[2] instead.

[1] <https://github.com/krakjoe/pthreads/issues/929>
[2] <https://pecl.php.net/package/parallel>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 05:01:29 2024 UTC