[asterisk-bugs] [Asterisk 0018924]: uncached realtime peers are put in peers_by_ip => memory leak

Asterisk Bug Tracker noreply at bugs.digium.com
Fri Mar 4 01:53:32 CST 2011


The following issue has been SUBMITTED. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18924 
====================================================================== 
Reported By:                wdoekes
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   18924
Category:                   Channels/chan_sip/General
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
Asterisk Version:           1.6.2.17 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2011-03-04 01:53 CST
Last Modified:              2011-03-04 01:53 CST
====================================================================== 
Summary:                    uncached realtime peers are put in peers_by_ip =>
memory leak
Description: 
Hi,

I was having problems with UDP leaks at first. This was kindly fixed by
rgagnon with his patch in https://issues.asterisk.org/view.php?id=17255. After
applying that fix, I noticed that
memory usage was *still* increasing.

I've managed to trace the problem to the following:

Peers are put in the peers_by_ip list in parse_register_contact. However,
only if the peer is static or cached(-realtime), does it get a scheduled
expire_register() call. The expire_register makes sure the peer gets
removed from the global 'peers' and 'peers_by_ip' list.

These uncached realtime peers should not be in any of those lists, but
they are in the peers_by_ip list. (Which was hard to see, because the sip
show objects only shows the 'peers' container.)

Furthermore, when asterisk is stopped with 'core stop gracefully', these
peers from these two containers are properly unreferenced: the refcount
utility shows no problem.

But, in the mean time, asterisk has been eating away memory because it
keeps on adding peers to the peers_by_ip list which are never removed.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-03-04 01:53 wdoekes        New Issue                                    
2011-03-04 01:53 wdoekes        Asterisk Version          => 1.6.2.17        
2011-03-04 01:53 wdoekes        Regression                => No              
2011-03-04 01:53 wdoekes        SVN Branch (only for SVN checkouts, not tarball
releases) => N/A             
======================================================================




More information about the asterisk-bugs mailing list