the order of options in the .ini file causes a crash
Versatile Commodore Emulator
Brought to you by:
blackystardust,
gpz
r42555 snapshot, GTK, Win7 x64
file created automatically, when loaded, causes a crash:
[Version]
ConfigVersion=3.6.2-dev
[C64SC]
KeymapIndex=1
KernalName="D:\Gry\_Commodore64\JiffyDOS_C64.bin"
KernalRev=-1
VICIIFilter=0
AutostartWarp=0
DriveSoundEmulation=1
DriveSoundEmulationVolume=226
Drive9Type=4844
DosName1541ii="D:\Gry\_Commodore64\JiffyDOS_1541-II.bin"
DosName1581="D:\Gry\_Commodore64\JiffyDOS_1581.bin"
DosNameCMDHD="D:\Gry\_Commodore64\bootromCMDHD-v2-80.bin"
rearranging the order of the options fixes the problem:
[Version]
ConfigVersion=3.6.2-dev
[C64SC]
KeymapIndex=1
KernalName="D:\Gry\_Commodore64\JiffyDOS_C64.bin"
DosName1541ii="D:\Gry\_Commodore64\JiffyDOS_1541-II.bin"
DosName1581="D:\Gry\_Commodore64\JiffyDOS_1581.bin"
DosNameCMDHD="D:\Gry\_Commodore64\bootromCMDHD-v2-80.bin"
KernalRev=-1
VICIIFilter=0
AutostartWarp=0
DriveSoundEmulation=1
DriveSoundEmulationVolume=226
Drive9Type=4844
although i know the order sometimes matters, i cannot confirm this.
works as expected. i copied your .ini and only changed the path.
Yes - unfortunately, setting a resourse can actually invoke setting specific code within VICE. So the order matters as some of the code in question doesn't cope with being called out of the expected order.
So if VICE created the file with broken ordering, the short term fix is likely to fix the order of the generated config output.
For comparison. The problem seems to be running CMD-HD emulation before loading the CMD-HD kernel.
Log fragment. Loading the created .ini
Program crashed:
Load rearranged settings, program works ok:
Last edit: radius75 2022-10-23
Does the emulator crash? or the emulated c64? If its the emulated c64, does a hard reset fix it?
Last edit: gpz 2022-10-23
Emulator crash
Urks, can you make a backtrace? I'd expect "does not work right" in cases like this - but it should never crash.
crash
Last edit: radius75 2022-10-23
An important point.
If I change the name from test.ini to vice.ini, the emulator starts correctly with this configuration. And it is impossible to cause a crash afterwards
Crash is when I run the emulator on default config and load test.ini
Last edit: radius75 2022-10-23
I can not reproduce this here (on Linux though) shrug
The problem occurs if it manually loads config.
If it is set to default (vice.ini) then the error does not occur when starting the emulator.
I checked on two Win7 x64 machines. Crash on both.
All I had to do was change the order of the options in .ini and no problem.
I am not able to test any more behaviors.
Departing from the topic.
The option to auto-mount .dhd image would be useful when emulating CMD-HD.
Last edit: radius75 2022-10-24
If you can share the .bin files referenced by the config, I can try and replicate the issue in a debugger
I sent a PM
Last edit: radius75 2022-10-24
Thanks - I've replicated the crash on macOS.
OldWoman37 - wondering if you could take a look at this?
If vice is launched normally, then a new config file is loaded using the menu, and if that config file is ordered like this:
rather than this:
Then VICE will crash inside the 65C02
BRK()
macro inside drivecpu65c02.c. Weirdly if VICE launches with that config at startup it doesn't crash. Additionally, if you launch normally, then load the working config above, then load the non-working config above, then it doesn't crash.When it crashs inside
BRK()
, thePUSH(reg_pc >> 8)
macro attempts((PAGE_ONE)[(reg_sp--)] = ((uint8_t)(reg_pc >> 8)))
, wherePAGE_ONE
iscpu->pageone
, which is NULL and the obvious happens from there.Sorry. I cannot replicate this error. Perhaps the problem was resolved by some other fix since it was reported.
I checked r43745.
The emulator still crashes.
It may be system specific. (Win7 and Win10 for me)
It's important that vice.ini contains default config (no cmdhd options entered)
And test.ini prepared as above described steps to cause a crash.
Fixed in r43791. Please verify.
Github builds stopped at r43787.
I'll test it as soon as a new one comes out.
There is no crash but this fix does not allow to load settings for HD disk from ini. Even though the config looks like this:
Emulation stays at default 1541.
Unless that's how this fix works
CMDHD can only be started from default vice.ini
only then will it be able to load from another ini
Last edit: radius75 2023-05-16
That doesnt sound like expected behaviour :)
In my humble opinion, the fix can be done in two ways:
change the order of settings when creating ini, then there will be no crash during loading (easier)
find the reason why loading vice.ini with CMDHD settings on program start doesn't crash, and set the same when manually loading settings. (harder)
This is all I can do. You will have the same problem with the command line options. You can't set the type to CMDHD until you have a valid ROM file. Once you do, then you can set they type.
So you will need to arrange the arguments in the proper order, or, make sure the CMDHD rom is in the default location.
There sadly isn't a way to fix this resource problem. Order is sometimes important.