[asterisk-bugs] [Asterisk 0013505]: Memory leak in channel variables

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Oct 14 17:27:43 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13505 
====================================================================== 
Reported By:                mav3rick
Assigned To:                Corydon76
====================================================================== 
Project:                    Asterisk
Issue ID:                   13505
Category:                   Channels/General
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     confirmed
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 143334 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-09-17 11:06 CDT
Last Modified:              2008-10-14 17:27 CDT
====================================================================== 
Summary:                    Memory leak in channel variables
Description: 
I detected the leak on Asterisk 1.4.21.2. I reproduced the bug easily on
the SVN trunk version. 

After 5000 calls, Asterisk is using more than 500Mb. 

I recompiled with MALLOC_DEBUG (and DONT_OPTIMIZE), and after around 500
calls I found :

661364 bytes in 6321 allocations in file 'config.c'
(numbers increase with calls).

That was the only abnormal allocation (and the only increasing).

All 'config.c' allocations are :

XX bytes allocated in ast_variable_new at line 240 of config.c
(appeared a lot of times with different values).

I added debug to config.c to know which variable was concerned. The only
variables I saw was the variables I set in call files (outgoing calls).

======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
has duplicate       0013543 Memory leacks in stress test with failure
====================================================================== 

---------------------------------------------------------------------- 
 (0093655) svnbot (reporter) - 2008-10-14 17:27
 http://bugs.digium.com/view.php?id=13505#c93655 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 149199

U   trunk/channels/chan_sip.c
U   trunk/include/asterisk/chanvars.h
U   trunk/include/asterisk/config.h
U   trunk/include/asterisk/hashtab.h
U   trunk/include/asterisk/strings.h
U   trunk/main/chanvars.c
U   trunk/main/config.c
U   trunk/main/hashtab.c
U   trunk/pbx/pbx_spool.c
U   trunk/res/res_indications.c

------------------------------------------------------------------------
r149199 | tilghman | 2008-10-14 17:27:42 -0500 (Tue, 14 Oct 2008) | 8
lines

Add additional memory debugging to several core APIs, and fix several
memory
leaks found with these changes.
(Closes issue http://bugs.digium.com/view.php?id=13505, closes issue
http://bugs.digium.com/view.php?id=13543)
Reported by: mav3rick, triccyx
 Patches: 
       20081001__bug13505.diff.txt uploaded by Corydon76 (license 14)
 Tested by: mav3rick, triccyx

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

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

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-10-14 17:27 svnbot         Checkin                                      
2008-10-14 17:27 svnbot         Note Added: 0093655                          
======================================================================




More information about the asterisk-bugs mailing list