Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > 16-bit reference count in PHP 4's zval
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 11th July 06:53
t.starling@physics.unimelb.edu.au (tim
External User
 
Posts: 1
Default 16-bit reference count in PHP 4's zval



Well yes, I was just stirring. It's more common than you might think though.
My own case was somewhat similar to this:

<?
class CacheEntry {
var $name;
var $stuff = array();

function CacheEntry( $name ) {
$this->name = $name;
}
}

$cache = array();
for ( $i=0; $i<100000; $i++) {
$cache[] = new CacheEntry( "Cache entry $i" ); }
?>

....which will segfault on exit due to the excess references to the empty
array object created for the initialisation of the unused member variable
$stuff. Generally speaking, arrays of objects with initialised but unused
member variables will cause problems. Our code (MediaWiki) has plenty of
such arrays, the reason we don't see this more often is because the arrays
usually contain less than 64K entries. The size of the arrays depend on user
input.

-- Tim Starling

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666