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

rmudgett reviewboard at asterisk.org
Fri May 11 12:05:43 CDT 2012


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

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/04cc47ff/attachment.htm>


More information about the asterisk-dev mailing list