[asterisk-bugs] [JIRA] (ASTERISK-30035) ari: bridge addChannel race condition causes segfault

George Joseph (JIRA) noreply at issues.asterisk.org
Fri Apr 29 11:44:40 CDT 2022


     [ https://issues.asterisk.org/jira/browse/ASTERISK-30035?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

George Joseph updated ASTERISK-30035:
-------------------------------------

    Assignee: Richard Johnson  (was: Unassigned)
      Status: Waiting for Feedback  (was: Triage)

When I run your {{main.py}} I get...
{code}
python ./main.py
Bridges created ['1afc0775-6b09-4d6b-a5ff-57447cea2720', 'a3049cde-7f8d-46c2-9e62-6944e91fddfb', '0e72d1b8-da23-4df4-8f7a-af37c1afb199', '2262d21e-03c6-4aab-8225-7c0bfa3046c5']
Traceback (most recent call last):
  File "/usr/src/asterisk/debugging/ASTERISK/30035/./main.py", line 81, in <module>
    start()
  File "/usr/src/asterisk/debugging/ASTERISK/30035/./main.py", line 65, in start
    channels.append(resp_json["id"])
KeyError: 'id'
{code}

What other configuration is required?   pjsip.conf, extensions.conf, etc?


> ari: bridge addChannel race condition causes segfault
> -----------------------------------------------------
>
>                 Key: ASTERISK-30035
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-30035
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Applications/app_stasis, Resources/res_ari, Resources/res_ari_bridges
>    Affects Versions: 18.11.1, 18.11.2
>         Environment: linux debian buster
>            Reporter: Richard Johnson
>            Assignee: Richard Johnson
>            Severity: Major
>         Attachments: core-asterisk-2022-04-28T03-09-04Z-brief.txt, core-asterisk-2022-04-28T03-09-17Z-brief.txt, core-asterisk-2022-04-28T04-14-03Z-brief.txt, main.py
>
>
> There is a race condition when calling /bridges/xx/addChannel which results in asterisk crashing.
> Here is some example code to reproduce the issue:
> https://gist.github.com/rjohnsondev/babfd730d0076eb7c3404cd8c0c85d3d
> PJSUA was used as a quick client to test against: {{./pjsua-x86_64-unknown-linux-gnu --color --realm=\* --no-tcp --auto-answer=200 --max-calls=4}}
> The issue appears to be when https://github.com/asterisk/asterisk/blob/master/res/stasis/control.c#L1335 removes the bridge_features on the channel control while performing the swap in https://github.com/asterisk/asterisk/blob/master/res/ari/resource_bridges.c#L230
> If a secondary request to move the channel to a different bridge is received while this is happening, the bridge_features on the control for the channel will be NULL while attempting to update the features in https://github.com/asterisk/asterisk/blob/master/res/ari/resource_bridges.c#L222



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



More information about the asterisk-bugs mailing list