php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56193 incorrect warning about insufficient memory
Submitted: 2004-09-16 04:39 UTC Modified: 2004-09-16 12:49 UTC
From: swen dot thuemmler at telefonica dot de Assigned: rasmus (profile)
Status: Closed Package: APC (PECL)
PHP Version: Irrelevant OS: solaris 2.8
Private report: No CVE-ID: None
 [2004-09-16 04: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




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-16 04:51 UTC] swen dot thuemmler at telefonica dot de
Nope, bug #1583 is unaffected, I'll add my comments there.

--Swen
 [2004-09-16 12:49 UTC] rasmus@php.net
Fixed in CVS
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 27 23:01:30 2024 UTC