kanjitalk755 / macemu

Basilisk II and SheepShaver Macintosh emulators
347 stars 53 forks source link

Basilisk ii: debug build works, release build crashes on boot #138

Closed jariseon closed 2 years ago

jariseon commented 2 years ago

i'm exploring SCC chip emulation in Basilisk ii, and got to a point where at least MIDI apps work through it. however, release build crashes upon boot. all is fine in debug, and also in release build if i tick "Debug Application" checkbox in XCode.

then noticed that the crash also happens with the latest master branch, without my modifications. i can briefly see happy mac icon before the crash. it always happens at same point, pls see log below. since "debug works release doesn't" is often related to timing issues, is there a way to postpone m68k emulation startup? any ideas most welcome. thanks!

Host: OSX Mojave, SDL 2.0.22, PERFORMA.ROM, USE_JIT=1

Basilisk II V1.1 by Christian Bauer et al.
WARNING: Unknown preferences keyword 'dsp'
WARNING: Unknown preferences keyword 'mixer'
2022-08-13 17:40:02.584863+0300 BasiliskII[20305:5221968]   saved enable noise cancellation setting is the same as the default (=0)
Reading ROM file...
selected Ethernet device type slirp
Using SDL/coreaudio audio output
2022-08-13 17:40:02.702332+0300 BasiliskII[20305:5221972] MessageTracer: load_domain_whitelist_search_tree:73: Search tree file's format version number (0) is not supported
2022-08-13 17:40:02.702372+0300 BasiliskII[20305:5221972] MessageTracer: Falling back to default whitelist
Using SDL_Renderer driver: metal
Caught SIGSEGV at address 0x105aeeff5
D0: 00000000 D1: 00000b24 D2: 00001380 D3: 00000b30 
D4: 00000850 D5: 10000000 D6: 00000000 D7: 0800fb01 
A0: 000021c4 A1: 00000000 A2: 000021c4 A3: fc401000 
A4: 00001f4c A5: 0800fd90 A6: 00002000 A7: 0800fae2 
USP=00000000 ISP=0800fae2 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
1000e90e: 175f fff5 4cdf 0f7e 4e75 MOVE.B (A7)+,(A3,$fff5) == $fc400ff5
next PC: 1000e912
jariseon commented 2 years ago

managed to repro the crash also in debug build with these steps:

basilisk then crashes with the same symptoms as described above for the release build. hope this gives more insight to the issue!

jariseon commented 2 years ago

got it working by removing JIT and USE_JIT=1 from preprocessor definitions (as was done in no_jit branch). forgot to mention that in preferences jit was set to false: would love to make the chip emulation jit-compatible, but that needs to wait until i get VIA chip supported as well.

pls feel free to close the issue and sorry about the noise!