#31217 [NEW]: extract($GLOBALS, EXTR_REFS) corrupts memory

From: Date: Tue, 21 Dec 2004 03:26:04 +0000
Subject: #31217 [NEW]: extract($GLOBALS, EXTR_REFS) corrupts memory
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-70761@lists.php.net to get a copy of this message
From: cdragon at draconic dot com Operating system: win2k PHP version: 5CVS-2004-12-18 (dev) PHP Bug Type: Reproducible crash Bug description: extract($GLOBALS, EXTR_REFS) corrupts memory Description: ------------ Since php 5.0.1, extract($GLOBALS, EXTR_REFS) seems to corrupt code memory and cause various random problems. In my test case, it caused COM("someobject") to always return null, and in another case it just caused some strange output of a "1" instead of the expected strings. I never had a problem in php 5.0.0 up to CVS snapshot php5.0-win32-200407301630. Commenting out extract($GLOBALS, EXTR_REFS) fixes all strange behavior. I had a similar problem in php 4 which I reported as bug id 25708. That bug was fixed and I never had a problem again until 5.0.1. Reproduce code: --------------- extract($GLOBALS, EXTR_REFS); $query = new COM("IXSSO.Query"); if(is_object($query) == false) { var_dump($query); print "Can't create IXSSO Query object."; exit(); } Expected result: ---------------- Nothing Actual result: -------------- PHP has encountered an Access Violation at 01D5F185 -- Edit bug report at http://bugs.php.net/?id=31217&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31217&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=31217&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=31217&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=31217&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=31217&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=31217&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=31217&r=needscript Try newer version: http://bugs.php.net/fix.php?id=31217&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=31217&r=support Expected behavior: http://bugs.php.net/fix.php?id=31217&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=31217&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=31217&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=31217&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31217&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=31217&r=dst IIS Stability: http://bugs.php.net/fix.php?id=31217&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=31217&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=31217&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=31217&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=31217&r=mysqlcfg

« previous php.bugs (#70761) next »