Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wordperfect 5.0 fails to save documents when inside .zip, works with -ro mounts. PHYSFS truncate issue #3784

Open
2 tasks done
NebularNerd opened this issue Oct 16, 2022 · 6 comments
Labels

Comments

@NebularNerd
Copy link
Contributor

Describe the bug

If you try to run Wordperfect 5.0 inside a .zip it will appear to work, however trying to save a file will fail. When WP opens it creates the following temp files:

WP}WP{.BV1
WP}WP{.CHK
WP}WP{.SPC
WP}WP{.TV1

Depending on your build (it varies depending on PHYFS commits) you will get either:

  • When you try to save a file (F10) it appears to work but actually fails, also when quitting (F7) you may get stuck in a file fail to save loop.
  • It may also fail to run completely bring up an error screen asking for `Directory in use'

If you mount a folder as read only with an overlay it will run as expected. I've attached a working install to help diagnosis.

This could be the same or similar issue to my other bug #3780 but keeping separate in case they are not.

Steps to reproduce the behaviour

  • Grab WP50.zip this is a working version from my own disks.
  • Mount as .zip & overlay mount c wp50.zip and mount c overlaydir -t overlay and try to run
  • Unzip and mount as read only -ro & overlay mount c wp50 -ro and mount c overlaydir -t overlay and run again

Quick helpful keys:
F7 = Quit
F10 = Save file
Shift+F10 = Load file

Expected behavior

Mounted .zip & overlay should behave the same as mounted read only folder & overlay.

What operating system(s) this bug have occurred on?

Windows 10

What version(s) of DOSBox-X have this bug?

Various builds especially those with recent PHYFS commits

Used configuration

No response

Output log

No response

Additional information

No response

Have you checked that no similar bug report(s) exist?

  • I have searched and didn't find any similar bug report.

Code of Conduct & Contributing Guidelines

  • I agree to follow the code of conduct and the contributing guidelines.
@grapeli
Copy link

grapeli commented Oct 16, 2022

On Linux wp.exe from WP50.zip does not start at all. So as you can see the implementation of physfs in dosbox-x under linux contains even more serious bugs.
The first boot with overlay ends with segmentation fault. Next - no.
I gave the exact log from gdb in this collective thread. It is identical.

@grapeli
Copy link

grapeli commented Oct 16, 2022

Commenting or removing this line in the src/dos/drive_physfs.cpp file
fcntl(**(int**)fhandle->opaque,F_SETFL,0);
in the case of a system other than windows solves the crash problem in the first attempt to run wp.exe and allows the application to start properly.

This does not eliminate the problem of saving the document.

edit: This minor fix fixes an identical crash when trying to run BarneySplat.

@grapeli
Copy link

grapeli commented Oct 16, 2022

WP performs some more non-standard operations when saving the document.

This information can be found when running dosbox-x with debug:
PHYSFS TODO: truncate not yet implemented (/C_DRIVE/WP50/TEST at 66)
https://github.com/joncampbell123/dosbox-x/blob/master/src/dos/drive_physfs.cpp#L730

@NebularNerd
Copy link
Contributor Author

I think it's looking like we are really finding the current limits of the PHYSFS implementation, maybe it really needs for PHYSFS 4.0 to be released and then reimplemented from scratch, given the recent 3.2.0 release has fixes dating back years it may come to pass that starting again would be easier than the current 'patch and see what break' fixes.

@grapeli
Copy link

grapeli commented Oct 17, 2022

You are a bit confusing some things.
The PhysicsFS code in the DOSBox-X source is here. There have been some minimal fixes here. It would be best if it was up to date.

drive_physfs.cpp is not part of PhysicsFS.

Don't blame physfs that file truncation doesn't work in dosbox-x. This has to be implemented on the dosbox-x side.

@NebularNerd
Copy link
Contributor Author

You are a bit confusing some things. The PhysicsFS code in the DOSBox-X source is here. There have been some minimal fixes here. It would be best if it was up to date.

drive_physfs.cpp is not part of PhysicsFS.

Don't blame physfs that file truncation doesn't work in dosbox-x. This has to be implemented on the dosbox-x side.

My bad, so anything that crops up in the drive_physfs.cpp is to do with DosBox-x's interfacing with the PhysicsFS library. I shall remember this going forward.

@NebularNerd NebularNerd changed the title Wordperfect 5.0 fails to save documents when inside .zip, works with -ro mounts Wordperfect 5.0 fails to save documents when inside .zip, works with -ro mounts. PHYSFS truncate issue Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants