You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I load the same disc image into drives 0 and 1 (and maybe do a *. to force disc access) , b-em locks up - doing an strace suggests this is probably down to file locking:
This is on Linux Mint 21.2 x86-64, FWIW. I've built b-em from the latest master branch (commit 5ce9c1b).
I appreciate this isn't a sensible thing to do, but I did it by accident (I had an image loaded into drive 1 from a while back without realising, then deliberately loaded the same image into drive 0 to use without noticing or caring it was already in drive 1) and I think it would be nice to generate an error or something instead of just locking up.
The text was updated successfully, but these errors were encountered:
Interesting. File locking on Linux already seems to have quite a number of choices and I opted for the newer locking that works by file descriptor rather than by process. That does mean if the same process opens the same file twice it can compete with itself for locks.
I think this may have worked better when I first implemented the locking, i.e. if you loaded the image file into both drives it wouldn't deadlock unless you accessed them both, for example by copying from one to the other. Somewhere along the line, maybe with the HFE support, someone noted that on real hardware both drives would spin up at the same time whichever is accessed which now means both try to lock their respective files, hence the deadlock.
Probably the best way to resolve this would be to add a test upon loading a disc image so you can't load it into both drives at the same time. That may need some research to work out if two pathnames are the same file beyond just comparing the names, i.e. because of links etc.
If I load the same disc image into drives 0 and 1 (and maybe do a *. to force disc access) , b-em locks up - doing an strace suggests this is probably down to file locking:
This is on Linux Mint 21.2 x86-64, FWIW. I've built b-em from the latest master branch (commit 5ce9c1b).
I appreciate this isn't a sensible thing to do, but I did it by accident (I had an image loaded into drive 1 from a while back without realising, then deliberately loaded the same image into drive 0 to use without noticing or caring it was already in drive 1) and I think it would be nice to generate an error or something instead of just locking up.
The text was updated successfully, but these errors were encountered: