[asterisk-dev] [Code Review] Fix potential deadlock between masquerade and chan_local.

Mark Michelson reviewboard at asterisk.org
Mon Jun 4 10:30:19 CDT 2012


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

Ship it!


Go for it!


/branches/1.8/main/channel.c
<https://reviewboard.asterisk.org/r/1915/#comment11918>

    Hm, the comment says "original original's" but then the clonechan is hung up. Even if the wording on the comment was intentional, ast_do_masquerade() is the last place where confusing comments are needed.


- Mark


On May 11, 2012, 12:05 p.m., rmudgett wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1915/
> -----------------------------------------------------------
> 
> (Updated May 11, 2012, 12:05 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> ast_do_masquerade() calls ast_indicate() with the channel lock held.  This is a deadlock waiting to happen if the channel involved is a local channel.
> 
> * Restructure ast_do_masquerade() to not hold channel locks while it calls ast_indicate().
> 
> * Simplify many calls to ast_do_masquerade() since it will never return a failure now.  If it does fail internally because a channel driver callback operation failed, the only thing ast_do_masquerade() can do is generate a warning message about strange things may happen and press on.
> 
> * Fixed the call to ast_bridged_channel() in ast_do_masquerade().  This change fixes half of the deadlock reported in ASTERISK-19801 between masquerades and chan_iax.
> 
> 
> This addresses bugs ASTERISK-19537 and ASTERISK-19801.
>     https://issues.asterisk.org/jira/browse/ASTERISK-19537
>     https://issues.asterisk.org/jira/browse/ASTERISK-19801
> 
> 
> Diffs
> -----
> 
>   /branches/1.8/main/channel.c 366290 
> 
> Diff: https://reviewboard.asterisk.org/r/1915/diff
> 
> 
> Testing
> -------
> 
> A manual version of the yet to be written external test in ASTERISK-19807 passes.  I tested this patch with a call having a chain of 300 local channel pairs that optimize themselves out of the call.  It takes a minute for the local channels to get optimized out but once they are gone the call passes audio.
> 
> 
> Thanks,
> 
> rmudgett
> 
>

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


More information about the asterisk-dev mailing list