php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61478 Errors with Drupal7 and Symfony app with APC-trunk
Submitted: 2012-03-22 18:44 UTC Modified: 2012-07-20 21:58 UTC
From: szarkos@php.net Assigned: pajoye (profile)
Status: Closed Package: APC (PECL)
PHP Version: 5.4.0 OS: Windows 2008R2 SP1
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: szarkos@php.net
New email:
PHP Version: OS:

 

 [2012-03-22 18:44 UTC] szarkos@php.net
Description:
------------
Testing APC-trunk on Windows 2008R2 SP1 with Apache 2.2 and PHP 5.4.0-ts.

APC appears to load and function normally, however I receive errors on the page and in the Apache error log using either Drupal7 or a Symfony test app called AcmePizzaBundle:  https://github.com/beberlei/AcmePizzaBundle



Expected result:
----------------
Pages should display as normal without errors on the page or in the logs.

Actual result:
--------------
With Symfony I see the following error on screen and in the logs:

Notice: require(): 1. h->opened_path=[null] h->filename=[C:\Apache2\htdocs\symfony\app/../vendor/symfony/src\Symfony\Component\ClassLoader\DebugUniversalClassLoader.php] in C:\Apache2\htdocs\symfony\app\bootstrap.php.cache on line 1193

Notice: require(): apc_cache_find [-2043727128] in C:\Apache2\htdocs\symfony\app\bootstrap.php.cache on line 1193

Notice: require(): 1. h->opened_path=[null] h->filename=[C:\Apache2\htdocs\symfony\app/../vendor/symfony/src\Symfony\Component\HttpKernel\Debug\ErrorHandler.php] in C:\Apache2\htdocs\symfony\vendor\symfony\src\Symfony\Component\ClassLoader\DebugUniversalClassLoader.php on line 55

Notice: require(): apc_cache_find [-2043726680] in C:\Apache2\htdocs\symfony\vendor\symfony\src\Symfony\Component\ClassLoader\DebugUniversalClassLoader.php on line 55

Fatal error: Uncaught exception 'ErrorException' with message 'Notice: require(): 1. h->opened_path=[null] h->filename=[C:\Apache2\htdocs\symfony\app/../vendor/symfony/src\Symfony\Component\HttpKernel\Debug\ExceptionHandler.php] in C:\Apache2\htdocs\symfony\vendor\symfony\src\Symfony\Component\ClassLoader\DebugUniversalClassLoader.php line 55' in C:\Apache2\htdocs\symfony\vendor\symfony\src\Symfony\Component\HttpKernel\Debug\ErrorHandler.php:65 Stack trace: #0 C:\Apache2\htdocs\symfony\vendor\symfony\src\Symfony\Component\ClassLoader\DebugUniversalClassLoader.php(55): Symfony\Component\HttpKernel\Debug\ErrorHandler->handle(8, 'require(): 1. h...', 'C:\Apache2\htdo...', 55, Array) #1 C:\Apache2\htdocs\symfony\vendor\symfony\src\Symfony\Component\ClassLoader\DebugUniversalClassLoader.php(55): Symfony\Component\ClassLoader\DebugUniversalClassLoader::loadClass() #2 [internal function]: Symfony\Component\ClassLoader\DebugUniversalClassLoader->loadClass('Symfony\Compone...') #3 C:\Apache2\htdocs\symfony\app\bootstrap.ph in C:\Apache2\htdocs\symfony\vendor\symfony\src\Symfony\Component\HttpKernel\Debug\ErrorHandler.php on line 65


With Drupal7 I see a number of Notice messages on screen and in the log.  Here are a few lines:

•Notice: include(): 1. h->opened_path=[null] h->filename=[C:\Apache2\htdocs\drupal7/themes/bartik/templates/page.tpl.php] in theme_render_template() (line 1247 of C:\Apache2\htdocs\drupal7\includes\theme.inc).
•Notice: include(): apc_cache_find [-2043762843] in theme_render_template() (line 1247 of C:\Apache2\htdocs\drupal7\includes\theme.inc).
•Notice: include(): 1. h->opened_path=[null] h->filename=[C:\Apache2\htdocs\drupal7/modules/block/block.tpl.php] in theme_render_template() (line 1247 of C:\Apache2\htdocs\drupal7\includes\theme.inc).
•Notice: include(): apc_cache_find [-2043763217] in theme_render_template() (line 1247 of C:\Apache2\htdocs\drupal7\includes\theme.inc).
•Notice: include(): 1. h->opened_path=[null] h->filename=[C:\Apache2\htdocs\drupal7/modules/system/region.tpl.php] in theme_render_template() (line 1247 of C:\Apache2\htdocs\drupal7\includes\theme.inc).
•Notice: include(): apc_cache_find [-2043772114] in theme_render_template() (line 1247 of C:\Apache2\htdocs\drupal7\includes\theme.inc).
•Notice: include(): 1. h->opened_path=[null] h->filename=[C:\Apache2\htdocs\drupal7/modules/user/user-picture.tpl.php] in theme_render_template() (line 1247 of C:\Apache2\htdocs\drupal7\includes\theme.inc).
•Notice: include(): apc_cache_find [-2043770207] in theme_render_template() (line 1247 of C:\Apache2\htdocs\drupal7\includes\theme.inc).
•Notice: require_once(): 1. h->opened_path=[C:\Apache2\htdocs\drupal7\includes\path.inc] h->filename=[C:\Apache2\htdocs\drupal7\includes\path.inc] in _drupal_bootstrap_full() (line 4899 of C:\Apache2\htdocs\drupal7\includes\common.inc).
•Notice: require_once(): apc_cache_find [-2043772730] in _drupal_bootstrap_full() (line 4899 of C:\Apache2\htdocs\drupal7\includes\common.inc).
•Notice: require_once(): 1. h->opened_path=[C:\Apache2\htdocs\drupal7\includes\theme.inc] h->filename=[C:\Apache2\htdocs\drupal7\includes\theme.inc] in _drupal_bootstrap_full() (line 4900 of C:\Apache2\htdocs\drupal7\includes\common.inc).
•Notice: require_once(): apc_cache_find [-2043772734] in _drupal_bootstrap_full() (line 4900 of C:\Apache2\htdocs\drupal7\includes\common.inc).
•Notice: require_once(): 1. h->opened_path=[C:\Apache2\htdocs\drupal7\includes\pager.inc] h->filename=[C:\Apache2\htdocs\drupal7\includes\pager.inc] in _drupal_bootstrap_full() (line 4901 of C:\Apache2\htdocs\drupal7\includes\common.inc).
•Notice: require_once(): apc_cache_find [-2043772704] in _drupal_bootstrap_full() (line 4901 of C:\Apache2\htdocs\drupal7\includes\common.inc).
•Notice: require_once(): 1. h->opened_path=[C:\Apache2\htdocs\drupal7\includes\database\select.inc] h->filename=[C:\Apache2\htdocs\drupal7\includes\database\select.inc] in _registry_check_code() (line 2913 of C:\Apache2\htdocs\drupal7\includes\bootstrap.inc).
•Notice: require_once(): apc_cache_find [-2043772693] in _registry_check_code() (line 2913 of C:\Apache2\htdocs\drupal7\includes\bootstrap.inc).



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-03-24 18:11 UTC] pajoye@php.net
But does symfony actually work or does it fail? Besides the warnings?
 [2012-03-26 17:41 UTC] szarkos@php.net
The Symfony2 application fails with the "Fatal error" message.  Drupal7 does actually display the page if you scroll to the bottom of the page past the "Notice:" messages.
 [2012-03-29 21:33 UTC] ab@php.net
The symfony fail is reproduceable as well, no shorter snippet yet, but there is 
a valgrind trace:

==3734== 8 bytes in 1 blocks are definitely lost in loss record 295 of 4,703
==3734==    at 0x4024F20: malloc (vg_replace_malloc.c:236)
==3734==    by 0x47E1BCD: apc_pthreadrwlock_create (apc_pthreadrwlock.c:30)
==3734==    by 0x47D750D: apc_cache_create (apc_cache.c:301)
==3734==    by 0x47E11B6: apc_module_init (apc_main.c:809)
==3734==    by 0x47D318B: zm_startup_apc (php_apc.c:347)
==3734==    by 0x843224E: zend_startup_module_ex (zend_API.c:1656)
==3734==    by 0x843B53E: zend_hash_apply (zend_hash.c:716)
==3734==    by 0x8432693: zend_startup_modules (zend_API.c:1783)
==3734==    by 0x83B0817: php_module_startup (main.c:2191)
==3734==    by 0x85429D6: php_cgi_startup (cgi_main.c:931)
==3734==    by 0x8545272: main (cgi_main.c:1882)
==3734== 
==3734== 8 bytes in 1 blocks are definitely lost in loss record 296 of 4,703
==3734==    at 0x4024F20: malloc (vg_replace_malloc.c:236)
==3734==    by 0x47E1BCD: apc_pthreadrwlock_create (apc_pthreadrwlock.c:30)
==3734==    by 0x47D751E: apc_cache_create (apc_cache.c:303)
==3734==    by 0x47E11B6: apc_module_init (apc_main.c:809)
==3734==    by 0x47D318B: zm_startup_apc (php_apc.c:347)
==3734==    by 0x843224E: zend_startup_module_ex (zend_API.c:1656)
==3734==    by 0x843B53E: zend_hash_apply (zend_hash.c:716)
==3734==    by 0x8432693: zend_startup_modules (zend_API.c:1783)
==3734==    by 0x83B0817: php_module_startup (main.c:2191)
==3734==    by 0x85429D6: php_cgi_startup (cgi_main.c:931)
==3734==    by 0x8545272: main (cgi_main.c:1882)
==3734== 
==3734== 8 bytes in 1 blocks are definitely lost in loss record 297 of 4,703
==3734==    at 0x4024F20: malloc (vg_replace_malloc.c:236)
==3734==    by 0x47E1BCD: apc_pthreadrwlock_create (apc_pthreadrwlock.c:30)
==3734==    by 0x47D750D: apc_cache_create (apc_cache.c:301)
==3734==    by 0x47E11E9: apc_module_init (apc_main.c:810)
==3734==    by 0x47D318B: zm_startup_apc (php_apc.c:347)
==3734==    by 0x843224E: zend_startup_module_ex (zend_API.c:1656)
==3734==    by 0x843B53E: zend_hash_apply (zend_hash.c:716)
==3734==    by 0x8432693: zend_startup_modules (zend_API.c:1783)
==3734==    by 0x83B0817: php_module_startup (main.c:2191)
==3734==    by 0x85429D6: php_cgi_startup (cgi_main.c:931)
==3734==    by 0x8545272: main (cgi_main.c:1882)
==3734== 
==3734== 8 bytes in 1 blocks are definitely lost in loss record 298 of 4,703
==3734==    at 0x4024F20: malloc (vg_replace_malloc.c:236)
==3734==    by 0x47E1BCD: apc_pthreadrwlock_create (apc_pthreadrwlock.c:30)
==3734==    by 0x47D751E: apc_cache_create (apc_cache.c:303)
==3734==    by 0x47E11E9: apc_module_init (apc_main.c:810)
==3734==    by 0x47D318B: zm_startup_apc (php_apc.c:347)
==3734==    by 0x843224E: zend_startup_module_ex (zend_API.c:1656)
==3734==    by 0x843B53E: zend_hash_apply (zend_hash.c:716)
==3734==    by 0x8432693: zend_startup_modules (zend_API.c:1783)
==3734==    by 0x83B0817: php_module_startup (main.c:2191)
==3734==    by 0x85429D6: php_cgi_startup (cgi_main.c:931)
==3734==    by 0x8545272: main (cgi_main.c:1882)
==3734== 
==3734== 8 bytes in 1 blocks are definitely lost in loss record 299 of 4,703
==3734==    at 0x4024F20: malloc (vg_replace_malloc.c:236)
==3734==    by 0x47E1BCD: apc_pthreadrwlock_create (apc_pthreadrwlock.c:30)
==3734==    by 0x47EBB2D: apc_interned_strings_init (apc_string.c:210)
==3734==    by 0x47E135D: apc_module_init (apc_main.c:846)
==3734==    by 0x47D318B: zm_startup_apc (php_apc.c:347)
==3734==    by 0x843224E: zend_startup_module_ex (zend_API.c:1656)
==3734==    by 0x843B53E: zend_hash_apply (zend_hash.c:716)
==3734==    by 0x8432693: zend_startup_modules (zend_API.c:1783)
==3734==    by 0x83B0817: php_module_startup (main.c:2191)
==3734==    by 0x85429D6: php_cgi_startup (cgi_main.c:931)
==3734==    by 0x8545272: main (cgi_main.c:1882)
 [2012-04-02 10:11 UTC] ab@php.net
