[asterisk-bugs] [JIRA] (ASTERISK-27041) [patch] Deadlock between dialplan execution and application unregistration

Asterisk Team (JIRA) noreply at issues.asterisk.org
Thu Jun 8 04:48:57 CDT 2017


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

Asterisk Team commented on ASTERISK-27041:
------------------------------------------

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

> [patch] Deadlock between dialplan execution and application unregistration
> --------------------------------------------------------------------------
>
>                 Key: ASTERISK-27041
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-27041
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Core/PBX
>    Affects Versions: 13.13.0
>         Environment: Gentoo
>            Reporter: Frederic LE FOLL
>
> Not easy to reproduce, but we have noticed deadlocks when unloading a module while dialplan is handling a request.
> This is a variation of deadlocks problems described in Asterisk wiki https://wiki.asterisk.org/wiki/display/AST/Locking+in+Asterisk.
> The deadlock is between :
> 1) Dialplan execution: pbx_extension_helper() first taking conlock, then pbx_findapp() [when called] asking for lock on apps list.
> 2) Application unregistration: ast_unregister_application() first taking lock on apps list, then unreference_cached_app() [when called] asking for conlock.
> Not easy to reproduce, but we had several of these deadlocks. I will attach a file with the analysis of two coredumps that we forced after a deadlock.
> Why unregistering an application while running asterisk? In our case, this is because of a module unload / module load in order to take in account new configuration parameters for a module.
> The problem was detected with Asterisk 13.13 but most probably affects older and newer versions, since this portion of code in main/pbx.c and main/pbx_app.c has not changed very much since Asterisk 13.0 (and possibly older versions).
> As a protection, I suggest to modify ast_unregister_application(), so that it anticipated the need of conlock, before taking the lock on apps list. The side effect is a longer unavailability of conlock when unregistering an application. I will attach a patch file for pbx_app.c



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



More information about the asterisk-bugs mailing list