[asterisk-bugs] [JIRA] (ASTERISK-26516) pjsip: Memory corruption with possible memory leak.

Ian Gilmour (JIRA) noreply at issues.asterisk.org
Tue Nov 1 10:08:10 CDT 2016


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

Ian Gilmour edited comment on ASTERISK-26516 at 11/1/16 10:07 AM:
------------------------------------------------------------------

Hi Richard,

The patches supplied didn't apply cleanly so I updated to the current origin/13 branch which appears to already have the jira_asterisk_26344_v13_committed_fix.patch. The other patches then applied cleanly.

Leaving res_pjsip_output_registration.c with:

{noformat}
schedule_registration(state->client_state, 3 + 1);
{noformat}

gives me a system that still appears to be leaking memory.

mmlog simply has:

{noformat}
1478001617 - New session
{noformat}

But grepping CLI output after running "memory show summary" & "memory show allocations" occassionally through the test run gives me:

{noformat}
grep -e "bytes in all allocations and deferred free allocations" -e "allocations in file.*pool_policy_malloc.c" ~/screenlog.0 
   6656448 bytes in        682 allocations in file ../src/pj/pool_policy_malloc.c
  13437987 bytes in all allocations and deferred free allocations
   6697408 bytes in        722 allocations in file ../src/pj/pool_policy_malloc.c
  13571471 bytes in all allocations and deferred free allocations
   6728128 bytes in        752 allocations in file ../src/pj/pool_policy_malloc.c
  13577326 bytes in all allocations and deferred free allocations
   6733248 bytes in        757 allocations in file ../src/pj/pool_policy_malloc.c
  13605876 bytes in all allocations and deferred free allocations
   6738368 bytes in        762 allocations in file ../src/pj/pool_policy_malloc.c
  13613843 bytes in all allocations and deferred free allocations
   6755776 bytes in        776 allocations in file ../src/pj/pool_policy_malloc.c
  13573691 bytes in all allocations and deferred free allocations
   6760896 bytes in        781 allocations in file ../src/pj/pool_policy_malloc.c
  13624265 bytes in all allocations and deferred free allocations
  13607107 bytes in all allocations and deferred free allocations
  13650533 bytes in all allocations and deferred free allocations
   6791616 bytes in        811 allocations in file ../src/pj/pool_policy_malloc.c
  13670895 bytes in all allocations and deferred free allocations
  13716032 bytes in all allocations and deferred free allocations
  13673257 bytes in all allocations and deferred free allocations
  13698627 bytes in all allocations and deferred free allocations
   6853056 bytes in        871 allocations in file ../src/pj/pool_policy_malloc.c
  13726484 bytes in all allocations and deferred free allocations
  13720457 bytes in all allocations and deferred free allocations
   6991296 bytes in       1006 allocations in file ../src/pj/pool_policy_malloc.c
  13851289 bytes in all allocations and deferred free allocations
  13851545 bytes in all allocations and deferred free allocations
  13934849 bytes in all allocations and deferred free allocations
  13933169 bytes in all allocations and deferred free allocations
{noformat}
I highlighted the pool_policy_malloc.c above as this seems to be the file that shows a steady increase in usage.

I've attached the CLI output as [^screenlog-2016-11-01.tgz].  


was (Author: tuxian):
Hi Richard,

The patches supplied didn't apply cleanly so I updated to the current origin/13 branch which appears to already have the jira_asterisk_26344_v13_committed_fix.patch. The other patches then applied cleanly.

Leaving res_pjsip_output_registration.c with:

{noformat}
schedule_registration(state->client_state, 3 + 1);
{noformat}

gives me a system that still appears to be leaking memory.

mmlog simply has:

{noformat}
1478001617 - New session
{noformat}

But grepping CLI output after running "memory show summary" & "memory show allocations" occassionally through the test run gives me:

{noformat}
grep -e "bytes in all allocations and deferred free allocations" -e "allocations in file.*pool_policy_malloc.c" ~/screenlog.0 
   6656448 bytes in        682 allocations in file ../src/pj/pool_policy_malloc.c
  13437987 bytes in all allocations and deferred free allocations
   6697408 bytes in        722 allocations in file ../src/pj/pool_policy_malloc.c
  13571471 bytes in all allocations and deferred free allocations
   6728128 bytes in        752 allocations in file ../src/pj/pool_policy_malloc.c
  13577326 bytes in all allocations and deferred free allocations
   6733248 bytes in        757 allocations in file ../src/pj/pool_policy_malloc.c
  13605876 bytes in all allocations and deferred free allocations
   6738368 bytes in        762 allocations in file ../src/pj/pool_policy_malloc.c
  13613843 bytes in all allocations and deferred free allocations
   6755776 bytes in        776 allocations in file ../src/pj/pool_policy_malloc.c
  13573691 bytes in all allocations and deferred free allocations
   6760896 bytes in        781 allocations in file ../src/pj/pool_policy_malloc.c
  13624265 bytes in all allocations and deferred free allocations
  13607107 bytes in all allocations and deferred free allocations
  13650533 bytes in all allocations and deferred free allocations
   6791616 bytes in        811 allocations in file ../src/pj/pool_policy_malloc.c
  13670895 bytes in all allocations and deferred free allocations
  13716032 bytes in all allocations and deferred free allocations
  13673257 bytes in all allocations and deferred free allocations
  13698627 bytes in all allocations and deferred free allocations
   6853056 bytes in        871 allocations in file ../src/pj/pool_policy_malloc.c
  13726484 bytes in all allocations and deferred free allocations
  13720457 bytes in all allocations and deferred free allocations
   6991296 bytes in       1006 allocations in file ../src/pj/pool_policy_malloc.c
  13851289 bytes in all allocations and deferred free allocations
  13851545 bytes in all allocations and deferred free allocations
  13934849 bytes in all allocations and deferred free allocations
  13933169 bytes in all allocations and deferred free allocations
{noformat}
I highlighted the pool_policy_malloc.c above as this seems to be the file that shows a steady increase in usage.

I've attached the CLI output as screenlog-2016-11-01.tgz  

> pjsip: Memory corruption with possible memory leak.
> ---------------------------------------------------
>
>                 Key: ASTERISK-26516
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-26516
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Channels/chan_pjsip, Resources/res_pjsip
>    Affects Versions: 13.11.2
>            Reporter: Richard Mudgett
>            Assignee: Richard Mudgett
>         Attachments: 0007_jira_asterisk_26516_v13_free_mem_fix.patch, 2016-10-28.tgz, cli-and-gdb-2016-10-27.tgz, jira_asterisk_26344_v13_committed_fix.patch, jira_asterisk_26344_v13_debuging.patch, jira_asterisk_26516_v13_debugging.patch, screenlog-2016-11-01.tgz
>
>
> This is a continuation of ASTERISK-26344 and ASTERISK-26387 since the original crashes are fixed with patches added to pjproject.  For the setup description look at ASTERISK-26344.



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



More information about the asterisk-bugs mailing list