Page 1 of 1

scilexer random error

Posted: 10 Dec 2021 18:09
by dominique f pannier
I use sciLexer in a dozen objects of a game application with various configurations. Everything works normally except that, from time to time, opens an error-type system window with the following informations:
title: assertion failure
text: C:\v\_vp\_Vip6\source\SciLexer\_src\src\PositionCache.cxx 372
The window has 3 buttons: Abandon Restart Ignore
I type ignore and the program continues without damage.
Is this an 'exception' behavior and do you know what I can do to manage it so that it remains transparent?

Re: scilexer random error

Posted: 25 Jan 2022 10:43
by Thomas Linder Puls
This issue must have slipped my attention.

The sciLexer is (as you may already know) a third party product that we more or less just build (few updates) and supply. The mentioned line is the first assertion (useCount == 0) in this code:

Code: Select all

void LineLayoutCache::AllocateForLevel(Sci::Line linesOnScreen, Sci::Line linesInDoc) {         PLATFORM_ASSERT(useCount == 0);         size_t lengthForLevel = 0;         if (level == llcCaret) {                 lengthForLevel = 1;         } else if (level == llcPage) {                 lengthForLevel = linesOnScreen + 1;         } else if (level == llcDocument) {                 lengthForLevel = linesInDoc;         }         if (lengthForLevel > cache.size()) {                 Deallocate();                 Allocate(lengthForLevel);         } else {                 if (lengthForLevel < cache.size()) {                         for (size_t i = lengthForLevel; i < cache.size(); i++) {                                 cache[i].reset();                         }                 }                 cache.resize(lengthForLevel);         }         PLATFORM_ASSERT(cache.size() == lengthForLevel); }
I do not know what it means and even less why it fails for you.

Furthermore, I am afraid that this kind of error reports are not exceptions in Visual Prolog sense: The dialog you see is displayed up by the C++ library software itself.

We will investigate if we can change the behavior, so that it becomes a Visual Prolog exception instead.

Re: scilexer random error

Posted: 2 Feb 2022 10:09
by dominique f pannier
Thank you for this answer, Thomas. I suspected it was not a prolog error, and then did not see how to "trap" it. It would be better if ity were possible. But I can add that its's random and fortunatly rare.
Best regards