[asterisk-dev] [Code Review] Fix potential deadlock between masquerade and chan_local.
Mark Michelson
reviewboard at asterisk.org
Fri May 11 15:05:14 CDT 2012
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1915/#review6201
-----------------------------------------------------------
/branches/1.8/main/channel.c
<https://reviewboard.asterisk.org/r/1915/#comment11362>
s/indiction/indication/
/branches/1.8/main/channel.c
<https://reviewboard.asterisk.org/r/1915/#comment11363>
I'll admit I'm not 100% in it here, but it seems like it's possible to unref the clonechan too many times if clone_was_zombie.
- 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/20120511/95bd26a7/attachment-0001.htm>
More information about the asterisk-dev
mailing list