php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31753 Memory allocation bug introduced in 4.3.10 (possibly zend problem)
Submitted: 2005-01-29 20:14 UTC Modified: 2005-01-29 21:09 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: t3 at rohms dot com Assigned:
Status: Not a bug Package: Variables related
PHP Version: 4.3.10 OS: FreeBSD 4.3
Private report: No CVE-ID: None
 [2005-01-29 20:14 UTC] t3 at rohms dot com
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.  


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-29 21:01 UTC] tony2001@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

See #30074, #31217.
 [2005-01-29 21:09 UTC] t3 at rohms dot com
Unlike the other bug reports, I'm not sure if this is related specifically to the extract command.  I am using a number of routines that use extract(xx,EXTR_REFS) and don't cause problems, but another set of routines, in which a subroutine EVALs code that calls another subroutine does have a specific problem.  I trace this to some sort of parameter passing problem inside nested functions/EVALs.  It is true that our problems could be related.  I believe this is related to zend more than PHP.  Anyway, sorry if this is redundant.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Sep 22 03:01:26 2019 UTC