[asterisk-dev] [Code Review]: BLF Subscriptions Causes SIP Deadlock

David Vossel reviewboard at asterisk.org
Fri Nov 4 12:48:56 CDT 2011



> On Nov. 4, 2011, 12:35 p.m., mjordan wrote:
> > trunk/channels/chan_sip.c, line 24933
> > <https://reviewboard.asterisk.org/r/1563/diff/2/?file=21625#file21625line24933>
> >
> >     Again, I'm confused why the sip_pvt needs to be unlocked / locked here, since add_peer_mwi_subs doesn't affect it.

add_peer_mwi_subs holds the global event lock when adding the subscription.  If we hold the sip_pvt lock during this operation we are establishing that the global event lock is held after the sip_pvt.

The mwi_event_cb callback function occurs with the global event lock held, but during this function the sip_pvt lock is held.  This would reverse the locking order if we did not unlock the sip_pvt when the event was being added.


- David


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


On Nov. 4, 2011, 11:16 a.m., opticron wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1563/
> -----------------------------------------------------------
> 
> (Updated Nov. 4, 2011, 11:16 a.m.)
> 
> 
> Review request for Asterisk Developers and David Vossel.
> 
> 
> Summary
> -------
> 
> Fix a locking inversion that causes deadlocks during BLF subscriptions.
> 
> 
> This addresses bug ASTERISK-18663.
>     https://issues.asterisk.org/jira/browse/ASTERISK-18663
> 
> 
> Diffs
> -----
> 
>   trunk/channels/chan_sip.c 342600 
> 
> Diff: https://reviewboard.asterisk.org/r/1563/diff
> 
> 
> Testing
> -------
> 
> Compile
> 
> 
> Thanks,
> 
> opticron
> 
>

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


More information about the asterisk-dev mailing list