php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61398 APC fails to find class methods
Submitted: 2012-03-15 10:57 UTC Modified: 2012-08-07 11:39 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: letharion at gmail dot com Assigned: ab
Status: Closed Package: APC (PECL)
PHP Version: 5.4.0 OS: Linux/Windows
Private report: No CVE-ID:
 [2012-03-15 10:57 UTC] letharion at gmail dot com
Description:
------------
There is a similar issue here: https://bugs.php.net/bug.php?id=59197 but the last comment seems a bit different, is for another php version, and very similar to my issue, so I believe we may have a different source of our problem.

When calling any page in my Drupal setup, I get:
Fatal error: Class SchemaCache contains 5 abstract methods and must therefore be declared abstract or implement the remaining methods (DrupalCacheArray::resolveCacheMiss, ArrayAccess::offsetExists, ArrayAccess::offsetGet, ...) in /var/www/bootstrap.inc on line 2849

The code is publicly available here: http://drupalcode.org/project/drupal.git/blob/4d4080b17681ae674e10c077b72d00f0b1544e0c:/includes/bootstrap.inc
where it's easy to see that the 5 methods _are_ implemented. Disabling APC solves the issue.

Last comment from 59197 copied in:
I'm seeing a similar issue using APC 3.1.9 with PHP 5.4.0RC4 on Windows (Win7 
x64, Apache 2.2.17). I've built APC myself using VS2008 (shared, TS, x86, 
Release).

After enabling APC, my app crashes randomly with bogus error messages. Sometimes methods in subclasses are not detected:



/lib/Base.php
-------------

class Base {
   abstract protected function foo();
}



/lib/Sub.php
------------

class Sub extends Base {
   protected function foo() { print "world!"; }
}



After including both files, I get "Sub contains abstract methods and must 
therefore also be abstract (Base::foo())". When I restart Apache, the error goes 
away for one request. After that, I get "Call to undefined method 
Loader::addPath" (this method definitely exists, disabling APC makes it work 
again).

My APC config:

-----------------------
apc.enabled = On
apc.cache_by_default = On
apc.slam_defense = 0
apc.write_lock = 1
-----------------------

Expected result:
----------------
I would expect the code to run. :)

Actual result:
--------------
Error message, posted in description.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-03-18 13:13 UTC] pajoye@php.net
-Status: Open +Status: Feedback
 [2012-03-18 13:13 UTC] pajoye@php.net
Surely a duplicate of #61219

Please try using svn's trunk.
 [2012-07-21 21:12 UTC] ab@php.net
fixed with APC 3.1.10 at least, see also bug #61219
 [2012-07-21 21:12 UTC] ab@php.net
-Status: Feedback +Status: Closed -Assigned To: +Assigned To: ab
 [2012-07-22 16:56 UTC] ab@php.net
This bug seems to be not fixed yet as the test based on the reproduce code from  
bug #38779 fails with APC but passes without it. It has definitely something to 
do with stream wrappers.
 [2012-07-22 16:56 UTC] ab@php.net
-Status: Closed +Status: Re-Opened
 [2012-07-22 16:58 UTC] ab@php.net
Automatic comment from SVN on behalf of ab
Revision: http://svn.php.net/viewvc/?view=revision&revision=326768
Log: added test for bug #61398
 [2012-07-22 18:48 UTC] ab@php.net
Automatic comment from SVN on behalf of ab
Revision: http://svn.php.net/viewvc/?view=revision&revision=326772
Log: fixed the bug #61398 test
 [2012-08-07 11:37 UTC] ab@php.net
Automatic comment from SVN on behalf of ab
Revision: http://svn.php.net/viewvc/?view=revision&revision=327013
Log: fixed bug where apc requires url_stat to be implemented for userspace stream wrappers in require
related to bug #62502, bug #61398, bug #38779
 [2012-08-07 11:39 UTC] ab@php.net
fixed in svn
 [2012-08-07 11:39 UTC] ab@php.net
-Status: Re-Opened +Status: Closed
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sun Apr 20 13:01:59 2014 UTC