[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:17:50 CEST 2026


Update: can confirm that in BNCweb, the following query
"elephant"%c             # coment comment comment
"and"%c
"castle%c

... evaluates as if it was just "elephant"%c


---

**[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 25, 2026 02:15 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/05986f36/attachment-0001.html>


More information about the CWB mailing list