php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40381 Segfault when function is called recursively
Submitted: 2007-02-07 08:12 UTC Modified: 2007-02-07 08:28 UTC
From: guus dot leeuw at guusleeuwit dot com Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 5.2.0 OS: RedHat FC6 x64
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: guus dot leeuw at guusleeuwit dot com
New email:
PHP Version: OS:

 

 [2007-02-07 08:12 UTC] guus dot leeuw at guusleeuwit dot com
Description:
------------
Using the script below causes PHP to crash with a segfault. I would expect PHP to catch a recursion like this and report an error through php_error or some such.

Reproduce code:
---------------
<?php

class A {
        function last_error()
        {
                return $this->last_error();
        }
}

$a = new A();
echo $a->last_error();
exit(0);
?>


Expected result:
----------------
I expect an error along the lines of:
brk() problem when calling function last_error(). Cannot increase stack space.

Actual result:
--------------
Segmentation fault

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-07 08:28 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 10:01:38 2025 UTC