<div class="markdown_content"><ul>
<li><strong>status</strong>: open --&gt; closed-fixed</li>
</ul>
<hr />
<p><strong> <a class="alink strikethrough" href="http://sourceforge.net/p/cwb/bugs/61/">[bugs:#61]</a> CQP kwic formatting cuts off long lines</strong></p>
<p><strong>Status:</strong> closed-fixed<br />
<strong>Group:</strong> TODO-3.5<br />
<strong>Labels:</strong> CQP <br />
<strong>Created:</strong> Mon Jun 09, 2014 02:46 PM UTC by Stefan Evert<br />
<strong>Last Updated:</strong> Mon Jun 09, 2014 02:46 PM UTC<br />
<strong>Owner:</strong> Stefan Evert</p>
<p>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.</p>
<p>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:</p>
<ul>
<li>
<p>don't allocate char line<span>[MAXKWICLINELEN + 1]</span>; and char token<span>[MAXKWICLINELEN + 1]</span>; on the stack; make them dynamically allocated global buffers instead (compose_kwic_line() isn't reentrant anyway)</p>
</li>
<li>
<p>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</p>
</li>
<li>
<p>the option is initialised with MAXKWICLINELEN, and inital buffers of this size are allocated during startup</p>
</li>
</ul>
<p>Power users will then be able to increase the kwic line length to an almost unlimited size. </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>