php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59613 Enabling opcode caching causes fatal error Allowed memory size of...
Submitted: 2011-02-08 20:20 UTC Modified: 2013-10-03 12:11 UTC
From: vrocks at gmail dot com Assigned: mariuz (profile)
Status: Closed Package: APC (PECL)
PHP Version: 5.2.6 OS: Linux 2.6.32.25
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: vrocks at gmail dot com
New email:
PHP Version: OS:

 

 [2011-02-08 20:20 UTC] vrocks at gmail dot com
Description:
------------
Additional modules added to PHP:

/etc/php5/apache2/conf.d/apc.ini, 
/etc/php5/apache2/conf.d/curl.ini, 
/etc/php5/apache2/conf.d/cwioncube.ini, 
/etc/php5/apache2/conf.d/cwzend-optimizer.ini, 
/etc/php5/apache2/conf.d/gd.ini, 
/etc/php5/apache2/conf.d/gmp.ini, 
/etc/php5/apache2/conf.d/imap.ini, 
/etc/php5/apache2/conf.d/interbase.ini, 
/etc/php5/apache2/conf.d/ldap.ini, 
/etc/php5/apache2/conf.d/mapscript.ini, 
/etc/php5/apache2/conf.d/mcrypt.ini, 
/etc/php5/apache2/conf.d/memcache.ini, 
/etc/php5/apache2/conf.d/mhash.ini, 
/etc/php5/apache2/conf.d/mssql.ini, 
/etc/php5/apache2/conf.d/mysql.ini, 
/etc/php5/apache2/conf.d/mysqli.ini, 
/etc/php5/apache2/conf.d/odbc.ini, 
/etc/php5/apache2/conf.d/pdo.ini, 
/etc/php5/apache2/conf.d/pdo_dblib.ini, 
/etc/php5/apache2/conf.d/pdo_firebird.ini, 
/etc/php5/apache2/conf.d/pdo_mysql.ini, 
/etc/php5/apache2/conf.d/pdo_odbc.ini, 
/etc/php5/apache2/conf.d/pdo_pgsql.ini, 
/etc/php5/apache2/conf.d/pdo_sqlite.ini, 
/etc/php5/apache2/conf.d/pgsql.ini, 
/etc/php5/apache2/conf.d/php_exec.ini, 
/etc/php5/apache2/conf.d/pspell.ini, 
/etc/php5/apache2/conf.d/recode.ini, 
/etc/php5/apache2/conf.d/snmp.ini, 
/etc/php5/apache2/conf.d/sqlite.ini, 
/etc/php5/apache2/conf.d/tidy.ini, 
/etc/php5/apache2/conf.d/xmlrpc.ini, 
/etc/php5/apache2/conf.d/xsl.ini


When setting apc.cache_by_default to On I get 500 errors and 
after trying to reload the page over and over again I get:

Fatal error: Allowed memory size of 1073741824 bytes 
exhausted (tried to allocate 3266497821 bytes) in Unknown on 
line 0

Notice that during my debugging of this behavior I set the 
memory_limit of PHP to 1024M. A number no script should hit.

As a test I put the code: echo "something"; into a PHP file 
and tried to load it. Out of 30 tries 23 were WSOD, 4 gave 
me a line similar to ((Fatal error: Allowed memory size of 
1073741824 bytes exhausted (tried to allocate 2039749994 
bytes) in Unknown on line 0)) and 3 times the file loaded 
and printing, "something" as output.

A file that is simply echoing a string should not require a 
gig of memory!

Also note: If I turn off opcode caching via:
apc.cache_by_default=Off

I can then use the APC cache to put and get information. So 
this only seems to effect the system cache entries. User 
cache entries work just fine.

Reproduce code:
---------------
Any PHP coding will trigger the problem. However, simply putting <? ?> with nothing to parse will not.

Expected result:
----------------
something

Actual result:
--------------
Fatal error: Allowed memory size of 1073741824 bytes exhausted 
(tried to allocate 2039749994 bytes) in Unknown on line 0

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-12-11 19:08 UTC] mariuz@php.net
I see that you have both ioncube and zend optimizer 
please disable them and try again
 [2011-12-11 19:14 UTC] mariuz@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: mariuz
 [2011-12-11 19:14 UTC] mariuz@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.

See the related bug APC runs fine until you install Zend Optimizer at which point 
PHP totally breaks.

and the comment
https://bugs.php.net/bug.php?id=58080
 [2013-10-03 11:30 UTC] mike@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=fc3f8a8f54d8b3c864125bf32028d4550882839c
Log: fix bug #59613 (Crash with clone XMLReader)
 [2013-10-03 11:32 UTC] mike@php.net
-Status: Closed +Status: Feedback
 [2013-10-03 11:32 UTC] mike@php.net
Sorry, typo
 [2013-10-03 12:11 UTC] mike@php.net
-Status: Feedback +Status: Not a bug
 [2013-10-03 12:11 UTC] mike@php.net
.
 [2014-10-07 23:17 UTC] stas@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=fc3f8a8f54d8b3c864125bf32028d4550882839c
Log: fix bug #59613 (Crash with clone XMLReader)
 [2014-10-07 23:17 UTC] stas@php.net
-Status: Not a bug +Status: Closed
 [2014-10-07 23:28 UTC] stas@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=fc3f8a8f54d8b3c864125bf32028d4550882839c
Log: fix bug #59613 (Crash with clone XMLReader)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 05:01:30 2024 UTC