[asterisk-bugs] [JIRA] (ASTERISK-24152) memory leak and segfault with in libpthread-2.17.so

Walter Doekes (JIRA) noreply at issues.asterisk.org
Fri Aug 29 04:06:29 CDT 2014


    [ https://issues.asterisk.org/jira/browse/ASTERISK-24152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=222473#comment-222473 ] 

Walter Doekes commented on ASTERISK-24152:
------------------------------------------

Before:
{noformat}
$ awk '{print $9}' Junk/memoryallocations | sort | uniq -c | sort -n | tail -n10
   1577 endpoints.c
   2097 chan_sip.c
   2123 pbx.c
   3557 media_index.c
   3578 taskprocessor.c
   3928 xmldoc.c
   6459 format_cap.c
   7294 stasis.c
   8204 astobj2.c
  50082 /usr/local/src/asterisk-12.5.0/include/asterisk/lock.h
{noformat}
After an hour:
{noformat}
$ awk '{print $9}' Junk/memoryallocations-hour  | sort | uniq -c | sort -n | tail -n10
   3932 xmldoc.c
   6529 stasis_message_router.c
   6659 utils.c
   6901 endpoints.c
  13270 chan_sip.c
  17330 taskprocessor.c
  17995 format_cap.c
  20371 astobj2.c
  36593 stasis.c
  85346 /usr/local/src/asterisk-12.5.0/include/asterisk/lock.h
{noformat}
You have now allocated more than:
{noformat}
$ n=0; awk '{print $1}' Junk/memoryallocations-hour   | while read x; do n=$((x+n)); echo $n; done | tail -n1
729543142  (700MB)
{noformat}
So the following increases can be seen:
{noformat}
chan_sip: x6.3
stasic: x5.0
taskprocessor: x4.8
format_cap: x2.7
lock: x1.7
{noformat}
For chan_sip, that concerns these allocations that weren't in {{Junk/memoryallocations}}:
{noformat}
$ awk '{if($9=="chan_sip.c"){print $5}}' Junk/memoryallocations-hour | sort | uniq -c | sort -n
## ...
     74 __sip_reliable_xmit()
     74 sip_st_alloc()
##     90 sip_register()
    148 copy_request()
    222 sip_alloc()
   3161 proxy_from_config()   # was 497
   9480 build_peer()  # was 1493
{noformat}

So, you are leaking peers.

Are you using realtime? And if so, what settings? (rtcaching?)

Next step would be to figure out which peers are leaking. And from there you could start to examine why they aren't cleaned up.

OPTIONS? MESSAGES? MWI/NOTIFY? REGISTER? (through register=> lines? or callbackexten?)

> memory leak and segfault with in libpthread-2.17.so
> ---------------------------------------------------
>
>                 Key: ASTERISK-24152
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-24152
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Channels/chan_sip/General, Resources/res_pjsip
>    Affects Versions: 12.4.0
>         Environment: 12.4.0 
> Ubuntu 13.10
>            Reporter: Yuriy Gorlichenko
>            Assignee: Yuriy Gorlichenko
>         Attachments: backtrace_bt_full.txt, backtrace.txt, memsummary_hour.txt, memsummary_start.txt, mmlog, valgrind.txt
>
>
> Hello. I have issue with asterisk 12.4.0 with memory leak.
> I have installed asterisk 12.4.0 at Ubuntu 13.10 with realtime chan_sip and pjsip modules (at diffrent ports: chan_sip used as trunk channel and pjsip runs as client side).
> I see at syslog that my system fails futh segfault:
> kernel: [17857.689103] asterisk[23250]: segfault at 2cf ip 00007ff84a294164 sp 00007ff79aeb75a0 error 4 in libpthread-2.17.so[7ff84a28b000+17000]
> Then i open "top" appliation and monitor memory that used by asterisk. I monitored it at 1.5 hour and all this time memory usage grows (number of calls at one time always 2-5). So at start I see 3,3% of usage and then after 1.3 hour I see 11,5% usage.
> I recompiled my asterisk with MALLOC_DEBUG and use from asterisk CLI "memory show summary" at start and after hour of work.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list