VICE crashes if filesystem directory does not exist
Versatile Commodore Emulator
Brought to you by:
blackystardust,
gpz
lol yestraday :D
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
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)
please read again my previous post and give a way to reproduce this
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.
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.
OP not responding as usual, closing.
The "bug" does still exist in r42871:
./somebadpath/ can be any non-existend directory path.
Type:
Looks good so far...
Now type:
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:
Segfault...
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
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 =)
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:
SAVE command will return the following error:
Saving a file to a disk drive without a disk image attached will return:
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!