#2348 incorrect warning about insufficient memory
Submitted: 2004-09-16 08:39 UTC
From: swen dot thuemmler at telefonica dot de Assigned: rasmus
Status: Closed Package:
PHP Version: Irrelevant OS: solaris 2.8
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 33 + 11 = ?

 
 [2004-09-16 08:39 UTC] swen dot thuemmler at telefonica dot de
Description: ------------ I think there is an incorrect warning given when apc_cache_insert() fails, because another process already cached a file. In apc_main.c we have: if (!apc_cache_insert(APCG(cache), key, cache_entry, t)) { apc_cache_free_entry(cache_entry); apc_cache_expunge(APCG(cache),t); /* apc_log(APC_WARNING, "(apc_cache_insert) unable to cache '%s': insufficient " "shared memory available", h->opened_path); */ } and in apc_cache.c, there is: if (key_equals((*slot)->key.data.file, key.data.file)) { /* If existing slot for the same device+inode is older, remove it and insert the new version */ if ((*slot)->key.mtime < key.mtime) { remove_slot(cache, slot); break; } UNLOCK(cache); return 0; } So it returns 0, when the same file is already cached by another process and should not be cached again. Question is, should the function return 1 in this case, or should the warning be moved into the function, given only when there is really no memory left? I'll have to check, whether this accounts for my comment on bug #1583 - the message might have been a red herring. Greetings, Swen

Comments

 [2004-09-16 08:51 UTC] swen dot thuemmler at telefonica dot de
Nope, bug #1583 is unaffected, I'll add my comments there. --Swen
 [2004-09-16 16:49 UTC] rasmus
Fixed in CVS