Re: segfault after an "invalid read of size 8"

From: Date: Wed, 15 Oct 2008 18:39:56 +0000
Subject: Re: segfault after an "invalid read of size 8"
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-41084@lists.php.net to get a copy of this message
Hi Olivier, Em Qua, 2008-10-15 às 15:44 +0200, Olivier Bonvalet escreveu: > So, I reduce the script which throw the segmentation fault. > > My environment : > Debian Lenny, 64bits > Latest PHP 5.2 from CVS (php5.2-200810151030) compiled with : > ./configure --prefix=/home/dev-olivier/usr/ --disable-all > --enable-debug > > > In "first.php" I have this code : > ============================================================ > <?php > class main > { > public static $dummy = NULL ; > public static $dataAccessor = NULL ; > } > > class dataAccessor > { > } > > class relay > { > public function __get( $name ) > { > main::$dataAccessor = new dataAccessor; > } > } > > class dummy > { > } > > main::$dummy = new dummy(); > main::$dataAccessor = new relay(); > ?> > ============================================================ > > And in "second.php" I have this : > (if I regroup all code in one file, there is no segfault) That is weird, cannot you reproduce it using the code below? <?php class main { public static $dataAccessor; } class relay { public function __get($name) { main::$dataAccessor = 1; } } main::$dataAccessor = new relay(); var_dump(main::$dataAccessor->bar); ?> Anyway, please file a bug report: http://bugs.php.net/report.php Thanks. -- Regards, Felipe Pena

« previous php.internals (#41084) next »