<div class="markdown_content"><p>Implicitly, comments on multiline input are disallowed in any commands sent via CWB/Perl (and in the cqp.php class, which follows it closely) - or, at least, they won't work. </p>
<p>CQP.pm line 440: <br/>
$cmd =~ s/\n+/ /g; # make sure there are no newline characters (to be on the safe side)</p>
<p>Unless I'm very much mistaken, this means that any query content that follows the first comment will become <em>part of</em> the first comment, almost certainly causing an error. </p>
<p>If the intent is for this <em>not</em> to happen, then probably that line should just go. (and same in CQPweb, etc etc.)</p>
<hr/>
<p><strong><a class="alink" href="https://sourceforge.net/p/cwb/bugs/82/">[bugs:#82]</a> CQP can hang without output when executing queries ending in a comment</strong></p>
<p><strong>Status:</strong> open<br/>
<strong>Group:</strong> TODO-3.5<br/>
<strong>Created:</strong> Mon Aug 03, 2026 01:51 PM UTC by Timm Weber<br/>
<strong>Last Updated:</strong> Tue Aug 04, 2026 06:20 PM UTC<br/>
<strong>Owner:</strong> nobody</p>
<p>Executing the following malformed query in CQP causes its prompt to hang without output: <code>[pos="JJ.?]? ("#?brexit"%c)</code> To get CQP out of this stuck state, the user has to input an additional <code>;\n</code> to get an error message.</p>
<p>This is unexpected behaviour and has the potential to break software using CQP in child process mode, since a deadlock situation arises (both cqp and the host program get stuck on reading stdin and stdout, respectively). See also <a href="https://github.com/ausgerechnet/cwb-ccc/issues/92" rel="nofollow">this issue</a> (and subsequent workaround) for cwb-cc.</p>
<p>The underlying issue seems to be that any query containing a <code>#</code> character outside a string hangs indefinitely, since CQP will treat the rest of the line following the hash symbol (including the <code>;</code> and newline) as a comment. Just executing <code>#</code> or <code>#;</code>is enough to replicate the issue and will also hang cqp in the same way.</p>
<p>Interestingly, this only seems to occur when not using input line editing (the <code>-e</code> flag), i.e. in cqp started without any flag or in child process mode.</p>
<hr/>
<p>Sent from sourceforge.net because cwb@sslmit.unibo.it is subscribed to <a href="https://sourceforge.net/p/cwb/bugs/">https://sourceforge.net/p/cwb/bugs/</a></p>
<p>To unsubscribe from further messages, a project admin can change settings at <a href="https://sourceforge.net/p/cwb/admin/bugs/options.">https://sourceforge.net/p/cwb/admin/bugs/options.</a> Or, if this is a mailing list, you can unsubscribe from the mailing list.</p></div>