-
Notifications
You must be signed in to change notification settings - Fork 7
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
fvdi + nvdi5 + freemint leads to memory violation when calling v_opnvwk() #50
Comments
OK, at least this mystery has been solved: it's really important that it is NVDI 4.x that's installed. @wongck68 had been using NVDI 4.11 when the XaAES crashes started to occur and XaAES was booting just fine with NVDI 5: https://groups.google.com/g/aranym/c/iyeFnaoSMeU/m/goacblKtAgAJ. However he didn't want to use NVDI 5 ("NVDI 5 has issues with non-NVDI printer drivers") so that's why I kept focusing on the 4.11 and fixed that. If I tested NVDI 5 with the same setup, I would have seen the same QED crash for sure. I was able to replicate both scenarios:
So it's a NVDI5 issue specifically and it's not a regression of any kind. |
Not happening on TOS 4.04: same setup (an IDE image in fact) works with TOS 4.04 (QED starts), when ROM changed to EmuTOS (in aranym's config file), QED doesn't work again. |
Thanks to @czietz there has been some progress: this is not issue specific to EmuTOS. The reason why it doesn't crash in TOS 4.04 is that TOS, when booted in Aranym, it patched, i.e. all of its 030 MMU code is disabled, essentially booting Aranym without memory protection. As soon as one executes According to Christian's findings, fvdi crashes somewhere in https://github.com/freemint/fvdi/blob/master/fvdi/engine/utility.c. |
More precisely, the MEMORY VIOLATION crash occurs here:
This code sequence is within FVDI.PRG, but I did not investigate far enough to point to the exact line of code. |
With Christian's nudge I was able to uncover it a bit more as well. The crash happens exactly here: Line 782 in c19b1b0
As a proof see my custom-compiled fvdi.prg with debug symbols:
Some context:
Registers immediately before crash:
I'm not sure what's the deal with those I put some debug outputs into around
and there is no |
fVDI documentation states:
Then there is
nvdifix
infvdi.sys
which somehow tries to move NVDI in the trap chain so it's not first:but its description is not very encouraging:
FreeMiNT's
INSTALL
file says:So this would imply that the best supported combination of those three is:
booted
set andnvdifix
not set)However this means that both NVDI and FVDI are outside of FreeMiNT's control. If I understand it correctly, they even use TOS supervisor stack (right?) and are not listed as separate processes. This seems to create a strange issue.
Repro steps:
Now start QED (/opt/GEM/qed/qed.app). Depending on the actual setup, sometimes it runs at the first time. Quit it. Run again. It wont run again. Sometimes it wouldn't run even on the first try, sometimes TosWin2 wouldn't run.
If started from TosWin2, one can see a simple "Bus error" message. When mint.prg compiled with debug infos, one can see in Aranym's console:
When looking where exactly it crashes, it goes all the way to gemlib's
v_opnvwk
. It wouldn't return from the trap. FreeMiNT's trap 2 handler is not even called in this case (i.e. it's not a bug related to freemint), fVDI'sfvdi/fvdi/engine/workstn.c
Line 167 in c19b1b0
seems to successfully enter and exit so it must be crashing somewhere in NVDI's trap handler. It seems to depend also on the resolution, if I set
fvdi.sys
with 640x480x8, it doesn't crash, if 640x480x16, it does.It's very hard to debug as I can't find a way to reproduce this with anything else than aranym.sys.
Strangely, when following https://atari-forum.com/viewtopic.php?p=247471#p247471, i.e. all the possible recommendations thrown away:
nvdifix
enabledPrinting and vector fonts not only work but also the crashing
v_opnvwk
is gone.Could be the issue caused by a stack overflow in NVDI.PRG ? Symptoms seems to be very similar to freemint/freemint#269 however when I started investigating this one, I had the 'wrong' setup (NVDI.PRG after MINT.PRG, FVDI.PRG in
mint.cnf
withnvdifix
enabled) so the stack was wrong on a different place. Ironically, after fixing that I tried also the correct setup and everything seemed to work: https://atari-forum.com/viewtopic.php?p=435414#p435414 ... so the problem can be easily hidden as it seems.The text was updated successfully, but these errors were encountered: