php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70653 Segfault on MultipleIterator
Submitted: 2015-10-06 18:50 UTC Modified: 2015-10-06 20:09 UTC
From: admin at shuguenot dot fr Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.6.14 OS: Ubuntu 14
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: admin at shuguenot dot fr
New email:
PHP Version: OS:

 

 [2015-10-06 18:50 UTC] admin at shuguenot dot fr
Description:
------------
If I make a MultipleIterator and override the current function with that : 

    public function current()
    {
        $this->current();
    }

I know that it's not a well code and this doesn't work and hasn't to be done but maybe it could have something else than a Segfault.

Test script:
---------------
class QuestionsIterator extends \MultipleIterator implements \Iterator {

    public function current()
    {
        $this->current();
    }
}

Expected result:
----------------
An error or an exception maybe

Actual result:
--------------
Segmentation Fault

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-10-06 20:06 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2015-10-06 20:06 UTC] requinix@php.net
It's not possible for PHP to analyze code and tell when the code has created infinite recursion, which is the situation here. It will diligently execute exactly what it is told to and will only quit when it runs out of stack space (or memory or some other resource) and is forced to terminate.

If you need something to alert you to possible infinite recursion during development then try the Xdebug extension and its max_nesting_level setting.
 [2015-10-06 20:09 UTC] admin at shuguenot dot fr
Ok and many thanks.
I think this task can be closed..
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 14:00:01 2026 UTC