<p> Attention is currently required from: Joshua Colp, Mark Murawski. </p>
<p><a href="https://gerrit.asterisk.org/c/asterisk/+/15893">View Change</a></p><p>1 comment:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="null">Patchset:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/15893?tab=comments">Patch Set #7:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">There isn't really a defined methodical way. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">I did some analysis and I don't think there is a locking risk presented.<br>When setting a variable, the channel lock is obtained. In the case of on a different channel, A will lock B's channel while it's setting the variable.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Now, suppose deadlock were to occur by A and B doing a simultaneous OTHER_CHANNEL write into each other's channels. If A started first, it would ref channel B and then lock it inside pbx_builtin_setvar_helper. Now suppose at this time, B wanted to set a variable on A's channel. This isn't problematic, because A never locks itself during execution, only the other channel (B). B is perfectly fine, therefore, to go ahead and lock any other channel, such as A or B. Doing so will not inhibit the first write in any way, so in no time at all, A will finish writing B and release B's lock.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Now suppose, hypothetically, that A were to lock itself as well as lock B during an OTHER_CHANNEL write. This would prevent B from writing to A because pbx_builtin_setvar_helper would block on getting A's channel lock. However, A is free to go ahead and finish its business and then release B's lock, and then release its own lock, so by the time B acquires A's lock, its own lock is also guaranteed to be free. (This isn't the current code model, the first case is, but this is just a hypothetical exercise).</p><p style="white-space: pre-wrap; word-wrap: break-word;">Not the most rigorous proof, but I think this reasoning shows to confirm the current behavior is safe?</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/15893">change 15893</a>. To unsubscribe, or for help writing mail filters, 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/c/asterisk/+/15893"/><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-Change-Id: I7492645ae4307553d0f586d78e13a4f586231fdf </div>
<div style="display:none"> Gerrit-Change-Number: 15893 </div>
<div style="display:none"> Gerrit-PatchSet: 7 </div>
<div style="display:none"> Gerrit-Owner: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <default.enum@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Mark Murawski <markm@intellasoft.net> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-CC: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Attention: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Attention: Mark Murawski <markm@intellasoft.net> </div>
<div style="display:none"> Gerrit-Comment-Date: Sat, 06 Aug 2022 20:14:39 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Comment-In-Reply-To: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Comment-In-Reply-To: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Comment-In-Reply-To: Mark Murawski <markm@intellasoft.net> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>