|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41677 Cannot redeclare found after allowed memory exhausted
Submitted: 2007-06-13 10:34 UTC Modified: 2007-07-03 01:00 UTC
Avg. Score:5.0 ± 0.0
Reproduced:6 of 6 (100.0%)
Same Version:3 (50.0%)
Same OS:2 (33.3%)
From: bobson at rpg dot pl Assigned:
Status: No Feedback Package: Unknown/Other Function
PHP Version: 5.2.3 OS: Linux Gentoo
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-06-13 10:34 UTC] bobson at rpg dot pl
I provide this issue as php5.2.3 because it probaby can be noticed on this version too (dont found bugfix in changelog).

My configuration is lighttpd + php (on FastCGI).
PHP from getnoo emerge (PHP 5.2.2-pl1-gentoo).

First apears:
PHP Fatal error:  Allowed memory size of 18874368 bytes exhausted (tried to allocate 7881777 bytes) in /var/www/sites/partner/deny/lib/new/global_session_handing.php on line 171
(yes, there was bug)

After that php start to show such message:
PHP Fatal error:  Cannot redeclare clearme() in /var/www/sites/partner/index.php on line 6

clearme() is simple function with if's and unset() for unset some vars if exists.

So... I move function clearme() a several line (still first in file). PHP said:
PHP Fatal error:  Cannot redeclare clearme() (previously declared in /var/www/sites/partner/index.php:7) in /var/www/sites/partner/index.php on line 19
( line 19 is end "}" of clearme() )

Then I move other simple function to begin of file, PHP said:
PHP Fatal error:  Cannot redeclare translatebeforeregexping() (previously declared in /var/www/sites/partner/index.php:23) in /var/www/sites/partner/index.php on line 18

How "previously declared" line can be higher than declaration line? 

When I require_once() library used in problematic script to simple php file - PHP shows:
Cannot redeclare h2_ajaxvarencode() in /usr/local/share/php/wdgHarvest3_HA/harvest_addons.php on line 4
(this is first function in this lib)

Sorry for not attaching code of index.php - copyright issues :/

There is no self inclusions. Function is first declaration in file. After lighttpd restart problem disappear (is this pointing to some kind of  interpreter stack problem?). There is hard to makes case study code reproducing this problem.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-16 03:02 UTC] phpbugs at thequod dot de
Are you using an opcode cache like xcache, Zend Optimizer, 
eaccelerator, etc?
 [2007-06-18 10:06 UTC] bobson at rpg dot pl
No. There's no additional zend extensions, xcache or optymizers. Pure PHP5 from gentoo emerge.
 [2007-07-03 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2007-07-19 00:47 UTC] leo dot geoffrion at sgs dot com
I am encountering the same memory exceeded error message using a script that was known solid on V5.2.0.  The basic script runs an Oracle query, waits for the results and stores them into a mysql table.  

It initially died at the default 128M max_memory.  I edited php.ini to raise the max to 256M and same script died with same problem:

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 16 bytes) in ...

Environment is Apache2.2.4, Oracle client 10.2.1, mysql 5.0.45, php 5.2.3
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 16:01:36 2024 UTC