Bug #75636 [NEW]: php crashes with too many objects
| From: | benoit dot david at free dot fr | Date: | Wed, 06 Dec 2017 05:49:05 +0000 |
| Subject: | Bug #75636 [NEW]: php crashes with too many objects | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-212956@lists.php.net to get a copy of this message | ||
From: benoit dot david at free dot fr
Operating system: Docker Version 17.09.0
PHP version: 7.2.0
Package: Reproducible crash
Bug Type: Bug
Bug description:php crashes with too many objects
Description:
------------
The test script below works fine for 10 iterations but crashes
(Segmentation fault) for 400000 iterations while it shouldn't crash.
Uses Php 7.2 on docker (Version 17.09.0-ce-mac35 (19611))
with no extension.
Test script:
---------------
<?php
class Lim {
public $id;
public $inv;
public $fi;
function __construct($id) { $this->id = $id; $this->inv = new
Inv($this); }
};
class Inv {
public $inv;
public $fi;
function __construct($inv) { $this->inv = $inv; }
}
$max = 400000;
//$max = 10;
$lim0 = new Lim(0);
$limp = $lim0;
for ($i=1; $i<$max; $i++) {
$lim = new Lim($i);
$lim->fi = $limp->inv;
$limp->inv->fi = $lim;
$limp = $lim;
}
Expected result:
----------------
The above script should not crash for 400000 iterations.
Actual result:
--------------
The above script crashes for 400000 iterations.
--
Edit bug report at https://bugs.php.net/bug.php?id=75636&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75636&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75636&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75636&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=75636&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=75636&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=75636&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=75636&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=75636&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=75636&r=support
Expected behavior: https://bugs.php.net/fix.php?id=75636&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=75636&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=75636&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=75636&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75636&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=75636&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=75636&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=75636&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75636&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=75636&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=75636&r=mysqlcfg