joncampbell123 / dosbox-x

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

Win98SE setup causes GPF in KRNL386 #3686

Closed rderooy closed 2 years ago

rderooy commented 2 years ago

Describe the bug

As mentioned on discord. Running Win98SE SETUP from the internal DOS causes a general protection fault while setup is preparing to copy files. krnl386_000

This is a new issue, and doing a git bisect, turns up this commit.

$ git bisect bad
365439d54470516de4a2a663f74deb43cf1006ad is the first bad commit
commit 365439d54470516de4a2a663f74deb43cf1006ad
Author: Wengier <wengierwu@yahoo.com>
Date:   Sat Aug 20 18:30:29 2022 -0400

    more

 .github/workflows/linux.yml |  2 +-
 .github/workflows/macos.yml |  2 +-
 src/dos/dos_memory.cpp      | 11 +++++++++++
 src/dos/drive_fat.cpp       |  4 ++--
 src/dos/drive_local.cpp     | 21 ++++++++++++---------
 src/hardware/adlib.cpp      |  5 ++++-
 src/hardware/vga_draw.cpp   |  1 +
 src/output/output_tools.cpp |  4 ++--
 src/output/output_ttf.cpp   | 11 ++++++++---
 9 files changed, 42 insertions(+), 19 deletions(-)

Steps to reproduce the behaviour

Run Win98SE SETUP.EXE

Expected behavior

No response

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

Fedora 36

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

latest git

Used configuration

[sdl]
autolock=true
mouse_wheel_key=0

[dosbox]
title=Windows 98
memsize=64

[video]
vmemsize=4
vesa modelist width limit=0
vesa modelist height limit=0
allow high definition vesa modes=true
allow unusual vesa modes=true
allow low resolution vesa modes=false

[voodoo]
voodoo_card=false
glide=true

[dos]
ver=7.1
hard drive data rate limit=0

[cpu]
cputype=pentium_mmx
core=dynamic_x86

[sblaster]
sbtype=sb16vibra

[ne2000]
ne2000=true
nicirq=10
macaddr=AC:DE:48:88:99:AE
backend=pcap

[ethernet, pcap]
realnic=enp42s0

[fdc, primary]
int13fakev86io=true

[ide, primary]
int13fakeio=true
int13fakev86io=true

[ide, secondary]
int13fakeio=true
int13fakev86io=true
cd-rom insertion delay=4000

[render]
scaler=none

[parallel]
parallel1=file timeout=9000 openps:xdg-open

### Output log

