Menu

#1541 VICE crashes if filesystem directory does not exist

v3.x
pending-fixed
nobody
None
Virtual Drives
2023-01-13
2021-09-07
Zibri
No

Yestrady I moved a directory and forgot to update the settings...

IF a drive is a filesystem device and the directory does not exist, instead of having a "c64 normal error" VICE crashes.

Tested on GTK versions (x64.exe x64sc.exe) but should affect any other version.

Discussion

  • Zibri

    Zibri - 2021-09-07

    lol yestraday :D

     
  • gpz

    gpz - 2021-09-07

    please tell exactly how to reproduce this, preferably using a commandline starting with -default and using the latest build from https://github.com/VICE-Team/svn-mirror/releases

    ./src/x64sc -fs8 foobar -device8 1 -virtualdev +drive8truedrive -drive8type 0

    and then load"$",8 gives "file not found" for that matter

    same for

    ./src/x64sc -fs8 foobar -device8 1 -iecdevice8 +virtualdev +drive8truedrive -drive8type 0

     

    Last edit: gpz 2021-09-07
    • Zibri

      Zibri - 2021-09-09

      I had a directory set as the filesystem for device 10.
      doing load"prog.prg",10 made x64 crash.
      (then I realized I moved the directory)

       
  • gpz

    gpz - 2021-09-09

    please read again my previous post and give a way to reproduce this

     
    • Zibri

      Zibri - 2021-09-10

      open GTK version and settings.
      define device 10 as filesystem and point it to an existing directory.
      save, quit and restart vice after renaming or removing the directory.
      crash.

       
  • compyx

    compyx - 2021-09-10

    I just tried the above on both Linux and Windows. With the filesystem directory present I get a directory when using LOAD"$",10, when I've removed the host filesystem directory I get a file not found error. Not getting any crash here.

    Please post your vice.ini and vice.log, and the revision of the build you downloaded.

     
  • compyx

    compyx - 2021-10-21
    • status: open-need-info --> closed-invalid
     
  • compyx

    compyx - 2021-10-21

    OP not responding as usual, closing.

     
  • DarkVision

    DarkVision - 2023-01-11

    The "bug" does still exist in r42871:

    x64sc \
    -default \
    -device11 1 \
    -iecdevice11 \
    -fs11 ./somebadpath/
    

    ./somebadpath/ can be any non-existend directory path.

    Type:

    LOAD"$",11
    
    SEARCHING FOR $
    ?FILE NOT FOUND ERROR
    READY.
    

    Looks good so far...

    Now type:

    LOAD"X",11
    

    VICE will crash immediately with a segmentation fault. "X" can be any kind of a filename, since the host-directory does not exist it will always crash except for the directory "$".

    You can also try:

    OPEN 2,11,2,"X,P,R":CLOSE 2
    

    Segfault...

    OPEN 2,11,2,"$,P,R":CLOSE 2
    

    No Segfault, seems to work...

    I have always set a FS11 device with a relative path to have quick access to my VICE directory... for testing i have created a temporary directory but used the same command to launch VICE and had the same issue then described in the initial ticket. This can cause data loss on attached cartridges (REU, GeoRAM, even with an attached image).

    Since loading the directory gives correct feedback, loading a file from a non-existent directory should give the same feedback as loading a non-existent file from an existing directory (i.e. "FILE NOT FOUND").

    Of course this is a bad VICE configuration, but a segfault should not occur...

    P.S. Linux 64Bit

     

    Last edit: DarkVision 2023-01-11
  • compyx

    compyx - 2023-01-11
    • status: closed-invalid --> pending-fixed
    • Version: v3.6 --> v3.x
    • Port: Windows -->
    • Category: --> Virtual Drives
     
    • compyx

      compyx - 2023-01-11

      Stupid SourceForge editor didn't post my message:

      I managed to track down the bug to some missing error checking, I've fixed the bug you mentioned, but there could be more, looking around in the fsdevice code.
      Anyway, immediate issue fixed =)

       
      • DarkVision

        DarkVision - 2023-01-13

        Tested with r42877 and it looks good so far.

        Since you mentioned that there could be other issues i did some more tests:

        Saving a file to a non-existend directory gives the following error on the console:

        FSDrive: Error - Cannot open file. Status $02.
        

        SAVE command will return the following error:

        63,FILE EXISTS,00,00
        

        Saving a file to a disk drive without a disk image attached will return:

        74,DRIVE NOT READY,00,00
        

        Should be the same when the FS directory does not exist.

        Anyway, i wasn't able to crash VICE with a segfault like in the original bug report.
        Thanks for the fix!

         

Log in to post a comment.