[Home]

Summary:ASTERISK-17335: [path] func_env.c FILE estatement left file descriptors open
Reporter:Mario Abajo (marioabajo)Labels:
Date Opened:2011-02-02 07:02:31.000-0600Date Closed:2011-02-02 14:06:34.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Functions/func_env
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
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 :-)

****** ADDITIONAL INFORMATION ******

[[inline patch deleted]]
Comments:By: Digium Subversion (svnbot) 2011-02-02 14:05:44.000-0600

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 ASTERISK-17335)
Reported by: marioabajo

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

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

By: Digium Subversion (svnbot) 2011-02-02 14:06:34.000-0600

Repository: asterisk
Revision: 305845

_U  trunk/
U   trunk/funcs/func_env.c

------------------------------------------------------------------------
r305845 | tilghman | 2011-02-02 14:06:34 -0600 (Wed, 02 Feb 2011) | 12 lines

Merged revisions 305844 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
 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 ASTERISK-17335)
 Reported by: marioabajo
........

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

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