From: davojan at mail dot ru Operating system: FreeBSD 4.7-RELEASE PHP version: 5.0.0b4 (beta4) PHP Bug Type: Session related Bug description: Unserialize crashes on multiple objects, stored in session explicitly
Description: ------------ PHP crashes on session_start() if object "foo" references to object "bar" and both "foo" and "bar" are put into session explicitly each into it's element. The example below will work if we comment line: $_SESSION['bar'] = $bar; the only one "foo" is put to session explicitly and "bar" is also put, but as a member of "foo". Reproduce code: --------------- <? class foo { public $bar = NULL; } class bar {} //=============================[] $foo = new foo(); $bar = new bar(); $foo->bar = $bar; session_start(); $_SESSION['foo'] = $foo; $_SESSION['bar'] = $bar; // it will be all right, if we comment this session_write_close(); session_start(); // crashing here echo "OK"; ?> Expected result: ---------------- OK Actual result: -------------- In browser: "The page cannot be displayed" In /var/log/httpd-error.log: [Sun Feb 15 21:21:22 2004] [notice] child pid 230 exit signal Segmentation fault (11) -- Edit bug report at http://bugs.php.net/?id=27263&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27263&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27263&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=27263&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=27263&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=27263&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=27263&r=needscript Try newer version: http://bugs.php.net/fix.php?id=27263&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=27263&r=support Expected behavior: http://bugs.php.net/fix.php?id=27263&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=27263&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=27263&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=27263&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27263&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=27263&r=dst IIS Stability: http://bugs.php.net/fix.php?id=27263&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=27263&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=27263&r=float