ID: 26765
Updated by: [EMAIL PROTECTED]
Reported By: alex_mailbox53 at yahoo dot com
-Status: Assigned
+Status: Closed
Bug Type: Zend Engine 2 problem
Operating System: *
PHP Version: 5CVS-2004-03-15
Assigned To: andi
New Comment:
Let's close it then.
Previous Comments:
------------------------------------------------------------------------
[2004-05-26 17:03:47] alex_mailbox53 at yahoo dot com
Sorry, I did download the CVS version yet. I tested the issue with PHP5
RC2 and it works Ok - bug is fixed.
Thank you!
Alexander
------------------------------------------------------------------------
[2004-05-23 22:38:07] [EMAIL PROTECTED]
Can you please try the latest CVS and see if the crashes persist?
Thanks.
Andi
------------------------------------------------------------------------
[2004-04-09 11:06:00] [EMAIL PROTECTED]
Andi, is this a bug or not?
------------------------------------------------------------------------
[2004-03-10 11:37:20] jaanus at heeringson dot com
Ok, I have found out why the above example occaisionally worked. It
seems the order in which properties are declared play a ignificant
role. I guess the "destruction" propagates along in the order of
declarations. You can try it yourself by swaping two lines in the code
below (the lines are commented).
<pre>
<?php
class factory {
public $child;
public function make($class,$parent=null) {
$_temp=new $class($this);
$this->child[$class][]=$_temp;
if(is_object($parent)) {
$parent->mount($_temp);
}
Return $_temp;
}
}
class root {
public $child; //If the order of these two lines
public $ref; //is changed, you get a segfault
public $parent;
public function __construct($factory){
$this->ref['factory']=$factory;
}
public function mount($obj){
$this->child[]=$obj;
$obj->setParent($this);
$obj->setRef($this->ref+array('root'=>$this));
}
public function setRef($pref) {
$this->ref=array_merge($pref,$this->ref);
}
public function setParent($parent){
$this->parent=$parent;
}
}
class child extends root{
public function mount($obj){
$this->child[]=$obj;
$obj->setParent($this);
$obj->setRef($this->ref+array('child'=>$this));
}
}
$factory=new factory();
$a=$factory->make('root');
$b=$factory->make('child',$a);
$c=$factory->make('child',$a);
print_r($a);
?>
</pre>
------------------------------------------------------------------------
[2004-03-07 17:46:52] jaanus at heeringson dot com
Actually, you only create 2 objects in the example above, the initial
foo and the bar from foo's constructor. The rest are only references.
I still get the "Segmentation fault (11)", and by debugging my own apps
i can only concurr that this is not solved. I also sometimes get some
kind of race-condition where the apache process heads up to 99.6%, but
this occurs rarely.
How come the "var_dump() to print_r()" matters? I get segfaults without
either (on the sample code). The segfaults only occur the second time
the code is run on the same process, not when initially loading the
page.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/26765
--
Edit this bug report at http://bugs.php.net/?id=26765&edit=1