php / php-src

The PHP Interpreter
https://www.php.net
Other
38.23k stars 7.75k forks source link

Segmentation fault (stack overflow) in AppendIterator #15911

Open YuanchengJiang opened 2 months ago

YuanchengJiang commented 2 months ago

Description

The following code:

<?php
$iterator = new \AppendIterator();
$iterator->append($iterator);

PHP Version

PHP 8.4.0-dev

Operating System

ubuntu 22.04

devnexen commented 2 months ago

seems spl issue, might be wrong.

cmb69 commented 2 months ago

Well, that's infinite recursion. See #9104.

nielsdos commented 2 months ago

Related to https://github.com/php/php-src/issues/15672

DanielEScherzer commented 1 month ago

Per https://3v4l.org/Dvcb0 this has been around 8.1 (or earlier), patch targeting 8.2 sent at #16492

Girgias commented 3 weeks ago

I don't think there is anything meaningful that can be done here. Infinite recursion is a programming error.