New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Leo crashes with unusual combination of @clean and .leo file #289
Comments
I said earlier that this was an interesting, worthy, bug. Here are the reasons: Point 1: This bug doesn't happen with
That is, the section reference gets transferred to a new line. The so-called "new" sentinel scheme does not use Point 2: Things are even more "interesting" with In short, there is a hidden boundary condition of both Point 3: The proximate cause of the crash lies elsewhere, namely an assertion that fails in the changeLevel method:
A possible fix is simply to do this:
The corresponding code makes no real sense to me. I have no memory of the code or why it is written the way it was. I can deduce the the code is the way it is because the new Happily, the clone-find commands (combined with traces) will likely show what is happening. It's possible that the code can be improved. We shall see. Point 4. There is no way that I shall ever change the Mulder-Ream update algorithm to allow section references to be "embedded" in a line. This would require the worst kind of "if" statements to sully the algorithm. I would no more tolerate such "if" statements in the Summary The quick fix will be to replace the failing assert by code that guarantees the condition being asserted. Whether this a proper fix in all cases remains to be seen. I'll be studying the code closely to find out. This bug has revealed some hidden, minor, limitations in section references in both |
More work is needed to see if the change makes sense in all cases. All tests pass.
Rev 014b763 makes the change discussed above. I'll leave this issue open until I study the code further and document what I find here. |
If |
@jurov I agree, something should be done. I'm surprised at the present behavior, which happens even with @file, so the @clean update algorithm is not (entirely) to blame. I suspect that Leo handled section references differently (and better) with old-style sentinels, but the advantages of new-style sentinels far outweigh the problem under discussion. The workaround is to do, for example, something like:
which does indeed work properly, with both @file and @clean, as I have just verified. I agree that some warning would be good. I'll look into it. |
I am going to split this issue into two parts:
I'll close this issue and create another asking for warnings. |
Reported by Laurent Steffan, lmsteffan@gmail.com
Given this external file:
And this .leo file:
Let me make this clearer: the original body text of the top-level node is:
Leo crashes with the message "AssertionError: newLevel == oldLevel + 1" generated in at.changeLevel.
This is an interesting, worthy, bug, not necessarily because it will be hard to fix, but because it reveals some interesting edge cases with @clean (and @shadow) and also the new (v5) sentinels. I'll fix this asap, after discussing the details.
The text was updated successfully, but these errors were encountered: