php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58128 file-nr increases steadily
Submitted: 2008-03-28 21:55 UTC Modified: 2008-05-14 12:21 UTC
From: skond at mail dot goo dot ne dot jp Assigned:
Status: Closed Package: APC (PECL)
PHP Version: 4.3.9 OS: CENTOS 4.6
Private report: No CVE-ID: None
 [2008-03-28 21:55 UTC] skond at mail dot goo dot ne dot jp
Description:
------------
APC 3.0.18

First, OK. but when Use Memory  over aboout 33MB,/proc/sys/fs/file-nr increases steadily.

One of apache process ,

ls -l /proc/27169/fd/
Display all 211 possibilities? (y or n)

When I use APC 3.0.16, each apache proc has 12 file only. 

On my server ,when over 1024 file,

PHP Warning:  Unknown(): open(/var/lib/php/session/****, O_RDWR) failed: Too many open files (24) in Unknown on line 0, referer: https://*****.php

This err is same as APC 3.0.17.I hope to update or close 3.0.18 quickly.


ls -l /proc/27169/fd/ | grep "Auth.php"

r-x------  1 apache apache 64  3?? 29 10:59 21 -> /usr/share/pear/Auth/Auth.php
lr-x------  1 apache apache 64  3?? 29 11:13 210 -> /usr/share/pear/Auth/Auth.php
lr-x------  1 apache apache 64  3?? 29 11:13 211 -> /usr/share/pear/Auth.php
lr-x------  1 apache apache 64  3?? 29 10:59 22 -> /usr/share/pear/Auth.php
lr-x------  1 apache apache 64  3?? 29 10:59 30 -> /usr/share/pear/Auth/Auth.php
lr-x------  1 apache apache 64  3?? 29 10:59 31 -> /usr/share/pear/Auth.php
lr-x------  1 apache apache 64  3?? 29 10:59 50 -> /usr/share/pear/Auth/Auth.php
lr-x------  1 apache apache 64  3?? 29 10:59 58 -> /usr/share/pear/Auth.php
lr-x------  1 apache apache 64  3?? 29 10:59 59 -> /usr/share/pear/Auth/Auth.php
lr-x------  1 apache apache 64  3?? 29 10:59 60 -> /usr/share/pear/Auth.php
lr-x------  1 apache apache 64  3?? 29 10:59 68 -> /usr/share/pear/Auth/Auth.php
lr-x------  1 apache apache 64  3?? 29 10:59 70 -> /usr/share/pear/Auth.php
lr-x------  1 apache apache 64  3?? 29 10:59 72 -> /usr/share/pear/Auth/Auth.php
lr-x------  1 apache apache 64  3?? 29 10:59 73 -> /usr/share/pear/Auth.php
lr-x------  1 apache apache 64  3?? 29 10:59 79 -> /usr/share/pear/Auth/Auth.php
lr-x------  1 apache apache 64  3?? 29 10:59 80 -> /usr/share/pear/Auth.php
lr-x------  1 apache apache 64  3?? 29 10:59 82 -> /usr/share/pear/Auth/Auth.php
lr-x------  1 apache apache 64  3?? 29 10:59 83 -> /usr/share/pear/Auth.php
lr-x------  1 apache apache 64  3?? 29 10:59 85 -> /usr/share/pear/Auth/Auth.php
lr-x------  1 apache apache 64  3?? 29 10:59 86 -> /usr/share/pear/Auth.php
lr-x------  1 apache apache 64  3?? 29 10:59 92 -> /usr/share/pear/Auth/Auth.php
lr-x------  1 apache apache 64  3?? 29 10:59 93 -> /usr/share/pear/Auth.php



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-29 01:45 UTC] rasmus@php.net
Any chance you could try the CVS code?

cvs -d:pserver:cvsread@cvs.php.net:/repository co APC_3_0 pecl/apc

login pwd for the cvsread account is: phpfi
 [2008-03-29 02:38 UTC] skond66 at mail dot goo dot ne dot jp
sorry.MY pc now in proxy.I don't understand how to try.
 [2008-03-29 06:00 UTC] skond66 at mail dot goo dot ne dot jp
I will try to fix only CVE-2008-1488 to APC 3.0.16.

And I use at "apc.include_once_override  = 1"

Sorry  my bad english.
 [2008-03-29 10:58 UTC] gopalv82 at yahoo dot com
My immediate suspicion goes towards the url_stat() code.

Thanks for the bug, I'll trace through it on Monday.
 [2008-03-30 05:44 UTC] mike at clock dot co dot uk
I too am experiencing this bug. It only affects my PHP 4.3.10 and 4.4.4 installations (Debian Etch AMD64); PHP 5.2.0 does NOT seem to be affected.

Thanks,
Mike
 [2008-03-31 08:46 UTC] gopalv82 at yahoo dot com
try 

wget "http://cvsweb.php.net/viewvc.cgi/pecl/apc/apc_main.c?r1=3.107&r2=3.108&view=patch"  -O kludge.patch

patch -R < kludge.patch

on 3.0.18 (and yeah, one line won't patch right - ignore)

Confirm, please.
 [2008-03-31 09:44 UTC] mike at clock dot co dot uk
Hi gopalv,

I tested your patch with a PHP 4.4.4 server against 3.0.18. It compiled fine, but unfortunately PHP pages start returning blank, and the Apache error log starts filling with these line:

[Mon Mar 31 15:38:29 2008] [notice] child pid 18615 exit signal Segmentation fault (11)

Regards,
Mike
 [2008-03-31 20:16 UTC] skond66 at mail dot goo dot ne dot jp
Thanks gopalv. But me too,this err.

  child pid 19479 exit signal Segmentation fault (11)

I saw diff and think 

At 3 line  before "zend_llist_add_element"

<old OK 3.0.16>
h->opened_path = estrdup(cache_entry->data.file.filename);

<BAD 3.0.18 >
h->opened_path = cache_entry->data.file.filename;

I don't understand this difference,but I think that it become the clue.

I'm sorry in clumsy English.
(Powered by Yahoo Translation...)
 [2008-04-01 09:37 UTC] tarmstrong at gmail dot com
Using APC-2.0.17 (with PHP 5.2.5), I'm suffering the same problems as this user, but on CentOS 5. I see on my Apache error log a lot of these messages:
------
[warn-phpd] mmap cache can't open /var/www/html/foo.php - Too many open files in system (pid 1694)
-------

I increased the value max open files, by modifying '/etc/security/limits.conf' file (see http://lists.centos.org/pipermail/centos/2005-February/045072.html), but still getting those error messages and white pages.

I'm triyng to install v2.0.18 with the patch you suggest but got this message:
-----------
[]# wget "http://cvsweb.php.net/viewvc.cgi/pecl/apc/apc_main.c?r1=3.107&r2=3.108&view=patch"
-O kludge.patch
[]# patch -R < kludge.patch
patching file apc_main.c
Hunk #1 FAILED at 28.
Hunk #2 succeeded at 280 (offset 38 lines).
Hunk #3 succeeded at 315 with fuzz 1 (offset 2 lines).
1 out of 3 hunks FAILED -- saving rejects to file apc_main.c.rej
------------

and I don't know if I must continue or not. Any suggestion is welcome.
 [2008-04-01 09:53 UTC] tarmstrong at gmail dot com
I tried to install APC 3.0.18 (without the Patch) on a Fedora Core server which was running ol APC 3.0.10 and got this error message in a few seconds:
------
Too many open files in system
---------
 [2008-04-04 09:06 UTC] ascott at casdn dot neu dot edu
I've been running out of file handles with 3.0.17 and .18. Didn't notice immediately, but when phpMyAdmin stopped working, I checked the apache server log and found numerous errors as follows:

(24)Too many open files: /home/physics/web-docs/.htaccess pcfg_openfile:

I checked the available file handles, and the system has plenty to spare. The most use on the system is 5634 out of 
a maximum of 16384.

I've gone back to APC 3.0.16, and the problems have stopped.

The newer versions (.0.17-.18) seem to have fixed the errors  described in #12956, but those errors don't cause pages to not be served, while this latest problem causes the server to stop serving pages, at least within a particular apache process.

Installed versions:

Apache/2.0.63 (Unix) and PHP/4.4.8
 [2008-04-07 16:06 UTC] ben at rochen dot com
I've also experienced this same issue under CentOS 4.6, Apache 1.3.39, PHP 4.4.7, APC 3.0.18.

Raising file-max with sysctl or restarting Apache provide temporary relief.

The patch suggested by gopalv resulted in the following:
patching file apc_main.c
Hunk #1 FAILED at 28.
Hunk #2 succeeded at 280 (offset 38 lines).
Hunk #3 succeeded at 315 with fuzz 1 (offset 2 lines).
1 out of 3 hunks FAILED -- saving rejects to file apc_main.c.rej
 [2008-04-09 06:37 UTC] skond66 at amil dot goo dot ne dot jp
Thanks gopalv.

apc_main.c Revision 3.103.2.5  with APC 3.0.18
it seems to be good for my PHP4 Server.
 [2008-05-02 16:49 UTC] info at vacilando dot org
Same problem on CentOS 5, PHP 5.1.6 and APC 3.0.18. Nightmare!
 [2008-05-06 14:09 UTC] gamergun at gmail dot com
Same problem with CentOS 4 and PHP4
 [2008-05-08 11:04 UTC] ricardo-g-ramalho at telecom dot pt
Same problem with Debian Etch, Kernel 2.6.18, Php 4.4.4, Apache 2.2.3
 [2008-05-14 08:02 UTC] ando at rikezemi dot com
I saw same problem with APC.
the enviroment is bellow.

Debian-sarge 32bit
PHP4.3.11
APC3.0.18(pthread mutex)

and another problem with PHP5.
PHP outputs warnings under safe_mode.
it seemd PHP try to read multi files,on include_path contains multiple paths.

I am waiting APC3.0.19 for a month.
there is some reason that 3.0.19 couldn't out ?
 [2008-05-14 12:21 UTC] rasmus@php.net
These issues are fixed in CVS.  3.0.19 is coming shortly.  Grab the current APC_3_0 branch if you are impatient.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 23:01:27 2024 UTC