j***@php.net
2010-02-24 09:27:57 UTC
ID: 51132
Updated by: ***@php.net
Reported By: miha dot space at gmail dot com
-Status: Open
+Status: Assigned
Bug Type: *Programming Data Structures
Operating System: Windows 7, Linux openSuse 11.2
PHP Version: 5.3.1
-Assigned To:
+Assigned To: colder
New Comment:
Etienne, please look into it. Thanks.
Previous Comments:
------------------------------------------------------------------------
[2010-02-24 09:16:21] miha dot space at gmail dot com
Description:
------------
Is there any limit i also tried with memory_get_usage and with 29000
linkedlistnodes it uses about 9.25MB. In php.ini i have max 128MB, so
this can't be the problem.
Reproduce code:
---------------
<?php
class LinkedListNode {
public $data;
public $next;
public function __construct($data) {
$this->data = $data;
$this->next = NULL;
}
}
class LinkedList {
private $first;
private $last;
public function __construct() {
$this->first = NULL;
$this->last = NULL;
}
public function insertLast($data) {
$node = new LinkedListNode($data);
if( $this->first != NULL ) {
$this->last->next = &$node;
$this->last = &$node;
}
else {
$this->first = &$node;
$this->last = &$node;
}
}
}
$list = new LinkedList();
/* it works
for($i = 0; $i < 29488; $i++) {
$list->insertLast(1);
}*/
// Segmentation fault
for($i = 0; $i < 29489; $i++) {
$list->insertLast(1);
}
?>
Expected result:
----------------
Nothin, it should exit normally, not segfault.
Actual result:
--------------
php test2.php
Segmentation fault
------------------------------------------------------------------------
Updated by: ***@php.net
Reported By: miha dot space at gmail dot com
-Status: Open
+Status: Assigned
Bug Type: *Programming Data Structures
Operating System: Windows 7, Linux openSuse 11.2
PHP Version: 5.3.1
-Assigned To:
+Assigned To: colder
New Comment:
Etienne, please look into it. Thanks.
Previous Comments:
------------------------------------------------------------------------
[2010-02-24 09:16:21] miha dot space at gmail dot com
Description:
------------
Is there any limit i also tried with memory_get_usage and with 29000
linkedlistnodes it uses about 9.25MB. In php.ini i have max 128MB, so
this can't be the problem.
Reproduce code:
---------------
<?php
class LinkedListNode {
public $data;
public $next;
public function __construct($data) {
$this->data = $data;
$this->next = NULL;
}
}
class LinkedList {
private $first;
private $last;
public function __construct() {
$this->first = NULL;
$this->last = NULL;
}
public function insertLast($data) {
$node = new LinkedListNode($data);
if( $this->first != NULL ) {
$this->last->next = &$node;
$this->last = &$node;
}
else {
$this->first = &$node;
$this->last = &$node;
}
}
}
$list = new LinkedList();
/* it works
for($i = 0; $i < 29488; $i++) {
$list->insertLast(1);
}*/
// Segmentation fault
for($i = 0; $i < 29489; $i++) {
$list->insertLast(1);
}
?>
Expected result:
----------------
Nothin, it should exit normally, not segfault.
Actual result:
--------------
php test2.php
Segmentation fault
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=51132&edit=1
Edit this bug report at http://bugs.php.net/?id=51132&edit=1