ID: 31106
User updated by: alan at akbkhome dot com
Reported By: alan at akbkhome dot com
-Status: Feedback
+Status: Open
Bug Type: Reproducible crash
Operating System: linux
PHP Version: 4.3.10
Assigned To: stas
New Comment:
nice simple test case .. - causes segfault
<?php
class DBO {
function factory() {
$x = new DBO;
return $x;
}
var $x;
function w($s) {
$this->x = $s;
}
function __call($a,$b,&$c) {
echo "$a";
return FALSE;
}
}
overload('DBO');
$a = DBO::factory();
$a->w('test');
$a->bbb = 0;
Previous Comments:
------------------------------------------------------------------------
[2004-12-17 13:00:49] [EMAIL PROTECTED]
I'll try and get a test case done over the weekend..
should be quite simple - create a overloaded object (with __call) - and
assign some vars's then set it so something else.. (based on a rough
guess)..
The real code is a bit to complex for a simple test case - but it broke
both my devel servers. ;)
------------------------------------------------------------------------
[2004-12-17 11:23:05] [EMAIL PROTECTED]
Can you provide some example of the code that crashes? Of course I'd
prefer the code that I could run, so that I can check what's the
problem.
Removing unlock won't do good - it would just cause a memory leak.
------------------------------------------------------------------------
[2004-12-16 09:57:55] [EMAIL PROTECTED]
Actually both changes in this commit cause big problems with overloaded
objects
http://cvs.php.net/diff.php/Zend/Attic/zend_execute.c?sa=1&r1=1.316.2.41&r2=1.316.2.42&ty=u
removing 1st fixes crashes
removing 2nd fixes object properties getting destroyed/lost? when
calling methods of overloaded objects.
------------------------------------------------------------------------
[2004-12-16 08:12:44] [EMAIL PROTECTED]
change title to be more precise..
------------------------------------------------------------------------
[2004-12-16 08:04:45] alan at akbkhome dot com
This fixes it.
--- zend_execute.c 2004-12-16 15:18:16.000000000 +0800
+++ zend_execute.c.fixed 2004-12-16 15:18:28.000000000 +0800
@@ -996,7 +996,6 @@
}
zend_llist_destroy(T->EA.data.overloaded_element.elements_list);
efree(T->EA.data.overloaded_element.elements_list);
- PZVAL_UNLOCK(T->EA.data.overloaded_element.object);
}
------------------------------------------------------------------------
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/31106
--
Edit this bug report at http://bugs.php.net/?id=31106&edit=1