dosbox-staging icon indicating copy to clipboard operation
dosbox-staging copied to clipboard

hard_disk_speed less than maximum causes hang on exit

Open weirddan455 opened this issue 2 weeks ago • 1 comments

Are you using the latest DOSBox Staging version?

  • [x] I have checked and I'm using the latest release.

Different version than latest?

No response

What operating system are you using?

Linux x86_64

If other OS or Linux, please describe

No response

Are you running DOSBox Staging on a native OS?

  • [x] I am running Staging on a native OS

Are you able to trigger the issue with our official DOSBox Staging release?

  • [x] I am running an official Staging release, not a release installed by my operating system's package manager, or a version repackaged by an external team.

Relevant hardware info

No response

Have you checked that no other similar issue already exists?

  • [x] I have searched and have not found similar issues.

A clear and concise description of what the bug is

If Dosbox is closed while disk I/O is occurring, we get a hang when hard_disk_speed is set to anything but maximum. See repro instructions below. It gets stuck in this loop forever:

https://github.com/dosbox-staging/dosbox-staging/blob/21b3dbd119aac019adadb5c9e59d33a30bf2ec6a/src/dos/dos.cpp#L316-L319

Steps to reproduce the behaviour

Explain in detail how to reproduce the bug. Assume no familiarity with the software.

  1. Set hard_disk_speed = slow (fast hangs too but slow is easier to reproduce)
  2. Launch Doom (or probably any game)
  3. Immediately close Dosbox while the game is loading
  4. Dosbox hangs forever and does not exit (continuously playing disk noises if enabled)

Download URL of affected game or software

No response

Your configuration

[dosbox]
hard_disk_speed = slow

Provide a log


Code of conduct and contributing guidelines

  • [x] Yes, I agree.

weirddan455 avatar Dec 10 '25 02:12 weirddan455

Possible fix is checking for DOSBOX_IsShutdownRequested() inside the while condition but any fix will conflict with PR #4617

weirddan455 avatar Dec 10 '25 03:12 weirddan455