joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.66k stars 378 forks source link

"Illegal descriptor type 0 for int 21" when loading The Elder Scrolls Adventures Redguard (rgfx.exe) #4443

Open enderdrag64 opened 1 year ago

enderdrag64 commented 1 year ago

Describe the bug

image Whenever rgfx.exe gets to the "Loading sound" phase, dosbox crashes with the error message "Illegal descriptor type 0 for int 21"

I found this issue in both the 05.01 and 09.01 builds.

Steps to reproduce the behaviour

Launch rgfx.exe with dosbox-x. I performed this test using both nglide and dgvoodoo2 for glide emulation, both win32 and win64 builds of dosbox-x. Both combinations had this crash

Expected behavior

The game would load and dosbox-x would not crash.

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

Windows 10 22H2

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

2023.09.01 vsbuild and mingw, 2023.05.01 vsbuild and mingw

Used configuration

[video]
#                  vmemsize: Amount of video memory in megabytes.
#                                The maximum resolution and color depth the svga_s3 will be able to display
#                                is determined by this value.
#                                -1: auto (vmemsizekb is ignored)
#                                0: 512k (800x600  at 256 colors) if vmemsizekb=0
#                                1: 1024x768  at 256 colors or 800x600  at 64k colors
#                                2: 1600x1200 at 256 colors or 1024x768 at 64k colors or 640x480 at 16M colors
#                                4: 1600x1200 at 64k colors or 1024x768 at 16M colors
#                                8: up to 1600x1200 at 16M colors
#                              For build engine games, use more memory than in the list above so it can
#                              use triple buffering and thus won't flicker.
#                              
#                vmemsizekb: Amount of video memory in kilobytes, in addition to vmemsize.
#   high intensity blinking: Set to false if you want to see high-intensity background colors instead of blinking foreground text.
#                              This option has no effect in PC-98 and some other video modes.
#  memory io optimization 1: Enable one class of EGA/VGA memory I/O optimizations. Default ON (true).
#                              If graphical artifacts or errors occur, try turning this off first. May provide a performance benefit.
# scanline render on demand: Render video output at vsync or when something is changed mid frame, instead of stopping to render every scanline.
#                              May provide a performance benefit to most DOS games. However this may also break timing-dependent game or Demoscene effects.
#                              Default auto, which will turn if off for VGA modes and turn it on for SVGA modes.
#                              Possible values: true, false, 1, 0, auto.
#
# Advanced options (see full configuration reference file [dosbox-x.reference.full.conf] for more details):
# -> vmemdelay; vbe window granularity; vbe window size; enable 8-bit dac; svga lfb base; pci vga; vga attribute controller mapping; vga bios use rom image; vga bios rom image; vga bios size override; video bios dont duplicate cga first half rom font; video bios always offer 14-pixel high rom font; video bios always offer 16-pixel high rom font; video bios enable cga second half rom font; forcerate; sierra ramdac; sierra ramdac lock 565; vga fill active memory; page flip debug line; vertical retrace poll debug line; cgasnow; vga 3da undefined bits; rom bios 8x8 CGA font; rom bios video parameter table; int 10h points at vga bios; unmask timer on int 10 setmode; vesa bank switching window mirroring; vesa bank switching window range check; vesa zero buffer on get information; vesa set display vsync; vesa lfb base scanline adjust; vesa map non-lfb modes to 128kb region; ega per scanline hpel; allow hpel effects; allow hretrace effects; hretrace effect weight; vesa modelist cap; vesa modelist width limit; vesa modelist height limit; vesa vbe put modelist in vesa information; vesa vbe 1.2 modes are 32bpp; allow low resolution vesa modes; allow explicit 24bpp vesa modes; allow high definition vesa modes; allow unusual vesa modes; allow 32bpp vesa modes; allow 24bpp vesa modes; allow 16bpp vesa modes; allow 15bpp vesa modes; allow 8bpp vesa modes; allow 4bpp vesa modes; allow 4bpp packed vesa modes; allow tty vesa modes; double-buffered line compare; ignore vblank wraparound; ignore extended memory bit; enable vga resize delay; resize only on vga active display width increase; vga palette update on full load; ignore odd-even mode in non-cga modes; ignore sequencer blanking
#
vmemsize                  = -1
vmemsizekb                = 0
high intensity blinking   = true
memory io optimization 1  = true
scanline render on demand = auto

[cpu]
#               core: CPU Core used in emulation. auto will switch to dynamic if available and appropriate.
#                       For the dynamic core, both dynamic_x86 and dynamic_rec are supported (dynamic_x86 is preferred).
#                       Windows 95 or other preemptive multitasking OSes will not work with the dynamic_rec core.
#                       Possible values: auto, dynamic, dynamic_x86, dynamic_nodhfpu, dynamic, dynamic_rec, normal, full, simple.
#                fpu: Enable FPU emulation
#                       Possible values: true, false, 1, 0, auto, 8087, 287, 387.
#         rdtsc rate: If nonzero, the Pentium RDTSC counter will tick at this rate per millisecond instead of by the cycle count
#     segment limits: Enforce checks for segment limits on 80286 and higher CPU types.
#            cputype: CPU Type used in emulation. "auto" emulates a 486 which tolerates Pentium instructions.
#                       "experimental" enables newer instructions not normally found in the CPU types emulated by DOSBox-X, such as FISTTP.
#                       Possible values: auto, 8086, 8086_prefetch, 80186, 80186_prefetch, 286, 286_prefetch, 386, 386_prefetch, 486old, 486old_prefetch, 486, 486_prefetch, pentium, pentium_mmx, ppro_slow, pentium_ii, pentium_iii, experimental.
#             cycles: Number of instructions DOSBox-X tries to emulate each millisecond.
#                       Setting this value too high results in sound dropouts and lags.
#                       Cycles can be set in 3 ways:
#                         'auto'          tries to guess what a game needs.
#                                         It usually works, but can fail for certain games.
#                         'fixed #number' will set a fixed number of cycles. This is what you usually
#                                         need if 'auto' fails (Example: fixed 4000).
#                         'max'           will allocate as much cycles as your computer is able to
#                                         handle. Recommended if better performance is desired.
#                       Possible values: auto, fixed, max.
#            cycleup: Amount of cycles to decrease/increase with the mapped keyboard shortcut.
#          cycledown: Setting it lower than 100 will be a percentage.
#              turbo: Enables Turbo (Fast Forward) mode to speed up operations.
#            apmbios: Emulate Advanced Power Management (APM) BIOS calls.
# integration device: Enable DOSBox-X's integration I/O device, a way for additional software to talk to DOSBox-X. It is currently experimental.
#                       This can for example be used to return DOSBox-X's current status and by the guest OS to match the mouse pointer position.
#         isapnpbios: Emulate ISA Plug & Play BIOS. Enable if using DOSBox-X to run a PnP aware DOS program or if booting Windows 9x.
#                       Do not disable if Windows 9x is configured around PnP devices, you will likely confuse it.
#
# Advanced options (see full configuration reference file [dosbox-x.reference.full.conf] for more details):
# -> cpuid string; processor serial number; double fault; clear trap flag on unhandled int 1; reset on triple fault; always report double fault; always report triple fault; mask stack pointer for enter leave instructions; allow lmsw to exit protected mode; report fdiv bug; enable msr; enable cmpxchg8b; enable syscall; ignore undefined msr; interruptible rep string op; dynamic core cache block size; cycle emulation percentage adjust; stop turbo on key; stop turbo after second; use dynamic core with paging on; ignore opcode 63; apmbios pnp; apm power button event; apmbios version; apmbios allow realmode; apmbios allow 16-bit protected mode; apmbios allow 32-bit protected mode; integration device pnp; isapnpport; realbig16
#
core               = auto
fpu                = true
rdtsc rate         = 0
segment limits     = true
cputype            = auto
cycles             = auto
cycleup            = 10
cycledown          = 20
turbo              = false
apmbios            = true
integration device = false
isapnpbios         = true

[voodoo]
#   voodoo_card: Enable support for the 3dfx Voodoo card.
#                  Possible values: false, software, opengl, auto.
# voodoo_maxmem: Specify whether to enable maximum memory size for the Voodoo card.
#                  If set (on by default), the memory size will be 12MB (4MB front buffer + 2x4MB texture units)
#                  Otherwise, the memory size will be the standard 4MB (2MB front buffer + 1x2MB texture unit)
#         glide: Enable Glide emulation (Glide API passthrough to the host).
#                  Requires a Glide wrapper - glide2x.dll (Windows), libglide2x.so (Linux), or libglide2x.dylib (macOS).
#           lfb: Enable LFB access for Glide. OpenGlide does not support locking aux buffer, please use _noaux modes.
#                  Possible values: full, full_noaux, read, read_noaux, write, write_noaux, none.
#        splash: Show 3dfx splash screen for Glide emulation (Windows; requires 3dfxSpl2.dll).
voodoo_card   = auto
voodoo_maxmem = true
glide         = true
lfb           = full_noaux
splash        = true

[autoexec]
#@echo off
cls
mount C ".." -freesize 512
imgmount d "..\game.ins" -t iso
c:
cd redguard
cls
#cd sound
#setsound
rgfx.exe
exit

Output log

Illegal descriptor type 0 for int 21

Additional information

No response

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

Code of Conduct & Contributing Guidelines

joncampbell123 commented 1 year ago

It doesn't seem to reproduce the issue here on Linux, even if I break the sound configuration by changing sound card resources, in which case I just get a sort of in-game "console" following a message about sound configuration.

maron2000 commented 1 year ago

Seems to boot fine here with x64 VS SDL1 build,

enderdrag64 commented 1 year ago

Based on the replies I was curious if it might've been a platform dependent issue so I tried again on another computer. The one I tried on before was a Windows desktop on a second-gen Ryzen processor.

This time I tested on an old Windows 10 laptop with an Intel processor. It still crashed but I got a slightly different error this time: image I copied the exact same config over for this

joncampbell123 commented 1 year ago

Are you using 3Dfx acceleration with the game or software rendering?

I'm using the 3Dfx mode and I'm not seeing any issues.

enderdrag64 commented 1 year ago

Yes I'm using 3dfx acceleration. I tested with both nglide and dgvoodoo

joncampbell123 commented 1 year ago

Maybe there is something about dynamic core (core=auto might switch to dynamic when the game starts).

Try running with core=normal

Arucard1983 commented 10 months ago

I could reproduce the error using the Windows 32-bit version of DosBox-X in order to play Redguard on Linux using dgVoodoo2 and DXVK enabled from Lutris.

It happens when the system RAM setting are the default 16 MB l, but when changed to 64 (the game requires that large amount of RAM or it fail with an error) the error do not happen and the game starts normally.

Allofich commented 1 week ago

Might be the same as the issue in https://github.com/joncampbell123/dosbox-x/issues/3779. That also involved an "illegal descriptor" error and was triggered by 16 MB not being enough memory for the game.