[Asterisk-code-review] Core/PBX: Deadlock between dialplan execution and applicatio... (asterisk[13])

Frederic LE FOLL asteriskteam at digium.com
Wed Jun 14 11:30:05 CDT 2017


Hello Matthew Fredrickson, Richard Mudgett, Jenkins2, 

I'd like you to reexamine a change. Please visit

    https://gerrit.asterisk.org/5785

to look at the new patch set (#3).

Change subject: Core/PBX: Deadlock between dialplan execution and application unregistration.
......................................................................

Core/PBX: Deadlock between dialplan execution and application unregistration.

Not easy to reproduce, but we have noticed deadlocks when unloading a module
while dialplan is handling a request.

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.

As a protection, I suggest to modify ast_unregister_application(), so that it
anticipates the need of conlock, before taking the lock on apps list.
The side effect is a longer unavailability of conlock when unregistering an
application.

ASTERISK-27041

Change-Id: I0db0f1eb320da6a5758cce3a47d765be1face8e2
---
M main/pbx_app.c
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/85/5785/3
-- 
To view, visit https://gerrit.asterisk.org/5785
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I0db0f1eb320da6a5758cce3a47d765be1face8e2
Gerrit-Change-Number: 5785
Gerrit-PatchSet: 3
Gerrit-Owner: Frederic LE FOLL <frederic.lefoll at c-s.fr>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Matthew Fredrickson <creslin at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170614/693d1668/attachment.html>


More information about the asterisk-code-review mailing list