Bug #81587 [NEW]: MultipleIterator Segmentation fault w/ SimpleXMLElement attached
| From: | hanskrentel at yahoo dot de | Date: | Wed, 03 Nov 2021 14:01:23 +0000 |
| Subject: | Bug #81587 [NEW]: MultipleIterator Segmentation fault w/ SimpleXMLElement attached | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-237523@lists.php.net to get a copy of this message | ||
From: hanskrentel at yahoo dot de
Operating system: Linux
PHP version: 8.0.12
Package: SPL related
Bug Type: Bug
Bug description:MultipleIterator Segmentation fault w/ SimpleXMLElement attached
Description:
------------
Since PHP 8.0 SimpleXMLElement is an Iterator and it is
possibe to attach it to a MultipleIterator (TypeError earlier).
Attached to a MultipleIterator and iterating the MultipleIterator makes
PHP exit code 139 (interrupted by signal 11: SIGSEGV - Segmentation
fault)
Starting with PHP 8.1rc1 this is not an issue any longer.
Test script:
---------------
$mi = new MultipleIterator();
$mi->attachIterator(new SimpleXMLElement('<r/>'));
$mi->rewind();
Expected result:
----------------
Process exited with code 0
Actual result:
--------------
Output for 8.0.0 - 8.0.12: Process exited with code 139.
https://3v4l.org/DhLc0
A workaround is available: Wrapping the SimpleXMLElement inside an
IteratorIterator prevents the segmentation fault:
$mi = new MultipleIterator();
$mi->attachIterator(new IteratorIterator(new
SimpleXMLElement('<r/>')));
$mi->rewind();
https://3v4l.org/C962A
--
Edit bug report at https://bugs.php.net/bug.php?id=81587&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=81587&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=81587&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=81587&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=81587&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=81587&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=81587&r=support
Expected behavior: https://bugs.php.net/fix.php?id=81587&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=81587&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=81587&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=81587&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81587&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=81587&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=81587&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=81587&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=81587&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=81587&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=81587&r=mysqlcfg