]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Core/PBX: Deadlock between dialplan execution and application unregistration.
authorFrederic LE FOLL <frederic.lefoll@c-s.fr>
Thu, 8 Jun 2017 17:28:12 +0000 (19:28 +0200)
committerFrederic LE FOLL <frederic.lefoll@c-s.fr>
Wed, 14 Jun 2017 16:29:40 +0000 (18:29 +0200)
commitdc307af7f2ed653914aeadb0b7e613cb4e239b06
tree0c4365fd4ee31ca59bf7f20185bf5efb526b0ac6
parent85dff8e26ee9bbe3ce781eefb9b1037e1fb9217a
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
main/pbx_app.c