[asterisk-bugs] [Asterisk 0018731]: [path] func_env.c FILE estatement left file descriptors open

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Feb 2 14:05:44 CST 2011


The following issue has been ASSIGNED. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18731 
====================================================================== 
Reported By:                marioabajo
Assigned To:                tilghman
====================================================================== 
Project:                    Asterisk
Issue ID:                   18731
Category:                   Functions/func_env
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
Asterisk Version:           SVN 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): 1.8 
SVN Revision (number only!): 305740 
Request Review:              
====================================================================== 
Date Submitted:             2011-02-02 07:02 CST
Last Modified:              2011-02-02 14:05 CST
====================================================================== 
Summary:                    [path]  func_env.c FILE estatement left file
descriptors open
Description: 
We are plenty of FILE sentences in the dialplan ( exten =>
_XXXXX,n,Set(TimeOutCFIN=${FILE(${PATH}${NRO_DEST:0:1}/${NRO_DEST}
/to_CFIN,0,${LongToCFIN})}) ) , so for every call we make some FILE
sentences are executed. In each FILE sentence the file is open and the
procedure is done correctly but the file descriptor is left open. After
some time working asterisk began saying:
[Feb  1 09:43:25] WARNING[11243] func_env.c: Cannot open file
'/opt/asterisk/config/4/48002/ruta' for reading: Too many open files
[Feb  1 09:43:25] WARNING[11243] app_dial.c: Dial requires an argument
(technology/number)
[Feb  1 09:43:34] WARNING[13987] asterisk.c: Accept returned -1: Too many
open files
[Feb  1 09:43:34] WARNING[13987] asterisk.c: Accept returned -1: Too many
open files
[Feb  1 09:43:34] WARNING[13987] asterisk.c: Accept returned -1: Too many
open files

and an 'ls -l /proc/13987/fd/ | wc -l' return's thousands of them.
We extend the "open files" limit (ulimit -n and setting maxfiles in
asterisk.conf) three times with ever increasing numbers but that only
increment the time between failures and the number of files in
/proc/.../fd/

Looking up the code of func_env.c we realize that some fclose were
missing.
This affects version 1.8.1, 1.8.2, and svn version 305740M
Thanks :-)
====================================================================== 

---------------------------------------------------------------------- 
 (0131414) svnbot (reporter) - 2011-02-02 14:05
 https://issues.asterisk.org/view.php?id=18731#c131414 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 305844

U   branches/1.8/funcs/func_env.c

------------------------------------------------------------------------
r305844 | tilghman | 2011-02-02 14:05:43 -0600 (Wed, 02 Feb 2011) | 5
lines

Eliminate a file descriptor leak when using the FILE() dialplan function.

(closes issue https://issues.asterisk.org/view.php?id=18731)
Reported by: marioabajo

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=305844 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-02-02 14:05 svnbot         Checkin                                      
2011-02-02 14:05 svnbot         Note Added: 0131414                          
2011-02-02 14:05 svnbot         Status                   new => assigned     
2011-02-02 14:05 svnbot         Assigned To               => tilghman        
======================================================================




More information about the asterisk-bugs mailing list