[asterisk-bugs] [Asterisk 0018735]: [patch] memory leak with IAX in 1.6.2

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Mar 1 11:35:10 CST 2011


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18735 
====================================================================== 
Reported By:                tzafrir
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   18735
Category:                   Channels/chan_iax2
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     ready for testing
Asterisk Version:           SVN 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 306010 
Request Review:              
====================================================================== 
Date Submitted:             2011-02-02 12:43 CST
Last Modified:              2011-03-01 11:35 CST
====================================================================== 
Summary:                    [patch] memory leak with IAX in 1.6.2
Description: 
I'm trying to track a certain memory leak: the sizes (rss, size, vsize)
keep increasing, whereas the memory size shown by 'memory show summary' and
'astobj2 show allocations' don't inflate.

When I stop the remote Asterisk server, the memory inflation stops. Thus
it must be triggered by the registration requests.

I managed to reproduce this on several Centos5 systems, but not on my
laptop (x86_64, Debian Squeeze). It has been around for a number of months,
at least.

Update: seems to be easy to reproduce on other 32bit systems. I'm not
exactly sure if it happens in 64bit systems (the rss increases the same,
but size and vsize seem to increase in much larger steps).
====================================================================== 

---------------------------------------------------------------------- 
 (0132491) tzafrir (manager) - 2011-03-01 11:35
 https://issues.asterisk.org/view.php?id=18735#c132491 
---------------------------------------------------------------------- 
The attached patch helped on trunk, but not on 1.6.2 (and on 1.8)


The issue can still be reproduced on a a Centos 5 system (though no longer
on a Debian one). So there seem to have been more than one issue.

When comparing the output of valgrind from a short run to that of a longer
run, I see the following significant extra additions:

12,376 bytes in 17 blocks are still reachable in loss record 760 of 7

   at 0x4004C42: calloc (vg_replace_malloc.c:418)
   by 0x4A34A07: iax_frame_new (utils.h:462)
   by 0x4A13791: iax2_send (chan_iax2.c:6166)
   by 0x4A1B265: registry_authrequest (chan_iax2.c:7178)
   by 0x4A2C7CB: socket_process (chan_iax2.c:10858)
   by 0x4A31A8C: iax2_process_thread (chan_iax2.c:11263)
   by 0x815523A: dummy_start (utils.c:970)
   by 0x52A831: start_thread (in /lib/libpthread-2.5.so)
   by 0x469F6D: clone (in /lib/libc-2.5.so)


12,597 bytes in 17 blocks are still reachable in loss record 761 of 7

   at 0x4004C42: calloc (vg_replace_malloc.c:418)
   by 0x4A34A07: iax_frame_new (utils.h:462)
   by 0x4A13791: iax2_send (chan_iax2.c:6166)
   by 0x4A143B3: send_command_final (chan_iax2.c:7178)
   by 0x4A1CF94: update_registry (chan_iax2.c:8536)
   by 0x4A2C6F7: socket_process (chan_iax2.c:10846)
   by 0x4A31A8C: iax2_process_thread (chan_iax2.c:11263)
   by 0x815523A: dummy_start (utils.c:970)
   by 0x52A831: start_thread (in /lib/libpthread-2.5.so)
   by 0x469F6D: clone (in /lib/libc-2.5.so)




15,672 bytes in 1,306 blocks are possibly lost in loss record 763 of

   at 0x4004C42: calloc (vg_replace_malloc.c:418)
   by 0x807D346: __ao2_link (utils.h:462)
   by 0x807E311: _ao2_link (astobj2.c:579)
   by 0x49FF048: replace_callno (chan_iax2.c:2510)
   by 0x8143732: ast_sched_runq (sched.c:621)
   by 0x814391D: sched_run (sched.c:118)
   by 0x815523A: dummy_start (utils.c:970)
   by 0x52A831: start_thread (in /lib/libpthread-2.5.so)
   by 0x469F6D: clone (in /lib/libc-2.5.so)

Current version: SVN-branch-1.6.2-r308990


When I build it with dev-mode, I still get basically the same memory leak,
but the output from 'astobj2 show stats' does not inflate like the output
of ps. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-03-01 11:35 tzafrir        Note Added: 0132491                          
======================================================================




More information about the asterisk-bugs mailing list