PHP 4.0 Bug #3361: Crash + variables work incorrectly + alloc message
| From: | stas at zend dot com | Date: | Mon, 31 Jan 2000 15:15:06 +0000 |
| Subject: | PHP 4.0 Bug #3361: Crash + variables work incorrectly + alloc message | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-15077@lists.php.net to get a copy of this message | ||
From: stas@zend.com
Operating system: Linux
PHP version: 4.0 Latest CVS (31/01/2000)
PHP Bug Type: Reproduceable crash
Bug description: Crash + variables work incorrectly + alloc message
Script:
<?
class x {
var $foo = "";
var $bar = "";
function set($x) {
foreach($x as $k => $v) {
$this->$k = $v;
}
}
}
$xx = new x();
$xx->set(array("foo" => "1","bar" => 2));
var_dump($xx);
?>
gives 3 strange results:
1. Crash:
Program received signal SIGSEGV, Segmentation fault.
shutdown_memory_manager (silent=0, clean_cache=0) at zend_alloc.c:354
354 next_fast_cache_list_entry = fast_cache_list_entry->next;
#0 shutdown_memory_manager (silent=0, clean_cache=0) at zend_alloc.c:354
#1 0x8075b33 in php_request_shutdown (dummy=0x0) at main.c:737
#2 0x805a0d2 in main (argc=2, argv=0xbffff894) at cgi_main.c:542
2. Dump is:
object of x (2) {
string(3) "foo"
string(0) ""
string(3) "bar"
string(0) ""
}
which is wrong - variables aren't set
3. Message from zend_alloc
---------------------------------------
zend_alloc.c(355) : Block 0x0812E100 status:
Beginning: Cached (allocated on ./zend_execute.c:2152, 12 bytes)
End: OK
---------------------------------------