|
Post by George on May 30, 2022 21:31:42 GMT -5
Robert: Sheesh! doing a swap with ranges across Excluded line blocks!
You got what you deserved.
No, not really. I'm sure it's just not checking for the X marker and trying to swap columns in the X marker itself. Not sure, but that line sure doesn't have a normal data line structure.
George
|
|
|
Post by George on May 31, 2022 11:02:29 GMT -5
Not back till Friday, just checking in.
|
|
|
Post by George on Jun 4, 2022 14:50:51 GMT -5
Robert: This is a real nasty one. I cannot get a consistent failure, when I get one that crashes 50% of the time, I cannot get a debug trap of any kind to catch it. Sometimes, when trying to get it to fail, everything works perfectly, and then while I sit there looking puzzled, the window just 'goes away'. No crash, no messages, nothing - just gone.
So, I think, it has to be (SWAP) code. I've gone through it carefully and re-wrote a couple lines that were coded oddly. Sort of, that should work, it obviously works most of the time, but ... so I replaced the lines.
And now I can't break it. Also, I can't prove it's fixed either.
So I'm going to post a beta and let you try it out. Fingers crossed. This is a classic "someone's tiptoeing through memory corruption style problem" where the location of the crash has nothing to do with the true cause of the corruption.
George
|
|
|
Post by George on Jun 7, 2022 9:00:15 GMT -5
Robert: Have you been able to test this?
George
|
|
|
Post by George on Jun 7, 2022 11:47:39 GMT -5
Hmmm, too bad. This is going to be a really tough one if I can't catch the true culprit.
George
|
|
|
Post by George on Jun 7, 2022 14:39:45 GMT -5
Robert: The crash is memory corruption, there is no logic to anything you see. And no clues to help debug either. ;-((
And if I don't find a simple, repeatable crash scenario, this will never get fixed, reviewing code just won't find it.
George
|
|
|
Post by George on Jun 8, 2022 10:03:40 GMT -5
Robert: The PT and normal code are quite different, but I did check. All looked fine.
I think I have found it (at least I can't crash it) - but you're better than I am at triggering crashes.
It's all involved in handling our atrribute storage (for themes, hi-lites etc.) All text manipulation routines have to perform duplicate changes to the attribute line, which is an equal length WSTRING. The WSTRING is not used as character data, but as a 16 bit word of bit flags. What I missed was that when lengthening the attribute line, using an LSET$ function, you have to remember to specify USING CHR$$(0) since we don't want the line extended with the WSTRING default of Unicode " " - we want a binary zero, not x'0020'
Posting another Beta for you to try. (22159) Fingers crossed.
George
|
|
|
Post by George on Jun 8, 2022 12:31:42 GMT -5
So you can get a crash just by opening a file? In a brand new instance, or in one where previous testing was done (successful or not).
i.e. a brand new session, load a file, and it crashes with no activity?
George
|
|
|
Post by George on Jun 8, 2022 13:44:16 GMT -5
I've been playing as well, and it SEEMS (so far) to be the X'd lines. If I play with all lines visible, it works fine, exclude some lines and something goes bonkers. It works sometimes, it seems, but the corruption has happened and a crash, somewhere appears inevitable.
Frustrating, as I still can't catch the actual error, as you've seen, it just disappears! So much for debug tools.
George
|
|
|
Post by George on Jun 8, 2022 14:20:12 GMT -5
Robert: OK, I'm done here. I've made exactly zero progress and I'm out of ideas. The crash is so inconsistent that even adding breadcrumb messages doesn't help because it doesn't even crash consistently.
Watching the window just close and disappear is just soooo frustrating.
George
|
|
|
Post by George on Jun 8, 2022 14:24:39 GMT -5
Robert: Just saw your last message. At least in the 'old days' even with high-level compilers you always got a PSW you could map back to a localized piece of code. With stuff nowadays, you get nothing, or an address that's meaningless because you have no storage map.
And what I have is even worse, I get absolutely nothing, the window just disappears, I don't even get the Windows crash message.
George
|
|
|
Post by George on Jun 8, 2022 15:52:39 GMT -5
You're talking a major investment in writing a debugging support tool, call it instrumenting, call it whatever you like, it's a major piece of work. And this is not the time to re-invent the wheel.
I can write 'tracepoints' right now very simply, it's just inserting - DEBUG "A string", where string can be fixed text and/or variable displays. I've been using this heavily to try and 'zero in' on where it's failing, so I've got that kind of tool already. I call it 'dropping breadcrumbs'.
I think your expectations of what tracepoints can do to help is more than a bit over rated.
The problem here is that the failure occurs when END is triggered, and that means a very long trail of functions to do with shutting down a tab, switching back to FM and refreshing the FM display. It's a long involved trail, and with this being a memory corruption problem, the failure in that long trail is not even consistent, sometimes it fails early, sometimes it runs right through perfectly.
I know how to debug, this is simply not normal debugging.
George
|
|
|
Post by mueh on Jun 9, 2022 2:25:56 GMT -5
George: Maybe a hint to this problem is that if multiple lines are marked the SWAP Data is incorrect . No problem if you mark a single line . Here with 22159 Version . As you can see there is now "" at col 102 (" not at col 46) with multiple lines marked and swap to col 1 . Attachments:
|
|
|
Post by George on Jun 9, 2022 10:03:59 GMT -5
MUEH: Good catch, some length calc is obviously off. I don't think it's crash related, but still has to be corrected.
George
|
|
|
Post by George on Jun 9, 2022 10:37:14 GMT -5
Robert: So writing a program to scan source code (and all INCLUDED files) to spot all code blocks, insert special comment lines, then another program to scan again and convert comments into actual debug code calls, then a third program to scan the output debug log after a test run is not to be considered a 'major effort'? What world are you in?
And all that will do, at best, is only point me at a particular SUB/FUNCTION/METHOD. Unless of course the 1st program is going to analyze actual code and spot FOR/NEXT loops, DO LOOPS, SELECT CASE etc. so it can insert more detailed insertion markers. Or was it going to insert insertion points at every code line?
If we were back at square one in development, then maybe this might have been a valid approach, and maybe could have helped over the years. But now?
I'm better off using the DEBUG "xxxx" breadcrumbs, at least I know the logic flow and can insert them at points that make sense rather than inserting them everywhere and then looking at a flood of entries hoping to 'catch it in the act'.
George
|
|