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

Mark Michelson reviewboard at asterisk.org
Mon Aug 12 11:13:55 CDT 2013


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



trunk/channels/chan_sip.c
<https://reviewboard.asterisk.org/r/2756/#comment18453>

    Grab a reference to transferer->owner before unlocking transferer. This way, you can guarantee not to pass an invalid pointer into ast_channel_bridge_peer().



trunk/channels/chan_sip.c
<https://reviewboard.asterisk.org/r/2756/#comment18455>

    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.


- Mark Michelson


On Aug. 12, 2013, 3:51 p.m., opticron wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2756/
> -----------------------------------------------------------
> 
> (Updated Aug. 12, 2013, 3:51 p.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/ad68eb02/attachment-0001.htm>


More information about the asterisk-dev mailing list