[asterisk-dev] [Code Review] 2756: Fix deadlocks in chan_sip in REFER and BYE handling

opticron reviewboard at asterisk.org
Mon Aug 12 16:11:45 CDT 2013



> On Aug. 12, 2013, 11:13 a.m., Mark Michelson wrote:
> > trunk/channels/chan_sip.c, lines 26405-26418
> > <https://reviewboard.asterisk.org/r/2756/diff/1/?file=43958#file43958line26405>
> >
> >     Like with your previous case, get a reference to p->owner before unlocking p.
> >     
> >     Since this is the exact same sequence as the previous case where the bridged peer is acquired, I think it should exist as its own function.
> >     
> >     Since this case also then uses the same deadlock avoidance technique in order to lock the bridged peer, I think the function you create should also try to return with all components (sip_pvt, sip_pvt's owner, bridged peer) locked.

It actually turns out that I need to remove the deadlock avoidance code altogether in favor of keeping both channels unlocked during those calls so the call could lock the channel itself after I found another deadlock condition.


- opticron


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


On Aug. 12, 2013, 10:51 a.m., opticron wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2756/
> -----------------------------------------------------------
> 
> (Updated Aug. 12, 2013, 10:51 a.m.)
> 
> 
> Review request for Asterisk Developers and Mark Michelson.
> 
> 
> Bugs: ASTERISK-22215
>     https://issues.asterisk.org/jira/browse/ASTERISK-22215
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> This resolves several deadlocks in chan_sip relating to usage of ast_channel_bridge_peer and improves accessibility of lock debugging function calls.
> 
> These issues were found while fixing the sip attended transfer integration tests for the referenced bug.
> 
> 
> Diffs
> -----
> 
>   trunk/channels/chan_sip.c 396504 
>   trunk/include/asterisk/lock.h 396504 
>   trunk/main/utils.c 396504 
> 
> Diff: https://reviewboard.asterisk.org/r/2756/diff/
> 
> 
> Testing
> -------
> 
> With these changes, chan_sip no longer stalls part of the way through the rewritten sip attended transfer tests on the REFER or at the end on the final BYE.
> 
> 
> Thanks,
> 
> opticron
> 
>

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


More information about the asterisk-dev mailing list