<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/9096">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Richard Mudgett: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">bridge_channel.c: Fix Deadlock when using Local channels and fax gateway<br><br>ast_indicate is invoked with the bridge locked. As ast_indicate locks the<br>other end of the bridge as well this can lead to a deadlock in some situations.<br>(Especially when a different thread does the same in the reverse order).<br>This patch calls ast_indicate after unlocking the bridge which fixes the<br>deadlock. Calling ast_indicate with these parameters without locking the<br>bridge should be safe as this is done at different places without a<br>bridge lock.<br><br>ASTERISK-27094 #close<br>Reported-by: David Brillert<br><br>Change-Id: I5f86c1e2ce75b9929a36ab589b18c450e62ea35f<br>---<br>M main/bridge_channel.c<br>1 file changed, 6 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/bridge_channel.c b/main/bridge_channel.c<br>index eb4b9ad..7d7d26a 100644<br>--- a/main/bridge_channel.c<br>+++ b/main/bridge_channel.c<br>@@ -2820,6 +2820,7 @@<br> int bridge_channel_internal_join(struct ast_bridge_channel *bridge_channel)<br> {<br> int res = 0;<br>+ uint8_t indicate_src_change = 0;<br> struct ast_bridge_features *channel_features;<br> struct ast_channel *swap;<br> <br>@@ -2889,7 +2890,7 @@<br> */<br> if (!(bridge_channel->bridge->technology->capabilities<br> & AST_BRIDGE_CAPABILITY_MULTIMIX)) {<br>- ast_indicate(bridge_channel->chan, AST_CONTROL_SRCCHANGE);<br>+ indicate_src_change = 1;<br> }<br> <br> bridge_channel_impart_signal(bridge_channel->chan);<br>@@ -2899,6 +2900,10 @@<br> ao2_t_cleanup(swap, "Bridge push with swap successful");<br> swap = NULL;<br> <br>+ if (indicate_src_change) {<br>+ ast_indicate(bridge_channel->chan, AST_CONTROL_SRCCHANGE);<br>+ }<br>+<br> bridge_channel_event_join_leave(bridge_channel, AST_BRIDGE_HOOK_TYPE_JOIN);<br> <br> while (bridge_channel->state == BRIDGE_CHANNEL_STATE_WAIT) {<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/9096">change 9096</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/9096"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I5f86c1e2ce75b9929a36ab589b18c450e62ea35f </div>
<div style="display:none"> Gerrit-Change-Number: 9096 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Pirmin Walthert <infos@nappsoft.ch> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>