Menu

#1775 the order of options in the .ini file causes a crash

v3.6
open-need-info
None
Drives
2023-05-31
2022-10-23
radius75
No

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

Discussion

1 2 > >> (Page 1 of 2)
  • Querino

    Querino - 2022-10-23

    although i know the order sometimes matters, i cannot confirm this.

    [Version]
    ConfigVersion=3.6.2-dev
    
    [C64SC]
    KeymapIndex=1
    KernalName="jiff\JiffyDOS_C64.bin"
    KernalRev=-1
    VICIIFilter=0
    AutostartWarp=0
    DriveSoundEmulation=1
    DriveSoundEmulationVolume=226
    Drive9Type=4844
    DosName1541ii="jiff\JiffyDOS_1541-II.bin"
    DosName1581="jiff\JiffyDOS_1581.bin"
    DosNameCMDHD="jiff\bootromCMDHD-v2-80.bin"
    

    works as expected. i copied your .ini and only changed the path.

     
  • dqh

    dqh - 2022-10-23

    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.

     
  • radius75

    radius75 - 2022-10-23

    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:

    VIC-II: VSP Bug: safe channels are: 457. Emulation of memory corruption is disabled.
    VIC-II: VSP Bug: safe channels are: 3. Emulation of memory corruption is disabled.
    Loading keymap `D:\Gry\_Commodore64\GTK3VICE-3.6.2-dev-win64-r42555\bin\..\C64\gtk3_pos.vkm'.
    Loading keymap `D:\Gry\_Commodore64\GTK3VICE-3.6.2-dev-win64-r42555\bin\..\C64\gtk3_sym.vkm'.
    Loading keymap `D:\Gry\_Commodore64\GTK3VICE-3.6.2-dev-win64-r42555\bin\..\C64\gtk3_sym.vkm'.
    VIC-II: VSP Bug: safe channels are: 013467. Emulation of memory corruption is disabled.
    Reading configuration file `F:\Users\Robert\AppData\Roaming\vice\CMD-HD+JiffyDos22222.ini'.
    Loading keymap `D:\Gry\_Commodore64\GTK3VICE-3.6.2-dev-win64-r42555\bin\..\C64\gtk3_pos.vkm'.
    Loading system file `D:\Gry\_Commodore64\JiffyDOS_C64.bin'.
    VIC-II: VSP Bug: safe channels are: 0234567. Emulation of memory corruption is disabled.
    Loading system file `D:\Gry\_Commodore64\JiffyDOS_1541-II.bin'.
    Loading system file `D:\Gry\_Commodore64\JiffyDOS_1581.bin'.
    Loading system file `D:\Gry\_Commodore64\bootromCMDHD-v2-80.bin'.
    Warning - ROM `D:\Gry\_Commodore64\bootromCMDHD-v2-80.bin': long file, discarding end.
    Sync reset
    Main CPU: RESET.
    Sound: Closing device `dx'
    Sound: Opened device `dx', speed 48000Hz, fragment size 2.67ms, buffer size 32.00ms
    reSID: MOS8580, filter on, sampling rate 48000Hz - resampling, pass to 21600Hz
    Sync reset
    Unit 8: RESET.
    Unit 9: RESET.
    

    Load rearranged settings, program works ok:

    VIC-II: VSP Bug: safe channels are: 01457. Emulation of memory corruption is disabled.
    VIC-II: VSP Bug: safe channels are: 1567. Emulation of memory corruption is disabled.
    Loading keymap `D:\Gry\_Commodore64\GTK3VICE-3.6.2-dev-win64-r42555\bin\..\C64\gtk3_pos.vkm'.
    Loading keymap `D:\Gry\_Commodore64\GTK3VICE-3.6.2-dev-win64-r42555\bin\..\C64\gtk3_sym.vkm'.
    Loading keymap `D:\Gry\_Commodore64\GTK3VICE-3.6.2-dev-win64-r42555\bin\..\C64\gtk3_sym.vkm'.
    VIC-II: VSP Bug: safe channels are: 12346. Emulation of memory corruption is disabled.
    Reading configuration file `F:\Users\Robert\AppData\Roaming\vice\CMD-HD+JiffyDos.ini'.
    Loading keymap `D:\Gry\_Commodore64\GTK3VICE-3.6.2-dev-win64-r42555\bin\..\C64\gtk3_pos.vkm'.
    Loading system file `D:\Gry\_Commodore64\JiffyDOS_C64.bin'.
    VIC-II: VSP Bug: safe channels are: 026. Emulation of memory corruption is disabled.
    Loading system file `D:\Gry\_Commodore64\JiffyDOS_1541-II.bin'.
    Loading system file `D:\Gry\_Commodore64\JiffyDOS_1581.bin'.
    Loading system file `D:\Gry\_Commodore64\bootromCMDHD-v2-80.bin'.
    Warning - ROM `D:\Gry\_Commodore64\bootromCMDHD-v2-80.bin': long file, discarding end.
    Sync reset
    Main CPU: RESET.
    Sound: Closing device `dx'
    Sound: Opened device `dx', speed 48000Hz, fragment size 2.67ms, buffer size 32.00ms
    reSID: MOS8580, filter on, sampling rate 48000Hz - resampling, pass to 21600Hz
    Sync reset
    Unit 8: RESET.
    Unit 9: RESET.
    SCSI: no image attached to disk 0; expect unusual results and/or hangs
    
     

    Last edit: radius75 2022-10-23
  • gpz

    gpz - 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
  • radius75

    radius75 - 2022-10-23

    Emulator crash

     
  • gpz

    gpz - 2022-10-23

    Urks, can you make a backtrace? I'd expect "does not work right" in cases like this - but it should never crash.

     
  • radius75

    radius75 - 2022-10-23
    • run vice
    • restore default settnings
    • settings/machine/rom - set cmdhd bootrom v280
    • settings/peripheral devices/drive/drive9 - model cmd-hd
    • save settings to.. test.ini
    • close emulator
    • run vice
    • load settings from.. test.ini
      crash
    [Version]
    ConfigVersion=3.6.2-dev
    
    [C64SC]
    Drive9Type=4844
    DosNameCMDHD="D:\Gry\_Commodore64\CMD HD\CMD HD BOOTROM v280.bin"
    
     

    Last edit: radius75 2022-10-23
  • radius75

    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
  • gpz

    gpz - 2022-10-23

    I can not reproduce this here (on Linux though) shrug

     
  • radius75

    radius75 - 2022-10-24

    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.

    [Version]
    ConfigVersion=3.6.2-dev
    
    [C64SC]
    DosNameCMDHD="D:\Gry\_Commodore64\CMD HD\CMD HD BOOTROM v280.bin"
    Drive9Type=4844
    

    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
    • dqh

      dqh - 2022-10-24

      If you can share the .bin files referenced by the config, I can try and replicate the issue in a debugger

       
      • radius75

        radius75 - 2022-10-24

        I sent a PM

         

        Last edit: radius75 2022-10-24
        • dqh

          dqh - 2022-10-25

          Thanks - I've replicated the crash on macOS.

           
          👍
          1
  • dqh

    dqh - 2022-10-25
    • assigned_to: Roberto Muscedere
     
  • dqh

    dqh - 2022-10-25

    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:

    [C64SC]
    Drive9Type=4844
    DosNameCMDHD="D:\Gry\_Commodore64\bootromCMDHD-v2-80.bin"
    

    rather than this:

    [C64SC]
    DosNameCMDHD="D:\Gry\_Commodore64\bootromCMDHD-v2-80.bin"
    Drive9Type=4844
    

    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(), the PUSH(reg_pc >> 8) macro attempts ((PAGE_ONE)[(reg_sp--)] = ((uint8_t)(reg_pc >> 8))), where PAGE_ONE is cpu->pageone, which is NULL and the obvious happens from there.

     
  • gpz

    gpz - 2023-03-26
    • Category: --> Drives
     
  • Roberto Muscedere

    Sorry. I cannot replicate this error. Perhaps the problem was resolved by some other fix since it was reported.

     
    • radius75

      radius75 - 2023-05-04

      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.

       
  • Roberto Muscedere

    Fixed in r43791. Please verify.

     
    👍
    1
    • radius75

      radius75 - 2023-05-16

      Github builds stopped at r43787.
      I'll test it as soon as a new one comes out.

       
    • radius75

      radius75 - 2023-05-16

      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:

      [Version]
      ConfigVersion=3.7.1
      
      [C64SC]
      Window0Height=644
      Window0Width=720
      Window0Xpos=608
      Window0Ypos=222
      KernalName="D:\Gry\_Commodore64\JiffyDOS-full\JiffyDOS_C64.bin"
      KernalRev=-1
      Drive8RTCSave=1
      Drive9RTCSave=1
      Drive9Type=4844
      DosNameCMDHD="D:\Gry\_Commodore64\JiffyDOS-full\CMD HD BOOTROM v280.bin"
      

      Emulation stays at default 1541.

       
    • radius75

      radius75 - 2023-05-16

      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
      • gpz

        gpz - 2023-05-16

        That doesnt sound like expected behaviour :)

         
        😄
        1
    • radius75

      radius75 - 2023-05-16

      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)

       
      • Roberto Muscedere

        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.

         
1 2 > >> (Page 1 of 2)

Log in to post a comment.