<p> Attention is currently required from: N A. </p>
<p>Patch set 1:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4; color: #000000;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/18004">View Change</a></p><p>3 comments:</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/+/18004?tab=comments">Patch Set #1:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Not really sure, other than it only affects remote consoles because that's how the buggy logic was o […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">I was curious too so did some testing. As you say the bug would have to occur in an "if ast_opt_remote" block. Within the cli complete code there exists such a block so I surmised it might be happening there. See another comment, but it appears to be hanging on the read function within that block.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="null">File main/asterisk.c:</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/+/18004/comment/cd68851f_aed92f18">Patch Set #1, Line 2929:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;"> if (ast_opt_remote) {<br> /*<br> * This fixes the bug where if the last char typed in<br> * the CLI before pressing TAB or ? is a backslash,<br> * then we get stuck in an infinite loop on the call<br> * to read in this function. This only affects remote<br> * console, so if we encounter a terminating backslash,<br> * get rid of it for the command completion, so the<br> * behavior is the same as foreground console. */<br> char *c = (char*) lf->buffer + strlen(lf->buffer) - 1;<br> if (*c == '\\') {<br> *c = '\0';<br> }<br> }<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">I'm not entirely sure this is the correct fix for this. At the very least it'll require checking for more values as it also did the same thing for a quote. Each keyboard value should be tested to make sure they don't exhibit the same behavior.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/18004/comment/d713eb0c_f6990c9e">Patch Set #1, Line 2988:</a> <code style="font-family:monospace,monospace"> res = read(ast_consock, mbuf + mlen, 1024);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">After a bit of testing here is where the code hangs. The problem is not that the code is stuck in an infinite loop per se, but that "read" does not ever return.</p><p style="white-space: pre-wrap; word-wrap: break-word;">As to why it does not return when certain values are specified I am unsure. I think that needs to be figured first though as it may lead to a different, and perhaps more appropriate solution.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18004">change 18004</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/+/18004"/><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: I9810ac59304fec162da701653c9c834f0ec8f670 </div>
<div style="display:none"> Gerrit-Change-Number: 18004 </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-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Attention: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 25 Feb 2022 23:08:32 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: Yes </div>
<div style="display:none"> Comment-In-Reply-To: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Comment-In-Reply-To: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>