[asterisk-bugs] [Asterisk 0019108]: [patch] [regression] "sip prune" does not clean the relevant peer objects -> memleak

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Apr 14 10:47:25 CDT 2011


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=19108 
====================================================================== 
Reported By:                vrban
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   19108
Category:                   Channels/chan_sip/General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     acknowledged
Asterisk Version:           1.4.40 
JIRA:                       SWP-3326 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2011-04-12 10:58 CDT
Last Modified:              2011-04-14 10:47 CDT
====================================================================== 
Summary:                    [patch] [regression] "sip prune" does not clean the
relevant peer objects -> memleak
Description: 
a "sip prune realtime peer" cmd does not delete/clean the relevant Peer
object.
So if you extensively use "sip prune" cmd with sip realtime, you have a
nice mem leak. on one of our asterisk e.g.:  

asterisk -rx'sip show objects' |grep static
-= User objects: 1944 static, -359 realtime =-
-= Peer objects: 833682 static, -832764 realtime, 0 autocreate =-

so we have 833682! peer objects, but real peer number is 1944 (we prune
only the peer) so asterisk use around 500MB with this 833682 Peer objects.
====================================================================== 

---------------------------------------------------------------------- 
 (0133776) vrban (reporter) - 2011-04-14 10:47
 https://issues.asterisk.org/view.php?id=19108#c133776 
---------------------------------------------------------------------- 
attched the patch for this leak:

==12158== 3,469,048 (56,448 direct, 3,412,600 indirect) bytes in 252
blocks are definitely lost in loss record 225 of 225
==12158==    at 0x4C244E8: malloc (vg_replace_malloc.c:236)
==12158==    by 0x4C24562: realloc (vg_replace_malloc.c:525)
==12158==    by 0x5BE8576: re_compile_internal (regcomp.c:760)
==12158==    by 0x5BE88FB: regcomp (regcomp.c:506)
==12158==    by 0x17A9D046: sip_prune_realtime (chan_sip.c:11678)
==12158==    by 0x44E925: ast_cli_command (cli.c:2017)
==12158==    by 0x44ED5D: ast_cli_command_multiple (cli.c:2056)
==12158==    by 0x42683F: netconsole (asterisk.c:995)
==12158==    by 0x4BA279: dummy_start (utils.c:856)
==12158==    by 0x52378B9: start_thread (pthread_create.c:300)
==12158== 
==12158== LEAK SUMMARY:
==12158==    definitely lost: 120,968 bytes in 505 blocks
==12158==    indirectly lost: 3,412,600 bytes in 12,057 blocks
==12158==      possibly lost: 422,185 bytes in 1,117 blocks
==12158==    still reachable: 134,634 bytes in 630 blocks
==12158==         suppressed: 0 bytes in 0 blocks
==12158== Reachable blocks (those to which a pointer was found) are not
shown.
==12158== To see them, rerun with: --leak-check=full --show-reachable=yes
==12158== 
==12158== For counts of detected and suppressed errors, rerun with: -v
==12158== ERROR SUMMARY: 16852 errors from 50 contexts (suppressed: 3290
from 18) 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-04-14 10:47 vrban          Note Added: 0133776                          
======================================================================




More information about the asterisk-bugs mailing list