#30674 [NEW]: Unexpected results and crashes with recursive references serializing

From: Date: Wed, 03 Nov 2004 15:30:18 +0000
Subject: #30674 [NEW]: Unexpected results and crashes with recursive references serializing
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-68655@lists.php.net to get a copy of this message
From: fmmarzoa at gmx dot net Operating system: Linux (probably others) PHP version: 5.0.2 PHP Bug Type: Zend Engine 2 problem Bug description: Unexpected results and crashes with recursive references serializing Description: ------------ serialize function lost references to itself on an array and produces a segfault in some other circunstances. I send the code with which I've discovered the problem, but Andrey Hristov has also cooked some code based on this that crash the PHP engine. Complete quoted thread with more code samples can be found on the internals list archive: http://marc.theaimsgroup.com/?l=php-dev&m=109949534625983&w=2 Reproduce code: --------------- <pre> <?php $Arr = array(); $Arr['self'] = &$Arr; var_dump ( $Arr ); $serdata = serialize ($Arr); $Arr2 = unserialize ( $serdata ); echo "\n\n"; var_dump ( $Arr2 ); ?> </pre> Complete quoted thread with more code samples, including segfaults, can be found on the internals list archive: http://marc.theaimsgroup.com/?l=php-dev&m=109949534625983&w=2 Expected result: ---------------- array(1) { ["self"]=> array(1) { ["self"]=> *RECURSION* } } array(1) { ["self"]=> array(1) { ["self"]=> *RECURSION* } } Actual result: -------------- array(1) { ["self"]=> array(1) { ["self"]=> *RECURSION* } } array(1) { ["self"]=> array(1) { ["self"]=> NULL } } -- Edit bug report at http://bugs.php.net/?id=30674&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30674&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30674&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30674&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=30674&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=30674&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30674&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30674&r=needscript Try newer version: http://bugs.php.net/fix.php?id=30674&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30674&r=support Expected behavior: http://bugs.php.net/fix.php?id=30674&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30674&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30674&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=30674&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30674&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=30674&r=dst IIS Stability: http://bugs.php.net/fix.php?id=30674&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30674&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30674&r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30674&r=mysqlcfg

« previous php.bugs (#68655) next »