[CWB] [cwb:bugs] #82 CQP can hang without output when executing queries ending in a comment
Andrew Hardie
andrewhardie at users.sourceforge.net
Tue Aug 25 16:15:28 CEST 2026
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.
CQP.pm line 440:
$cmd =~ s/\n+/ /g; # make sure there are no newline characters (to be on the safe side)
Unless I'm very much mistaken, this means that any query content that follows the first comment will become *part of* the first comment, almost certainly causing an error.
If the intent is for this *not* to happen, then probably that line should just go. (and same in CQPweb, etc etc.)
---
**[bugs:#82] CQP can hang without output when executing queries ending in a comment**
**Status:** open
**Group:** TODO-3.5
**Created:** Mon Aug 03, 2026 01:51 PM UTC by Timm Weber
**Last Updated:** Tue Aug 04, 2026 06:20 PM UTC
**Owner:** nobody
Executing the following malformed query in CQP causes its prompt to hang without output: `[pos="JJ.?]? ("#?brexit"%c)` To get CQP out of this stuck state, the user has to input an additional `;\n` to get an error message.
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 [this issue](https://github.com/ausgerechnet/cwb-ccc/issues/92) (and subsequent workaround) for cwb-cc.
The underlying issue seems to be that any query containing a `#` character outside a string hangs indefinitely, since CQP will treat the rest of the line following the hash symbol (including the `;` and newline) as a comment. Just executing `#` or `#;`is enough to replicate the issue and will also hang cqp in the same way.
Interestingly, this only seems to occur when not using input line editing (the `-e` flag), i.e. in cqp started without any flag or in child process mode.
---
Sent from sourceforge.net because cwb at sslmit.unibo.it is subscribed to https://sourceforge.net/p/cwb/bugs/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/cwb/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://liste.sslmit.unibo.it/pipermail/cwb/attachments/20260825/8bf9ea89/attachment.html>
More information about the CWB
mailing list