kanjitalk755 / macemu

Basilisk II and SheepShaver Macintosh emulators
357 stars 56 forks source link

BasiliskII intermittently fails to start on Debian/Linux and always fails to restart #142

Closed gorlik closed 11 months ago

gorlik commented 2 years ago

BasiliskII intermittently fails to start with the following error:

$ ./BasiliskII Basilisk II V1.1 by Christian Bauer et al. Reading ROM file... Using SDL/pulseaudio audio output Using SDL_Renderer driver: opengl Caught SIGSEGV at address 0x14067b000 [IP=0x419a48] D0: 00000000 D1: 0000003a D2: 00185bfc D3: 0000ffff D4: ffffffff D5: 000000f0 D6: 00000000 D7: 00030005 A0: 02000956 A1: 00185bfc A2: 00185cac A3: 00002120 A4: 04009ae6 A5: 03ffffa2 A6: 02000996 A7: 020008e6 USP=00000000 ISP=020008e6 MSP=00000000 VBR=00000000 T=00 S=1 M=0 X=0 N=0 Z=1 V=0 C=0 IMASK=0 FP0: nan FP1: nan FP2: nan FP3: nan FP4: nan FP5: nan FP6: nan FP7: nan N=0 Z=0 I=0 NAN=0 00185ce6: 7119 0c68 0001 001a 6604 EMULOP.L #$00000019 next PC: 00185ce8

the address of the SIGSEGV is different every time but the emulated address/instruction is always the same.

when it starts properly then it fails upon restart with: $ ./BasiliskII Basilisk II V1.1 by Christian Bauer et al. Reading ROM file... Using SDL/pulseaudio audio output Using SDL_Renderer driver: opengl WARNING: No FSM present, disabling ExtFS Caught SIGSEGV at address 0x108645008 [IP=0x444406] D0: fffffefa D1: ffffffff D2: 0000000d D3: ffffff47 D4: 00000000 D5: ffffffff D6: 00000000 D7: 00000007 A0: 00000004 A1: 0000fe56 A2: 0000f6d8 A3: 00000008 A4: 0000f7d8 A5: 041111c4 A6: 0000f940 A7: 0000f5c4 USP=00000000 ISP=0000f5c4 MSP=00000000 VBR=00000000 T=00 S=1 M=0 X=0 N=1 Z=0 V=0 C=0 IMASK=0 FP0: nan FP1: nan FP2: nan FP3: nan FP4: nan FP5: nan FP6: nan FP7: nan N=0 Z=0 I=0 NAN=0 0000feb4: 03f9 c66a 0008 0000 fb9e BSET.B D1,$c66a0008 next PC: 0000feba

BasiliskII 1.1 compiled from git with default options. Disabling jit does not help. Changing the sdl render also does not help. Same ROM/image combination works fine with the BasiliskII 1.0 that ships with debian.

Updated debian bullseye Linux tux7 5.10.0-18-amd64 #1 SMP Debian 5.10.140-1 (2022-09-02) x86_64 GNU/Linux

kanjitalk755 commented 2 years ago

It was not reproduced in the following environment.

Host: Debian 11.4 (x86_64) Guest: Mac OS J1-8.1, centris650.rom

It may be possible to fix the issue if the reproduction conditions are clarified.

gorlik commented 2 years ago

I tried to use gdb to narrow down the problem. Unfortunately, vosf seems to interfere with gdb and I can't get it to do anything useful. I disabled vosf and now under gdb the emulator never fails to start. However without gdb still intermittently fails with the same signature as above.

any recommendation on how I can help?

gorlik commented 2 years ago

I narrowed down the intermittent startup issue with a modified system ROM. Using a pristine IIsi ROM seems to work all the time. The same modified ROM works well on both BasiliskII 1.0 and a real Mac.

However, even with the pristine IIsi rom restarting fails with: Illegal instruction: 00e0 at 07fd1d56 Your Mac program just did something terribly stupid Caught SIGSEGV at address (nil) [IP=0x43eb00] D0: 4081e254 D1: 00001214 D2: fffffffe D3: 00000000 D4: 00000028 D5: 0000813a D6: 0000000a D7: 00011d24 A0: 8202000c A1: 00001e44 A2: 00010b78 A3: 00011820 A4: 40810000 A5: 82020006 A6: 00001d52 A7: 00001d28 USP=00000000 ISP=00001d28 MSP=00000000 VBR=00000000 T=00 S=1 M=0 X=0 N=1 Z=0 V=0 C=0 IMASK=0 FP0: nan FP1: nan FP2: nan FP3: nan FP4: nan FP5: nan FP6: nan FP7: nan N=0 Z=0 I=0 NAN=0 8202000c: 0000 0000 0000 0000 0000 OR.B #$00,D0 next PC: 82020010

kanjitalk755 commented 2 years ago

Does that mean some ROMs start normally? It was also reported in #134 that there is a problem with restarting.

gorlik commented 2 years ago

The unmodified ROM behaves better and starts up most of the times. Right now, I am using a unmodified IIsi ROM and I disabled vosf and jit and still got a very rare hang on startup but I didn't capture the dump. The restart problem is very easy to reproduce.

kanjitalk755 commented 11 months ago

Fixed. Please let me know if you can reproduce this issue with the latest version.