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

SIGSEGV when using sleep in DOSBox #198

Open
wesleywerner opened this issue Nov 29, 2019 · 2 comments
Open

SIGSEGV when using sleep in DOSBox #198

wesleywerner opened this issue Nov 29, 2019 · 2 comments

Comments

@wesleywerner
Copy link

VERSION: 1.07.1 DOS (32-bit)
ENVIRONMENT: DOSBox 0.74 (default DOS configuration)

Test program:

print "before sleep"
sleep 250
print "after sleep"

This issue is dependant on the CPU speed configured in DOSBox. When running at the default 3000 cycles the exception is thrown. When dropping the cycles to 300 the problem disappears. I cannot speculate why this happens, reporting it regardless for visibility's sake.

running at 3000 cycles
screenshot 003521

running at 300 cycles
screenshot 003522

@MyTDT-Mysoft
Copy link

MyTDT-Mysoft commented Dec 10, 2019

it happens while checking for keypress part of sleep... if you use sleep 250,1 it will work, but yes nasty bug that been there for a while now

@jayrm
Copy link
Member

jayrm commented Jun 2, 2023

Something different to try in fbc 1.10.0. It is kind of like using sleep 250,1, but key presses are still checked.

extern "c"
        extern as unsigned long __fb_dos_no_dpmi_yield
end extern

'' tell SLEEP to call usleep_private() which does not yeild to dpmi
'' this prevents djgpp c runtime from calling __dmpi_yeild() during a
'' call in SLEEP.  Disabling this yeild behaviour appears to prevent
'' the program from crashing in some DOS extenders.

__fb_dos_no_dpmi_yield = 1

print "before sleep"
sleep 250
print "after sleep"

No doubt there are still bugs, but this allowed me to debug some fb DOS programs that would otherwise just crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants