Warning: text can disappear when using @language rest

40 views
Skip to first unread message

Edward K. Ream

unread,
Nov 14, 2024, 2:19:16 PM11/14/24
to leo-editor

Leo's colorizing machinery suffers from one of Leo's worst bugs in decades. The symptoms: text in LeoDocs.leo disappears. I don't yet know the exact circumstances that cause this disappearance.


I do know one node that suffered disappearing text:


    Theory of operation: c.deletePositionsInList


Here's why the bug is dangerous. All the text following the following sections disappeared.


**Completing the proof**

and

**Discussion


I was tempted to delete these "empty" sections. I would have lost data!


Summary


Do not delete apparently empty sections when @language rest is in effect. You may unwittingly lose data if you do.


My apologies for this mess. I'll fix this bug later today or tomorrow. I presume this bug stems from recent changes to leoColorizer.py or mode files.


Edward

Edward K. Ream

unread,
Nov 14, 2024, 5:08:55 PM11/14/24
to leo-editor
On Thursday, November 14, 2024 at 1:19:16 PM UTC-6 Edward K. Ream wrote:

Leo's colorizing machinery suffers from one of Leo's worst bugs in decades. The symptoms: text in LeoDocs.leo disappears. I don't yet know the exact circumstances that cause this disappearance.


I can now reproduce the bug reliably:

-  Select the previous node:
  The Leonine way to refactor code

- Move (via the mouse, keystroke or by finding "::") to the node:
  Theory of operation: c.deletePositionsInList

This is great news. There is no need for difficult sleuthing. I can see exactly what is happening.

I found this bug by pure luck. It could have caused mischief for who knows how long.

Edward

Edward K. Ream

unread,
Nov 14, 2024, 5:45:32 PM11/14/24
to leo-editor
On Thursday, November 14, 2024 at 4:08:55 PM UTC-6 Edward K. Ream wrote:

I can now reproduce the bug reliably:

Issue #4181 contains the details. I know how to get disappear, but the circumstances are odd.

Nevertheless, I am confident that I can crush this bug soon.

Edward

Edward K. Ream

unread,
Nov 15, 2024, 6:06:43 AM11/15/24
to leo-editor
On Thursday, November 14, 2024 at 4:45:32 PM UTC-6 Edward K. Ream wrote:

>> I can now reproduce the bug reliably: Issue #4181 contains the details.
> I am confident that I can crush this bug soon.

I am less confident now. This bug is one of the most mysterious I have ever encountered!


I have a candidate fix that is simpler and better on other grounds. Nevertheless, I still have no idea why the colorizer failed so spectacularly. I have only some conjectures.


I shall merge a new PR later today. That plan seems prudent. An early merge will cost us nothing:

- The PR is a step forward. The previous code is unacceptable.
- An early merge will allow us all to use (and test!) the fix immediately.

Summary

- I shall merge a new PR later today. There is no guarantee that this PR is rock solid.
- My investigations continue. A new ENB will discuss my conjectures and plans.
- The fix necessitates a revision to the Theory of Operation!

Edward

Thomas Passin

unread,
Nov 15, 2024, 7:02:59 AM11/15/24
to leo-editor
On Friday, November 15, 2024 at 6:06:43 AM UTC-5 Edward K. Ream wrote:
On Thursday, November 14, 2024 at 4:45:32 PM UTC-6 Edward K. Ream wrote:

>> I can now reproduce the bug reliably: Issue #4181 contains the details.
> I am confident that I can crush this bug soon.

I am less confident now. This bug is one of the most mysterious I have ever encountered!


I have a candidate fix that is simpler and better on other grounds. Nevertheless, I still have no idea why the colorizer failed so spectacularly. I have only some conjectures.


I shall merge a new PR later today. That plan seems prudent. An early merge will cost us nothing:

I was not able to reproduce this bug using yesterday's version of devel. You wrote that you encountered the bug in a private branch. After you do this merge, is this bug going to appear in devel? 

Edward K. Ream

unread,
Nov 15, 2024, 7:34:19 AM11/15/24
to leo-editor
On Friday, November 15, 2024 at 5:06:43 AM UTC-6 Edward K. Ream wrote:

Summary

- I shall merge a new PR later today. There is no guarantee that this PR is rock solid.
- My investigations continue. A new ENB will discuss my conjectures and plans.

I have just created PR #4182 for the emergency fix. It's a draft for now. I plan to merge this PR tonight or tomorrow.

Rather than writing an ENB, I have recorded my thoughts in the PR itself.

Edward

Edward K. Ream

unread,
Nov 15, 2024, 8:07:07 AM11/15/24
to leo-e...@googlegroups.com
On Fri, Nov 15, 2024 at 6:03 AM Thomas Passin <tbp1...@gmail.com> wrote:

> I was not able to reproduce this bug using yesterday's version of devel.

Issue #4181 now more clearly describes how to reproduce the bug.

> You wrote that you encountered the bug in a private branch.

I was seriously confused at first. I wasn't very clear about the sequence of events.

The bug undoubtedly exists. It happens reliably (in devel) if one knows how to make it happen.

I examined this bug for about 8 hours yesterday. I now know exactly when the bug happens, but I still do not understand why it happened or exactly why the PR makes it go away. To repeat:

- This is one of the most mysterious bugs in Leo's history.
- I have only conjectures about the bug's ultimate cause.
  See PR #4182 for my latest thoughts.

> After you do this merge, is this bug going to appear in devel?

No. It should disappear, subject to the caveats above.

Edward

Thomas Passin

unread,
Nov 15, 2024, 8:43:47 AM11/15/24
to leo-editor
On Friday, November 15, 2024 at 8:07:07 AM UTC-5 Edward K. Ream wrote:
On Fri, Nov 15, 2024 at 6:03 AM Thomas Passin <tbp1...@gmail.com> wrote:

> I was not able to reproduce this bug using yesterday's version of devel.

Issue #4181 now more clearly describes how to reproduce the bug.

I read that issue before trying to repro the bug. I saw text that looked right under both the headings " **Completing the proof**" and  "**Discussion**".  I suppose you did some additional action that wasn't written down in the steps in the Issue.
 
> You wrote that you encountered the bug in a private branch.

I was seriously confused at first. I wasn't very clear about the sequence of events.

The bug undoubtedly exists. It happens reliably (in devel) if one knows how to make it happen.

I examined this bug for about 8 hours yesterday. I now know exactly when the bug happens, but I still do not understand why it happened or exactly why the PR makes it go away. To repeat:

- This is one of the most mysterious bugs in Leo's history.

I wonder if you checked out a version of devel, or an earlier release branch, from before you started changing the colorizer, whether you would be able to trigger the same behavior using the same steps, now that you know how.  I'm not going to try that myself because I can't reproduce the behavior.

Edward K. Ream

unread,
Nov 15, 2024, 8:49:34 AM11/15/24
to leo-e...@googlegroups.com
On Fri, Nov 15, 2024 at 7:43 AM Thomas Passin <tbp1...@gmail.com> wrote:

>> This is one of the most mysterious bugs in Leo's history.
> I wonder if you checked out a version of devel, or an earlier release branch, from before you started changing the colorizer.

We'll never know. Happily, I'm now on top of the situation.

Edward
Reply all
Reply to author
Forward
0 new messages