php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57467 apc_fcntl_lock failed
Submitted: 2007-01-05 07:09 UTC Modified: 2009-02-16 19:24 UTC
From: fxbois at nospam dot org Assigned:
Status: Closed Package: APC (PECL)
PHP Version: 5.2.0 RC4 OS: rhel3
Private report: No CVE-ID: None
 [2007-01-05 07:09 UTC] fxbois at nospam dot org
Description:
------------
Hi,

I have this error
[apc-error] apc_fcntl_lock failed: Bad file descriptor

when I use any apc function

My configure script is 
'./configure' '--disable-cgi' '--disable-debug' '--enable-calendar' '--enable-exif' '--enable-gd-native-ttf' '--enable-memory-limit' '--enable-safe-mode' '--enable-ftp' '--enable-mbstring' '--enable-pcntl' '--enable-soap' '--enable-zip' '--with-apxs2' '--with-bz2' '--with-config-file-path=/etc' '--with-curl' '--with-freetype-dir=/usr/lib' '--with-gd' '--with-jpeg' '--with-jpeg-dir=/usr/lib/' '--with-kerberos' '--with-mysql=/usr/lib' '--with-mysqli=/usr/bin/mysql_config' '--with-openssl' '--with-pdo-mysql' '--with-xmlrpc' '--with-zlib'


Any idea ?

 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-05 07:11 UTC] fxbois at nospam dot org
Hi,

I have this error
[apc-error] apc_fcntl_lock failed: Bad file descriptor

when I use any apc function

My configure script is 
'./configure' '--disable-cgi' '--disable-debug' '--enable-calendar'
'--enable-exif' '--enable-gd-native-ttf' '--enable-memory-limit'
'--enable-safe-mode' '--enable-ftp' '--enable-mbstring' '--enable-pcntl'
'--enable-soap' '--enable-zip' '--with-apxs2' '--with-bz2'
'--with-config-file-path=/etc' '--with-curl'
'--with-freetype-dir=/usr/lib' '--with-gd' '--with-jpeg'
'--with-jpeg-dir=/usr/lib/' '--with-kerberos' '--with-mysql=/usr/lib'
'--with-mysqli=/usr/bin/mysql_config' '--with-openssl'
'--with-pdo-mysql' '--with-xmlrpc' '--with-zlib'

Any idea ?
 [2007-02-17 23:05 UTC] shire@php.net
What version of APC are you using?  Can you please try the latest CVS and see if this problem still occurs?  If so please provide your configuration options and APC specific ini options.  Thanks!
 [2007-02-25 03:29 UTC] rasmus@php.net
3.0.13 is out now with a couple of alternative locking mechanisms.  Try that.
 [2007-03-20 04:52 UTC] info at flinkux dot de
Hi,
under (gentoo amd64 x86_64)apache 2.0.58 php 5.2.1 with apc 3.0.13 i have an identical Problem.Bad filedescriptor and apache is segfaulting.With apache2.0.58 php 5.1.6 and apc 3.0.12 and the same config it runs fine over months.

What could be the reason ?
 [2007-03-20 05:01 UTC] gopalv82 at yahoo dot com
If you have set apc.mmap_file_mask to some value, please apply

http://cvs.php.net/viewvc.cgi/pecl/apc/php_apc.c?r1=3.135&r2=3.136

And just as an aside, describing the values in your apc.ini might just help me to figure out what's happening.

PS: .13 is an unlucky release ;)
 [2007-03-20 06:17 UTC] info at flinkux dot de
Hi have tried different configs

apc.enabled="1"
apc.shm_segments="1"
apc.shm_size="30"
apc.optimization="0"
apc.num_files_hint="1024"
apc.ttl="7200"
apc.user_ttl="7200"
apc.gc_ttl="3600"
apc.cache_by_default="1"
apc.mmap_file_mask="/tmp/apcphp5.XXXXXX"
apc.file_update_protection="2"
apc.enable_cli="1"
apc.max_file_size="1M"
apc.stat="1"
apc.write_lock=0


apc.enabled="1"
apc.shm_segments="1"
apc.shm_size="30"
apc.optimization="0"
apc.num_files_hint="1024"
apc.ttl="7200"
apc.user_ttl="7200"
apc.gc_ttl="3600"
apc.cache_by_default="1"
;apc.mmap_file_mask="/tmp/apcphp5.XXXXXX"
apc.file_update_protection="2"
apc.enable_cli="1"
apc.max_file_size="1M"
apc.stat="1"
apc.write_lock=1

I have tried to work with and without mmap and with and without write lock.
 [2007-05-30 15:06 UTC] fuxa_kos at unihost dot cz
Lot of segfault 
[apc-error] apc_fcntl_lock failed: Bad file descriptor 
on more busy servers RHEL4 (i686 and x86_64 too), Apache 
2.0.59, PHP 5.2.2, 5.2.1, 4.4.7 and so on, with 3.0.14 and 
3.0.13 too. (all compiled). On server with huge mem and 
low req/rate isn't problem, w same config.
 [2007-10-15 12:22 UTC] phpbugs at majiclab dot com
I have recently had this same error message on my production server 2 times in the last 2-3 weeks.  It brings the whole server down as all sites with APC enabled stop working, just returns a blank page.

Just before I started getting these errors I upgraded to .14, I was running .12p2 before.  On a php 5.1.6 server.  I don't see any other errors in the logs other than hundreds of lines of "[apc-error] apc_fcntl_lock failed: Bad file descriptor".
 [2007-10-29 15:00 UTC] john at johnsworld dot com
I've just had this happen to me.  What did you guys do to fix this?
 [2008-01-06 11:23 UTC] eugenedude at hotmail dot com
In the same boat:

[Sun Jan  6 07:10:00 2008] [apc-error] apc_fcntl_lock failed: Bad file descriptor


all day with phpinfo showing:

apc
APC Support 	enabled
Version 	3.0.15
MMAP Support 	Disabled
Locking type 	File Locks
Revision 	$Revision: 3.151 $
Build Date 	Jan 5 2008 11:14:34

AND PHP Version 5.2.5-pl1-gentoo

Build Date 	Jan 5 2008 11:12:23

(MORE APC SETTINGS)

Directive	Local Value	Master Value
apc.cache_by_default	On	On
apc.enable_cli	Off	Off
apc.enabled	On	On
apc.file_update_protection	2	2
apc.filters	no value	no value
apc.gc_ttl	3600	3600
apc.include_once_override	Off	Off
apc.localcache	Off	Off
apc.localcache.size	512	512
apc.max_file_size	1M	1M
apc.num_files_hint	1024	1024
apc.report_autofilter	Off	Off
apc.rfc1867	Off	Off
apc.rfc1867_freq	0	0
apc.rfc1867_name	APC_UPLOAD_PROGRESS	APC_UPLOAD_PROGRESS
apc.rfc1867_prefix	upload_	upload_
apc.shm_segments	1	1
apc.shm_size	30	30
apc.slam_defense	0	0
apc.stat	On	On
apc.stat_ctime	Off	Off
apc.ttl	7200	7200
apc.user_entries_hint	4096	4096
apc.user_ttl	7200	7200
apc.write_lock	On	On
 [2009-02-16 19:24 UTC] shire@php.net
Closing this bug as it's pretty old, if you're still seeing this problem then please try with an alternative locking type and the latest release as it may have fixed some faults.  Please update ticket #13474 if you continue to have issues: http://pecl.php.net/bugs/bug.php?id=13474
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 28 13:01:29 2024 UTC