The Symfony fail happens only when APC is compiled with --enable-apc-debug. The reason is the overloaded error handler which is included in Symfony\vendor\symfony\src\Symfony\Component\HttpKernel\Debug\ErrorHandler.php

Please consider the following snippet (ErrorHandler.php just copied from the Symfony sources):

=============================================================
<?php

require 'ErrorHandler.php';
Symfony\Component\HttpKernel\Debug\ErrorHandler::register();

/* anything here is not reached */

=============================================================

The output I got with php.ini-development

Notice: Unknown: 1. h->opened_path=[null] h->filename=[C:/Apache2/htdocs/61478/repro/index.php] in Unknown on line 0

Notice: Unknown: 2. h->opened_path=[C:\Apache2\htdocs\61478\repro\index.php] h->filename=[C:/Apache2/htdocs/61478/repro/index.php] in Unknown on line 0

Notice: Unknown: apc_cache_make_file_entry: entry->data.file.filename is [C:\Apache2\htdocs\61478\repro\index.php] in Unknown on line 0

Notice: Unknown: Inserting [C:\Apache2\htdocs\61478\repro\index.php] in Unknown on line 0

Notice: require(): 1. h->opened_path=[null] h->filename=[ErrorHandler.php] in 


C:\Apache2\htdocs\61478\repro\index.php on line 3
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOo level=8 error_reporting()=32767 $this->level=32767
Fatal error: Uncaught exception 'ErrorException' with message 'Notice: require(): 1. h-&gt;opened_path=[null] h-&gt;filename=[a.php] in C:\Apache2\htdocs\61478\repro\index.php line 6' in C:\Apache2\htdocs\61478\repro\ErrorHandler.php:66 Stack trace: #0 C:\Apache2\htdocs\61478\repro\index.php(6): Symfony\Component\HttpKernel\Debug\ErrorHandler->handle(8, 'require(): 1. h...', 'C:\Apache2\htdo...', 6, Array) #1 C:\Apache2\htdocs\61478\repro\index.php(6): require() #2 {main} thrown in C:\Apache2\htdocs\61478\repro\ErrorHandler.php on line 66

As one can see, the exception text is merely the APC debug notice message.

The Drupal notices are the APC debug outputs.

@szarkos@php.net
Could you please recheck compiling without --enable-apc-debug ?
 [2012-04-02 18:33 UTC] szarkos@php.net
Tested again with --enable-apc-debug=no and I was not able to reproduce the issues.  Thanks.
 [2012-04-11 08:08 UTC] pajoye@php.net
Have to disable debug mode (output) in snapshot build.
 [2012-04-11 08:08 UTC] pajoye@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: pajoye
 [2012-07-20 21:58 UTC] ab@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 06 01:01:29 2024 UTC