[asterisk-dev] [Code Review] 2946: Fix lock inversion between channels and bridges

opticron reviewboard at asterisk.org
Tue Oct 22 10:21:57 CDT 2013


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

Review request for Asterisk Developers.


Bugs: ASTERISK-22628
    https://issues.asterisk.org/jira/browse/ASTERISK-22628


Repository: Asterisk


Description
-------

This corrects two locking inversions between channels and bridges. The proper locking order is bridge -> bridge_channel -> channel.

The instance in ast_do_masquerade is easy enough to spot and fix.

The other instance involves framehooks which are always called with the channel locked and must not be unlocked, a native RTP bridge setup, and a chan_pjsip channel tech callback that attempts to lock a channel's associated bridge. Fortunately, it is not actually necessary to lock the bridge in question and reach across to find the bridged peer since a check to see if the associated bridge exists will do just as well.

This also cleans up some unnecessary locking in bridge_native_rtp.c.


Diffs
-----

  branches/12/bridges/bridge_native_rtp.c 401310 
  branches/12/channels/chan_pjsip.c 401310 
  branches/12/main/channel.c 401310 

Diff: https://reviewboard.asterisk.org/r/2946/diff/


Testing
-------

This resolves a deadlock that sometimes occurs when attempting to create a 4-way call via attended transfers.


Thanks,

opticron

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20131022/39791c11/attachment-0001.html>


More information about the asterisk-dev mailing list