php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57398 cache hit mismatch
Submitted: 2006-11-27 17:57 UTC Modified: 2007-02-06 19:43 UTC
From: sukibabee at gmail dot com Assigned:
Status: Closed Package: APC (PECL)
PHP Version: 5.1.6 OS: Ubuntu 6.10
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: sukibabee at gmail dot com
New email:
PHP Version: OS:

 

 [2006-11-27 17:57 UTC] sukibabee at gmail dot com
Description:
------------
I have a recent installation of Ubuntu 6.10 + std ubuntu packages (like Apache2 + PHP5 (5.1.6)).

I installed APC 3.0.12p2 to this as per directions, and it seems to work.  But I frequently get HTTP requests 
being processed by the wrong script.  For instance, a request for "page_A.php" can return the results of "page_B.php".

In this case, APC (via apc_cache_info()) shows a cache hit on "page_B.php", when "page_A.php" should have been hit.  "page_B.php" traces the output of :

$_SERVER['REQUEST_URI']

and it shows "page_A.php".

It appears that I'm seeing the effects of mismatched fetches from the cache list.  The URI is correct, but the wrong script is invoked.

The problem occurs frequently (maybe 1 in 5 pages), but not consistently.  It seems to effect just one pair of pages (mixes just these two with each other).  The affected pair can change when I restart apache.  I cannot characterize it farther.  Of course, simply disabling APC avoids the problem.


System Setup:
=============

- ubuntu 6.10 installation
- std ubuntu install of Apache2 and PHP5 packages (i did not compile)
- APC 3.0.12p2 installed as per instructions


apache :
========


# apache2 -V
Server version: Apache/2.0.55
Server built:   Sep 27 2006 16:52:14
Server's Module Magic Number: 20020903:11
Architecture:   32-bit
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D HTTPD_ROOT=""
 -D SUEXEC_BIN="/usr/lib/apache2/suexec2"
 -D DEFAULT_PIDLOG="/var/run/apache2.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="/var/run/apache2/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="/etc/apache2/mime.types"
 -D SERVER_CONFIG_FILE="/etc/apache2/apache2.conf"



php.ini settings (that i changed) :
===================================

  track_errors = On
  display_errors = On
  magic_quotes_gpc = Off
  error_reporting  =  E_ALL
  always_populate_raw_post_data = On
  allow_call_time_pass_reference = On

  extension=mhash.so
  extension=mysql.so
  extension=mysqli.so
  extension=json.so
  extension=mcrypt.so
  extension=apc.so

  ; APC settings
  apc.enabled=1
  apc.shm_segments=1
  apc.optimization=0
  apc.shm_size=30
  apc.ttl=7200
  apc.user_ttl=7200
  apc.num_files_hint=1200
  apc.mmap_file_mask=/tmp/apc.XXXXXX
  apc.enable_cli=1



other :
=======

- Web site configured in apache as a virtual host
- there are simple mod_rewrite rules, but these don't match in many cases (so I suspect has no effect)




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-12-10 03:13 UTC] shire@php.net
This sounds like it's probably the same as bug #8663 (http://pecl.php.net/bugs/bug.php?id=8663).  Are you using rsync, svn, or changing the php source files in any way?  Try the latest cvs with the apc.stat_ctime=1 option and please let us know what you find.  Thanks.
 [2006-12-11 06:24 UTC] sukibabee at gmail dot com
>> Are you using rsync, svn, or changing the php source files in any way?

yes and no.  I do use svn, but I don't think this is the problem.  I see symptoms when no commits/reverts etc occur, and even when no files have been altered (since an apache restart of course).

I think it has to do with my filesystem.  I am running Ubuntu as a VMWare guest OS on a WinXP platform.  My HTML+PHP source reside in WinXP dirs, which are mounted via VMWare Tool's shared folders service.  So my PHP files sit in a /mnt/hgfs/... filesystem on Ubuntu.  Who knows what tricks VMWare uses to bridge the fs differences - there are big differences.  File locking would be an issue if APC relies on that too.  Does APC work with NFS mounted files?


>>  Try the latest cvs with the apc.stat_ctime=1 option and please let us know what you find. 

I did.  The latest APC shows no symptoms.  Though, I do not need to set apc.stat_ctime=1 to get things to work.  The new APC works regardless.  Could this be so?

I can quickly reproduce the problem with 3.0.12p2 (a couple of page loads is all it takes), and tested everything again several times (old, new+no_ctime and new+ctime), so I am pretty sure what I say is correct.
 [2007-02-06 19:43 UTC] shire@php.net
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.

I wouldn't have expected this in 3.0.12p2, but it's definitely possible.  Regardless, sounds like this is fixed in CVS.

It sounds like your environment is fairly involved, if this continues to affect you in latest CVS or in the next release please re-open this ticket, thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 15 19:01:34 2024 UTC