[asterisk-bugs] [JIRA] (ASTERISK-29604) ari: Segfault with lots of calls

Artem (JIRA) noreply at issues.asterisk.org
Sun Jul 31 18:54:08 CDT 2022


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

Artem edited comment on ASTERISK-29604 at 7/31/22 6:54 PM:
-----------------------------------------------------------

There were no problems after adding a NULL check to all three places
If at least one is removed, then segfault crashes on my tests

{code}
  if(snoop->spyee_chan) {
    ast_channel_cleanup(snoop->spyee_chan);
  }
{code}

{code}
  if(snoop->spyee_chan) {
    spyee_snapshot = ast_channel_snapshot_get_latest(ast_channel_uniqueid(snoop->spyee_chan));
    if (spyee_snapshot) {
      ast_multi_channel_blob_add_channel(payload, "spyee_channel", spyee_snapshot);
    }
  } else {
    return;
  }
{code}
{code}
  /* Keep a reference to the channel we are spying on */
  if(chan) {
    snoop->spyee_chan = ast_channel_ref(chan);
  }
{code}


was (Author: ari_segfault):
There were no problems after adding a NULL check to all three places
If at least one is removed, then segfault crashes on my tests

  if(snoop->spyee_chan) {
    ast_channel_cleanup(snoop->spyee_chan);
  }

  if(snoop->spyee_chan) {
    spyee_snapshot = ast_channel_snapshot_get_latest(ast_channel_uniqueid(snoop->spyee_chan));
    if (spyee_snapshot) {
      ast_multi_channel_blob_add_channel(payload, "spyee_channel", spyee_snapshot);
    }
  } else {
    return;
  }


  /* Keep a reference to the channel we are spying on */
  if(chan) {
    snoop->spyee_chan = ast_channel_ref(chan);
  }


> ari: Segfault with lots of calls
> --------------------------------
>
>                 Key: ASTERISK-29604
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-29604
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Applications/app_stasis, Channels/chan_sip/General
>    Affects Versions: 16.18.0, 16.20.0, 18.6.0
>         Environment: Asterisk version: 16.20.0
> OS: Ubuntu 16.04 LTS
> Hardware: 4 core CPU, 8Gb RAM, Digital ocean VPS
>            Reporter: Danila Evgrafov
>            Assignee: Unassigned
>            Severity: Major
>         Attachments: core-brief-2.txt, core-brief-3.txt, core-brief-5.txt, core-brief-6.txt, core-brief.txt, core-full-2.txt, core-full-3.txt, core-full-5.txt, core-full-6.txt, core-full.txt, core-info-2.txt, core-info-3.txt, core-info-5.txt, core-info-6.txt, core-info.txt, core-locks-2.txt, core-locks-3.txt, core-locks-5.txt, core-locks-6.txt, core-locks.txt, core-thread1-2.txt, core-thread1-3.txt, core-thread1-5.txt, core-thread1-6.txt, core-thread1.txt, debug_log_29604_5.txt, debug_log_29604_6.txt, debug_log_29604.txt
>
>
> Asterisk randomly crush when processing multiple calls on stasis app.
> I noticed that crushes occures more often when processing playbacks with long audio. But i am not sure if there is some relation.
> My ARI app creating outgoing calls. Crush seems to occure when many calls are answered at the same time and start playbacks. I don't know exact count of simultaneous calls, sometimes problem happens on 40 calls, sometimes on 100.
> Protocol: SIP
> Audio format: gsm
> Syslog:
> kernel: [1998361.116212] asterisk[18177]: segfault at 15c ip 0000000000511aef sp 00007fc593c1d480 error 4 in asterisk[400000+326000]
> When call answered:
> 1) app creates bridge1 and append called channel to it
> 2) app starts recording on bridge1
> 3) app creates bridge2
> 2) app creates snoop channel from called channel
> 3) app creates external media channel
> 4) app appends snoop and media channels to bridge2
> 5) app starts playback on bridge1



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



More information about the asterisk-bugs mailing list