[asterisk-bugs] [JIRA] (ASTERISK-30258) Dialing API: Cancel a running async thread, does not always cancel all calls

Frederic LE FOLL (JIRA) noreply at issues.asterisk.org
Thu Oct 6 11:30:09 CDT 2022


Frederic LE FOLL created ASTERISK-30258:
-------------------------------------------

             Summary: Dialing API: Cancel a running async thread, does not always cancel all calls
                 Key: ASTERISK-30258
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-30258
             Project: Asterisk
          Issue Type: Bug
      Security Level: None
          Components: Core/Dial
    Affects Versions: 18.8.0
            Reporter: Frederic LE FOLL


A race condition may occur in ast_dial_join() function (Dialing API: Cancel async thread), if caller cancels its call while a called party has just answered but has not yet started running its application.

This was detected with Page() application, calling approx 20 called parties with auto-answer, and caller almost immediately canceling its call (e.g. within 10 to 50 milliseconds).

Called party that has answered just before caller hangup:
- has not yet the is_running_app flag up, thus ast_dial_join() does not do Soft Hangup,
- but has left the waitfor loop, thus pthread_kill() does not have the expected effect.
Observation: when this race condition occurs for Page application, then :
- called parties (with one ast_dial_run() per called party) do not get cancelled, they start executing the application (ConfBridge for Page) and never get kicked out, because caller never got connected to ConfBridge,
- caller Channel gets stuck in ast_dial_join() because pthread_join(thread, NULL) never ends, except if all called called devices hangup.

This was seen with Asterisk 18.6 but it should be reproductible with other versions, since ast_dial_join() has not changed in recent versions.



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



More information about the asterisk-bugs mailing list