<p>N A has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/18522">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">loader: Prevent deadlock using tab completion.<br><br>If tab completion using ast_module_helper is attempted<br>during startup, deadlock will ensue because the CLI<br>will attempt to lock the module list while it is already<br>locked by the loader. This causes deadlock because when<br>the loader tries to acquire the CLI lock, they are blocked<br>on each other.<br><br>Waiting for startup to complete is not feasible because<br>the CLI lock is acquired while waiting, so deadlock will<br>ensure regardless of whether or not a lock on the module<br>list is attempted.<br><br>To prevent deadlock, we immediately abort if tab completion<br>is attempted on the module list.<br><br>ASTERISK-30039 #close<br><br>Change-Id: Idd468906c512bb196631e366a8f597a0e2e9271d<br>---<br>M main/loader.c<br>1 file changed, 5 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/22/18522/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/main/loader.c b/main/loader.c</span><br><span>index aafcd3b..8c664e2 100644</span><br><span>--- a/main/loader.c</span><br><span>+++ b/main/loader.c</span><br><span>@@ -1382,6 +1382,11 @@</span><br><span> return NULL;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ /* Tab completion can't be used during startup, or CLI and loader will deadlock. */</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!ast_test_flag(&ast_options, AST_OPT_FLAG_FULLY_BOOTED)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ return NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> if (type == AST_MODULE_HELPER_LOAD) {</span><br><span> module_load_helper(word);</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18522">change 18522</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/+/18522"/><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: Idd468906c512bb196631e366a8f597a0e2e9271d </div>
<div style="display:none"> Gerrit-Change-Number: 18522 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>