Kwic formatting in CQP ("cat" command) cuts off long lines after MAXKWICLEN bytes on each side of the match. This typically happens when context is set to a large text region (which may also have been created unintentionally through a markup/annotation error). CQP used to segfault in this cases, which has recently been changed to the more benign truncation behaviour. The current value of MAXKWICLINELEN is 64 KiB.
This issue will eventually be fixed by the long-awaited overhaul of the kwic formatting code. In the meantime, problems that are still encountered by some users could be alleviated with the following patch:
don't allocate char line[MAXKWICLINELEN + 1]; and char token[MAXKWICLINELEN + 1]; on the stack; make them dynamically allocated global buffers instead (compose_kwic_line() isn't reentrant anyway)
replace the #define MAXKWICLINELEN by a CQP option that can be controlled with "set kwiclinelen ..."; when the option is set, the global buffers are automatically reallocated
the option is initialised with MAXKWICLINELEN, and inital buffers of this size are allocated during startup
Power users will then be able to increase the kwic line length to an almost unlimited size.