From: t3 at rohms dot com
Operating system: FreeBSD 4.3
PHP version: 4.3.10
PHP Bug Type: Variables related
Bug description: Memory allocation bug introduced in 4.3.10 (possibly zend
problem)
Description:
------------
I have an application that up until 4.3.10, worked perfectly with no
modifications; upon installing 4.3.10, one part of the application no
longer functions properly. I have narrowed down the problem to an area
involving the use of the statement:
extract($GLOBALS,EXTR_REFS);
in association with running eval() on a code block. If the code within
that EVAL'd code block calls a subroutine, the passed parameter data is
horribly messed up -- some kind of stack issue.
I have verified this is a new anomoly that is the result of the latest
version upgrade. However, I believe this may be related to the zend
engine and not php. When my system broke, I reverted php back to 4.3.6
and it still wasn't fixed; only when I reverted back to 4.3.6 and removed
the references to the newest version of the zend did the problem
disappear.
Reproduce code:
---------------
I will be working on some sample code, but right now I've had to revert
php back to an earlier version to make about a half-dozen sites
functional.
The problem appears in some code I've written which involves storing
blocks of php code in MySQL and EVAL'ing them. I created a subroutine
that pulls a record from the database and EVAL's it. Because it's a
subroutine I use the extract($GLOBALS,EXTR_REFS); before I eval the code
so that the code has access to globals. Everything works fine UNTIL
something in that code calls a function... the data passed to the function
is completely screwed up. This only appears to happen in 4.3.10 with the
new version of zend.
--
Edit bug report at http://bugs.php.net/?id=31753&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31753&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=31753&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=31753&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=31753&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=31753&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=31753&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=31753&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=31753&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=31753&r=support
Expected behavior: http://bugs.php.net/fix.php?id=31753&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=31753&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=31753&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=31753&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31753&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=31753&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=31753&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=31753&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=31753&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=31753&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=31753&r=mysqlcfg