[asterisk-dev] [Code Review] [patch] Use of MASTER_CHANNEL causes a race condition ending in a deadlock among channels

Russell Bryant reviewboard at asterisk.org
Fri Feb 25 16:50:36 CST 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1127/#review3222
-----------------------------------------------------------



/tags/1.8.3-rc2/channels/chan_sip.c
<https://reviewboard.asterisk.org/r/1127/#comment6698>

    You need to unref mchan after this.


- Russell


On 2011-02-25 13:40:19, Brett Bryant wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1127/
> -----------------------------------------------------------
> 
> (Updated 2011-02-25 13:40:19)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> Use of MASTER_CHANNEL in chan_sip causes pbx_setvar_helper to potentially lock a channel before iterating through the channel container to find the master channel. This violates locking order, and when two threads are doing this at the same time they can both end up in a deadlock holding the channel locks that the others are trying to acquire through the iterator.
> 
> 
> Diffs
> -----
> 
>   /tags/1.8.3-rc2/channels/chan_sip.c 308543 
> 
> Diff: https://reviewboard.asterisk.org/r/1127/diff
> 
> 
> Testing
> -------
> 
> Tested functionality of code and accuracy before and after change which removed the use of the MASTER_CHANNEL function.
> 
> 
> Thanks,
> 
> Brett
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20110225/d4c0d8d8/attachment.htm>


More information about the asterisk-dev mailing list