php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59341 after calling apc_delete(), first stored cache is empty
Submitted: 2010-08-06 15:07 UTC Modified: 2010-08-08 17:17 UTC
From: fruit dot dev at gmail dot com Assigned:
Status: Closed Package: APC (PECL)
PHP Version: 5.2.13 OS: Fedora 10
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: fruit dot dev at gmail dot com
New email:
PHP Version: OS:

 

 [2010-08-06 15:07 UTC] fruit dot dev at gmail dot com
Description:
------------
When I call apc_delete() to remove cache, next stored cache is always "false", but second, third etc. is OK

Reproduce code:
---------------
<?php

  apc_clear_cache('user');

  apc_store('lock_CCCC', 1, 2);

  apc_store('CCCC', 129021, 3001);

  apc_delete('lock_CCCC');

  apc_store('tag_A', '100', 86400);
  apc_store('tag_B', '200', 86400);

  var_dump(apc_fetch('tag_A')); // prints "boolean false"
  var_dump(apc_fetch('tag_B')); // prints "string '200' (length=3)"

?>

Expected result:
----------------
I expected to get in output 2 string:

First:  "string '100' (length=3)"
Second: "string '200' (length=3)"


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-08 07:17 UTC] paulgao at yeah dot net
in PHP 5.3.3 and APC 3.1.4, script run is same result.
 [2010-08-08 16:34 UTC] gopalv82 at yahoo dot com
Almighty $deity. This one is a nasty bug.

648         while (*slot) {
(gdb) p *slot
$2 = (slot_t *) 0xb44e925c
(gdb) p **slot
$3 = {key = {data = {file = {device = 24499884700, inode = 3067182425}, 
      user = {identifier = 0xb44e929c "tag_ACCCC", identifier_len = 5}, 
      fpfile = {fullpath = 0xb44e929c "tag_ACCCC", fullpath_len = 5}},

So basically, the tag_A is written, without the ending NUL.
 [2010-08-08 17:17 UTC] gopalv82 at yahoo dot com
http://news.php.net/php.pecl.cvs/14562

Should be fixed in svn now.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 15:01:34 2025 UTC