```text
LOG: Early LOG Init complete
LOG: DOSBox-X's working directory: /home/rderooy/emu/dbgl/dosroot/winroot.98
LOG: Logging init: beginning logging proper. This is the end of the early init logging
LOG: Logging: No logfile was given. All further logging will be discarded.
LOG: DOSBox-X version 2022.08.0 (Linux SDL1)
LOG: Current X11 keyboard layout (token) is: 'us'
LOG: Host keyboard layout is now us (US English)
LOG: Mapper keyboard layout is now us (US English)
LOG: SDL1 auto-detected desktop as 5120 x 1440
LOG: The default output for the video system: surface
LOG: Configured windowposition: -
LOG: X11 main window is 640 x 400 maximized=0
LOG: X11 extension XRANDR is available
LOG: XRandR CRTC 0: pos=(2560,0) size=(2560,1440) outputs=1
LOG: Our window lies on this CRTC display (window pos=(2600,74) size=(640,400) match=(2920,274)).
LOG:   Goes to output 0: name='XWAYLAND1' size_mm=(600 x 340)
LOG: Screen report: Method 'XRandR' (2560.000 x 1440.000 pixels) at (2560.000 x 0.000) (600.000 x 340.000 mm) (23.622 x 13.386 in) (108.373 x 107.576 DPI)
LOG: ISA BCLK: 8333333.333Hz (25000000/3)
LOG: monopal: green, 
LOG: Active save slot: 1 [Empty]
LOG: USING AVI+ZMBV
LOG: Max 3670016 sz 65536
LOG: Final 65536
LOG: Glide:LFB access: read-write (no aux)
LOG: SDLNet_TCP_Open: Couldn't connect to remote host
LOG: TiMidity: can't open control connection (host=127.0.0.1, port=7777)
fluidsynth: error: Unknown numeric setting 'audio.periods'
fluidsynth: error: Unknown numeric setting 'audio.period-size'
fluidsynth: error: Unknown string setting 'synth.reverb.active'
fluidsynth: error: Unknown string setting 'synth.chorus.active'
fluidsynth: Using PulseAudio driver
fluidsynth: warning: Failed to set thread to high priority
LOG: MIDI:fluidsynth: Loaded SoundFont: /usr/share/soundfonts/default.sf2
LOG: MIDI:Opened device:fluidsynth
LOG: Pentium CMPXCHG8B emulation is enabled
LOG: VOODOO LFB now at d0000000
LOG: Serial1: BASE 3f8h
LOG: Serial2: BASE 2f8h
LOG: Parallel1: BASE 378h
LOG: MPU-401 Registering I/O ports as if IBM PC MPU-401 at base 330h
LOG: GetDesktopResolution reading X11 desktop resolution
LOG: Root window (ID 973) is 5120 x 1440
LOG: X11 main window is 640 x 400 maximized=0
LOG: XRandR CRTC 0: pos=(2560,0) size=(2560,1440) outputs=1
LOG: Our window lies on this CRTC display (window pos=(2600,74) size=(640,400) match=(2920,274)).
LOG:   Goes to output 0: name='XWAYLAND1' size_mm=(600 x 340)
LOG: Screen report: Method 'XRandR' (2560.000 x 1440.000 pixels) at (2560.000 x 0.000) (600.000 x 340.000 mm) (23.622 x 13.386 in) (108.373 x 107.576 DPI)
LOG: Allocated APM BIOS pm entry point at f000:ce40
LOG: Writing code to fce40
LOG: Writing code to fce60
LOG: ETHERNET: NE2000 Ethernet emulation backend selected: pcap
LOG: Using Network interface:
enp42s0
(no description)
LOG: 
Unable to open the interface: enp42s0: You don't have permission to capture on that device (socket: Operation not permitted).
LOG: NE2000: Failed to open Ethernet backend pcap
LOG: X11 main window is 640 x 400 maximized=0
LOG: XRandR CRTC 0: pos=(2560,0) size=(2560,1440) outputs=1
LOG: Our window lies on this CRTC display (window pos=(2600,74) size=(640,400) match=(2920,274)).
LOG:   Goes to output 0: name='XWAYLAND1' size_mm=(600 x 340)
LOG: Screen report: Method 'XRandR' (2560.000 x 1440.000 pixels) at (2560.000 x 0.000) (600.000 x 340.000 mm) (23.622 x 13.386 in) (108.373 x 107.576 DPI)
LOG: ISA Plug & Play BIOS enabled
LOG: VGA ROM BIOS init callback
LOG: pixratio 1.000, dw false, dh false
LOG: Aspect ratio: 640 x 480  xToY=1.333 yToX=0.750
LOG: menuScale=1
LOG: surface consider=640x497 final=640x497
LOG: X11 main window is 640 x 497 maximized=0
LOG: XRandR CRTC 0: pos=(2560,0) size=(2560,1440) outputs=1
LOG: Our window lies on this CRTC display (window pos=(2600,74) size=(640,497) match=(2920,322)).
LOG:   Goes to output 0: name='XWAYLAND1' size_mm=(600 x 340)
LOG: Screen report: Method 'XRandR' (2560.000 x 1440.000 pixels) at (2560.000 x 0.000) (600.000 x 340.000 mm) (23.622 x 13.386 in) (108.373 x 107.576 DPI)
LOG: WARNING: No translation support (to host) for code page 0
LOG:   66042428 ERROR BIOS:Keyboard layout file auto not found
LOG:   66042428 ERROR BIOS:Keyboard layout file auto not found
LOG: XMS: 50 handles allocated for use by the DOS environment
LOG: EMS page frame at 0xe000-0xefff
LOG: COMMAND.COM env size:             720 bytes
LOG: COMMAND.COM environment block:    0xcc01 sz=0x002d
LOG: COMMAND.COM main body (PSP):      0xcc2f sz=0x009a
LOG: COMMAND.COM stack:                0xcc49
LOG: pixratio 1.350, dw false, dh false
LOG: Aspect ratio: 720 x 540  xToY=1.333 yToX=0.750
LOG: menuScale=1
LOG: surface consider=720x417 final=720x417
LOG: X11 main window is 720 x 417 maximized=0
LOG: XRandR CRTC 0: pos=(2560,0) size=(2560,1440) outputs=1
LOG: Our window lies on this CRTC display (window pos=(2600,74) size=(720,417) match=(2960,282)).
LOG:   Goes to output 0: name='XWAYLAND1' size_mm=(600 x 340)
LOG: Screen report: Method 'XRandR' (2560.000 x 1440.000 pixels) at (2560.000 x 0.000) (600.000 x 340.000 mm) (23.622 x 13.386 in) (108.373 x 107.576 DPI)
LOG: Creating image file "hdd.img" with 1023 cylinders, 64 heads and 63 sectors
LOG: IDE: index 0 slave=0
LOG: FAT: Partition type is MBR (IBM PC)
LOG: Mounted FAT volume is FAT32 with 514573 clusters
LOG: Mapping BIOS DISK C/H/S 1023/64/63 as IDE 4092/16/63
LOG: IDE: index 0 slave=1
LOG: Emulation speed restored to normal (100%)
LOG: Fast Forward ON
LOG: Fast Forward OFF
LOG: Fast Forward ON
LOG: DEBUG: INT 2Fh Windows 286/386 DOSX init broadcast issued (ES:BX=0000:0000 DS:SI=0000:0000 CX=0000 DX=0001 DI=030a(aka version 3.10))
LOG:  [286 DOS extender]
LOG: 
LOG:  654508213 ERROR BIOS:INT16:Unhandled call 6F
LOG:  654513176 ERROR CPU:Illegal Unhandled Interrupt Called 68
LOG: DOSBox-X has switched to max cycles, because of the setting: cycles=auto.
If the game runs too fast, try a fixed cycles amount in DOSBox-X's options.
LOG:  654592567 ERROR CPU:Illegal Unhandled Interrupt Called 5C
LOG: INT 15h mouse initialized to 3-byte protocol
LOG: INT 15h mouse reset
LOG: INT 15h reporting mouse device ID 0x00
LOG: pixratio 1.000, dw false, dh false
LOG: Aspect ratio: 640 x 480  xToY=1.333 yToX=0.750
LOG: menuScale=1
LOG: surface consider=640x497 final=640x497
LOG: X11 main window is 640 x 497 maximized=0
LOG: XRandR CRTC 0: pos=(2560,0) size=(2560,1440) outputs=1
LOG: Our window lies on this CRTC display (window pos=(2600,74) size=(640,497) match=(2920,322)).
LOG:   Goes to output 0: name='XWAYLAND1' size_mm=(600 x 340)
LOG: Screen report: Method 'XRandR' (2560.000 x 1440.000 pixels) at (2560.000 x 0.000) (600.000 x 340.000 mm) (23.622 x 13.386 in) (108.373 x 107.576 DPI)
LOG: INT 15h mouse initialized to 3-byte protocol
LOG: INT 15h mouse reset
LOG: INT 15h reporting mouse device ID 0x00
LOG: 1427814601 ERROR DOSMISC:DOS:IOCTL Call  5 unhandled
LOG: 1427912242 ERROR BIOS:Disk 0 not active
LOG: 1427925811 ERROR DOSMISC:DOS:IOCTL Call  5 unhandled
LOG: 1427980850 ERROR DOSMISC:DOS:IOCTL Call  5 unhandled
LOG: 1428029493 ERROR DOSMISC:DOS:IOCTL Call  5 unhandled
LOG: 1428138659 ERROR DOSMISC:DOS:IOCTL Call  5 unhandled
LOG: 1437399351 ERROR DOSMISC:DOS:IOCTL Call  5 unhandled
LOG: 1441310373 ERROR IOCTL:DOS:IOCTL Call  D:6F Drive  2 unhandled (CH=08h)
LOG: 1459401222 ERROR DOSMISC:DOS:IOCTL Call  5 unhandled
LOG: 1465961739 ERROR IOCTL:DOS:IOCTL Call  D:6E Drive  2 unhandled (CH=08h)
LOG: 1219681310 ERROR DOSMISC:DOS:IOCTL Call E0 unhandled


### Additional information

_No response_

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

- [X] I have searched and didn't find any similar bug report.

### Code of Conduct & Contributing Guidelines

- [X] I agree to follow the code of conduct and the contributing guidelines.
rderooy commented 2 years ago

Issue is resolved with https://github.com/joncampbell123/dosbox-x/commit/05d65bfacdc7e81972c6c214224e07c4e7c3072f

lucrus73 commented 10 months ago

I think I'm hitting this issue again in Dosbox-x release 2023.10.06, installed via Debian packages.

Dosbox-x crashes during Windows 98 SE Italian setup, but before reaching the graphical environment.

Log messages look very similar to the ones above:

LOG: DEBUG: INT 2Fh Windows 286/386 DOSX init broadcast issued (ES:BX=0000:0000 DS:SI=0000:0000 CX=0000 DX=0001 DI=030a(aka version 3.10))
LOG:  [286 DOS extender]
LOG: 
LOG:  681753340 ERROR BIOS:INT16:Unhandled call 6F
LOG:  681756511 ERROR CPU:Illegal Unhandled Interrupt Called 68
LOG: DOSBox-X has switched to max cycles, because of the setting: cycles=auto.
If the game runs too fast, try a fixed cycles amount in DOSBox-X's options.
LOG:  681845111 ERROR CPU:Illegal Unhandled Interrupt Called 5C
LOG: INT 15h mouse initialized to 3-byte protocol
LOG: INT 15h mouse reset
LOG: INT 15h reporting mouse device ID 0x00
*** stack smashing detected ***: terminated

I'm not sure if I should open a new issue or if it's ok to comment here.

maron2000 commented 10 months ago

@lucrus73 Your said issue differs from the original one posted here. I think this is common with issue #4482, which maybe solved in the fixes after the October release. Refer to the said issue for more details and further discussions.