php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58156 APC does not cache anymore some files
Submitted: 2008-04-15 04:31 UTC Modified: 2008-06-26 08:15 UTC
From: laurent dot baillet at gmail dot com Assigned:
Status: Closed Package: APC (PECL)
PHP Version: 5.2.5 OS: Linux Debian Etch (up-to-date)
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: laurent dot baillet at gmail dot com
New email:
PHP Version: OS:

 

 [2008-04-15 04:31 UTC] laurent dot baillet at gmail dot com
Description:
------------
Hello

For some reason, after an upgrade, my setup based on apache 1 (1.3.34-4.1+etch1), PHP 5.2.5 as an Apache module and APC 3.0.18 ceased to work :
- the load becomes really high
- some files are not cached anymore 

Apache has never evolved in the scenario so let's concentrate on PHP and APC.

- PHP 5.2.1 + APC 3.0.16 (APC generated with this PHP version) : worked
- PHP 5.2.1 + APC 3.0.18 (APC generated with this PHP version) : worked
- PHP 5.2.5 + APC 3.0.18 (APC generated on a  PHP 5.2.1 + APC 3.0.18 box) : worked
- PHP 5.2.5 + APC 3.0.18 (APC generated with this PHP version) : broken

Broken means that a large part of files that should be cached are not cached anymore

Here is the config part (it did not change) :

extension=apc.so
apc.enabled=1
apc.optimization=0
apc.ttl=300
apc.shm_size=64
apc.shm_segments=1
apc.num_files_hint=3500
apc.user_entries_hint=0
apc.mmap_file_mask=/tmp/apc.XXXXXX
apc.file_update_protection=0
apc.slam_defense=90
apc.filters="generes,tmp"


Reproduce code:
---------------
Just start Apache and wait for the mess

Expected result:
----------------
Most obviously, the auto_prepend file included on all pages is not cached anymore. Other files neither, leading to very high load.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-04-17 09:38 UTC] laurent dot baillet at gmail dot com
edit : it could be related to my LFS_CFLAGS

having removed "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" from inclusion in the compilation process, it seems to work fine.

under investigation
 [2008-06-26 08:15 UTC] gopalv82 at yahoo dot com
3.0.16 called stat() directly

3.0.18 called php's internal url_stat()

If the php build and apc build differs in off_t sizes (i.e _FILE_OFFSET_BITS), the size of "struct stat" will vary between 88 and 96 bytes, thus giving you the wrong value in the struct members (as read by APC).

I'm writing a dwarf2 tool (ala lkml's pahole) to scan for this kind of stuff (about the sixth time I've seen this in 3 months) but don't hold your breath :)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 13 14:01:31 2025 UTC