Edit report at https://bugs.php.net/bug.php?id=52144&edit=1
ID: 52144
Comment by: peters at yandex dot ru
Reported by: taco at procurios dot nl
Summary: Error: Base lambda function for closure not found
Status: Open
Type: Bug
Package: Scripting Engine problem
Operating System: linux
PHP Version: 5.3.2
Block user comment: N
Private report: N
New Comment:
We have spend many hours trying to reproduce this bug in our production
environment and analyzing apc source code. There is more then one way to get
this error in production, but in many cases you need to use load testing
software or something to reproduce the bug.
Here is the simple example that reproduces this bug. It is not the case in
production systems but it is easy to reproduce and adresses absolutely the same
problem. The root of the problem was explained here by s dot chernomorets at
gmail dot com.
You should create 3 scripts and put them in a directory under document root.
Then make request to script1.php and click the link (or make request to
script2.php)
======filename:lambda_function.php
<?
function() {}
?>
======filename:script1.php
<?php
apc_clear_cache();
ini_set('apc.cache_by_default', 0);
include('lambda_function.php');
ini_set('apc.cache_by_default', 1);
include('lambda_function.php');
?>
<a href="script2.php">CLICK TO REPRODUCE ERROR</a>
======filename:script2.php
<?php
include 'lambda_function.php';
Previous Comments:
------------------------------------------------------------------------
[2011-10-20 14:05:02] s dot chernomorets at gmail dot com
It seems option apc.write_lock=Off solves this problem partially.
We have config with closure in style "<?php return array( ...., function()
{...}, ... );
?>"
and include (not include_once) it seceral time per request.
1. If apc_cache_write_lock(apc_cache TSRMLS_CC) (apc_main.c:602) was
unsuccessful at first include() then APC return old_compile_file. Function
old_compile_file store compiled closures into internal zend hash function_table
but
not to cache.
2. If apc_cache_write_lock(apc_cache TSRMLS_CC) was successful at second
include() then APC try to store opcode (apc_main.c:610-617), but function
apc_copy_new_functions(apc_compile.c:1333,1340-1343) not found new functions
(our closures) because zend hash function_table contains this closures already
(closures were compiled at first include()). So APC copy compiled array from
included
file to cache without closures.
3. php-code try to call closure -> "Base lambda function for closure not found"
------------------------------------------------------------------------
[2011-08-12 06:32:46] hchinchilla at habitissimo dot com
We are having the same problem here at Habitissimo. using debian with PHP 5.3.6
and APC 3.1.9. We had to replace APC with xcache to avoid this problem.
------------------------------------------------------------------------
[2011-07-21 17:07:42] aequasi at gmail dot com
Has this problem been resolved yet? having the same issues when i implement APC
with symfony2
------------------------------------------------------------------------
[2011-06-06 20:04:24] nicolas at netlog dot com
Hi there,
We're experiencing the same problem here at Netlog. Also on production servers
when we have some load. Unable to isolate this issue yet. We're running php
5.3.5
and apc 3.1.9. If we disable APC the problem goes away.
Any clues here?
------------------------------------------------------------------------
[2010-11-05 08:27:47] janne dot hietamaki at gmail dot com
Updated to APC 3.1.5 and the problem still persists.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=52144
--
Edit this bug report at https://bugs.php.net/bug.php?id=52144&edit=1