[Asterisk-code-review] sig_pri: Fix deadlock caused by sig_pri_queue_hangup (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Mon Jan 6 14:51:00 CST 2020


Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/13505 )

Change subject: sig_pri:  Fix deadlock caused by sig_pri_queue_hangup
......................................................................


Patch Set 1: Code-Review-1

(1 comment)

https://gerrit.asterisk.org/c/asterisk/+/13505/1/channels/sig_pri.c 
File channels/sig_pri.c:

https://gerrit.asterisk.org/c/asterisk/+/13505/1/channels/sig_pri.c@1407 
PS1, Line 1407: 		ast_set_hangupsource(owner, ast_channel_name(owner), 0);
You cannot call ast_set_hangupsource() with the channel lock held because it needs to get the channel's bridge lock.  To fix, you need to revert the current changes in the patch.  Then unlock and re-lock the pri->lock as below.

sig_pri_unlock_private(pri->pvts[chanpos]);
ast_mutex_unlock(&pri->lock);
ast_set_hangup_source(owner, ast_channel_name(owner), 0);
ast_mutex_loc(&pri->lock);
sig_pri_lock_private(pri->pvts[chanpos]);

Also you'll need to update the commit message to reflect the change. 😊

I keep forgetting that sig_pri_lock_owner() also releases the pri->lock to avoid deadlock.



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/13505
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: Id74aaa5d4e3746063dbe9deed188eb65193cb9c9
Gerrit-Change-Number: 13505
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Frederic LE FOLL <frederic.lefoll at c-s.fr>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Mon, 06 Jan 2020 20:51:00 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200106/46d4e309/attachment.html>


More information about the asterisk-code-review mailing list