ZE2 race condition

From: Date: Tue, 25 Mar 2003 14:13:07 +0000
Subject: ZE2 race condition
Groups: php.internals 
Request: Send a blank email to internals+get-269@lists.php.net to get a copy of this message
Running the following code: class Foo { var $bar_ref; } class Bar { var $foo_ref; } $foo = new Foo(); $bar = new Bar(); $foo->bar_ref = $bar; $bar->foo_ref = $foo; var_dump($foo); var_dump($bar); $s = serialize($foo); var_dump($s); $s = serialize($bar); var_dump($s); in PHP_4_3 results to: object(foo)(1) { ["bar_ref"]=> object(bar)(1) { ["foo_ref"]=> NULL } } object(bar)(1) { ["foo_ref"]=> object(foo)(1) { ["bar_ref"]=> object(bar)(1) { ["foo_ref"]=> NULL } } } string(58) "O:3:"foo":1:{s:7:"bar_ref";O:3:"bar":1:{s:7:"foo_ref";N;}}" string(86) "O:3:"bar":1:{s:7:"foo_ref";O:3:"foo":1:{s:7:"bar_ref";O:3:"bar":1:{s:7:"foo_ref";N;}}}" in HEAD: object(foo)#1 (1) { ["bar_ref"]=> object(bar)#2 (1) { ["foo_ref"]=> object(foo)#1 (1) { ["bar_ref"]=> object(bar)#2 (1) { ["foo_ref"]=> *RECURSION* } } } } object(bar)#2 (1) { ["foo_ref"]=> object(foo)#1 (1) { ["bar_ref"]=> object(bar)#2 (1) { ["foo_ref"]=> object(foo)#1 (1) { ["bar_ref"]=> *RECURSION* } } } } and a segfault (apache 1 sapi) or a runaway process (cli sapi). Jan. -- http://www.horde.org - The Horde Project http://www.ammma.de - discover your knowledge http://www.tip4all.de - Deine private Tippgemeinschaft

« previous php.internals (#269) next »