From:
Operating system: Vista, Linux
PHP version: 5.3.3
Package: SPL related
Bug Type: Bug
Bug description:LinkedList max nodes Segmentation fault
Description:
------------
I test linkedList performance and memory usage on Windows Vista Premium
with PHP 5.3.3. When list length > 34860 I have server fatal Error (
Segmentation fault) and my fast-cgi script closed. I try test on Linux (PHP
5.2.6) but have some error if length ~ 32735. This error is not related
with memory limit.
Test script:
---------------
class LinkedList {
private $_length = 0;
private $_head;
private $_tail;
public function add($data) {
$node = (object) array('data' => $data, 'next' => null);
if ($this->_length == 0) {
$this->_head = $node;
$this->_tail = $node;
} else {
$this->_tail->next = $node;
$this->_tail = $node;
}
$this->_length++;
}
}
$a = new LinkedList();
$startMemory = memory_get_usage();
$start = microtime(true);
for ($i = 1; $i <= 34860; $i++) {
$a->add($i);
}
$endMemory = memory_get_usage();
$end = microtime(true);
print(($end - $start) . '<br />');
print((int) (($endMemory - $startMemory) / 1024) . '<br />');
Expected result:
----------------
If length = 34860 I got
0.12323784828186
11276
--
Edit bug report at http://bugs.php.net/bug.php?id=53237&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=53237&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=53237&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=53237&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=53237&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=53237&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=53237&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=53237&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=53237&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=53237&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=53237&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=53237&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=53237&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=53237&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=53237&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53237&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=53237&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=53237&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=53237&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=53237&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=53237&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=53237&r=mysqlcfg