rakslice / macemu

Basilisk II and SheepShaver Macintosh emulators
0 stars 0 forks source link

extfs: aliases sometimes invalid #59

Closed rakslice closed 3 years ago

rakslice commented 3 years ago

In a Finder window for a folder somewhere in the extfs volume, select an item in the folder and make an alias of it.

Getting info on the alias shows an incorrect path for the original, with one level missing -- it is shown as being in the parent folder of the folder it is actually in.

However opening the alias while it is in this folder nevertheless works

If you move the alias to the desktop, there are two cases:

rakslice commented 3 years ago

The internal full path strings in the contents of the aliases' .rsrc files are the same and are correct in both cases.

rakslice commented 3 years ago

I have a test directory structure:

This PC
\- I
   \- testfolder
      \- something
         \- test file

Where test file is a simpletext file.

When I do Get info on an alias to test file when the alias is still in the something folder, along side the file it points to, shows:

Original : This PC : I : testfolder : test file

i.e. something is missing.

When I move it to the desktop, in the non-working case its Get Info there shows the same, but sometimes opening and closing Get Info randomly alternates between this and

Original : This PC : I : something : test file

i.e. testfolder is missing

and sometimes eventually converges to a different value, either the correct value

Original : This PC : I : testfolder : something : test file

in which case it is now a working alias, or to just not showing anything

Original :

in which case it is now a broken alias, that opening gives the dialog with:

The alias "test file alias could not be opened, because the original item cannot be found.

and options to fix or delete.

rakslice commented 3 years ago

This was in Mac OS 9. Mac OS 7.6.1 seems to display the origins of the aliases correctly in Get Info, but still suffers from the same problem launching the alias when it is moved to the desktop some of the time.

rakslice commented 3 years ago

The behaviour and issues are similar in Linux and Windows.

Judging by the cut up names that that the fs_get_cat_info dir_index == 0 case (lookup by parent dir num and name or entire path via ioNamePtr) is getting, indicated in the debug output for extfs.cpp, there is some unwanted clobbering happening.

I can situationally cause the behaviour to change by tweaking things, but I don't know for instance what is supposed to be indicated by a path of just ":", what the right error return is when ioNamePtr is nil in a lookup by name, or what the method to the logical layers is that would determine what cases the no_name_vol params should actually be set for.

I haven't figured out what I might call an essential common cause of the problem.

rakslice commented 3 years ago

Because dirIds ultimately become invalid across a restart of the emulator, and the Mac OS is built with the understanding that a filesystem is never going to do that, the extfs is fundamentally going to have many serious problems, and it's hard to rule out the relevance of that major issue to any specific symptom.

I'm tempted to implement an extfs dirid persistence mechanism, even a toy one with terrible performance, just to be able to prove that it is or isn't relevant to any particular extfs problem.