Broken Jit Compiler

About SheepShaver, a PPC Mac emulator for Windows, MacOS X, and Linux that can run System 7.5.3 to MacOS 9.0.4.

Moderators: Cat_7, Ronald P. Regensburg, ClockWise

Post Reply
User avatar
Cat_7
Expert User
Posts: 6179
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Broken Jit Compiler

Post by Cat_7 »

Does anyone know how to correct the broken jit compiler?

I constantly use the latest cvs build, both on Mandrake 10 official and Suse 9.0, but without success ;-)

Best wishes

Cat_7
Gwenole

Post by Gwenole »

If you don't explain the problem clearly in a reproductible way, it can't be solved. Some useful information include:
- the exact date of the CVS snapshot
- the compiler options you used (CXXFLAGS)
- the compiler version you used (I assume gcc-3.3.2-6mdk)

BTW, if you use the binary provided in Mandrakelinux 10.0, the cxmon debugger is built-in and you can play with it when it crashes, e.g. dump "regs" output.
User avatar
Cat_7
Expert User
Posts: 6179
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

system configuration

Post by Cat_7 »

Hi Gwenole,

Here are some specs, and, for what it's worth: I run as root.

GCC version:
Reading specs from /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/specs
Configured with: ../configure --prefix=/usr --libdir=/usr/lib --with-slibdir=/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --enable-long-long --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++,ada,f77,objc,java,pascal --host=i586-mandrake-linux-gnu --with-system-zlib
Thread model: posix
gcc version 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)

CXXFLAGS:
from make file
CXXFLAGS = -g -O2 -I/usr/X11R6/include -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/X11R6/include

CVS date 03-06-2004

SheepShaver Config file:
disk /SheepShaver/System85
extfs /
windowmodes 3
screenmodes 0
seriala /dev/tts/0
serialb /dev/tts/1
rom /SheepShaver/Mac_OS_ROM_1.0_update
bootdrive 0
bootdriver 0
ramsize 134217728
frameskip 1
gfxaccel true
nocdrom false
nonet false
nosound false
nogui false
noclipconversion false
ignoresegv true
jit true
jit68k true
keyboardtype 5
keycodes false
mousewheelmode 1
mousewheellines 3
dsp /dev/sound/dsp
mixer /dev/sound/mixer
ignoresegv true
idlewait true

about mdk 2.2.11 rpm:
it gives me an segmentation fault when the jit compiler is selected:
SheepShaver V2.2 by Christian Bauer and Mar"c" Hellwig
Reading ROM file...
Using /dev/sound/dsp audio output
PowerPC CPU emulator by Gwenole Beauchesne
Segmentation fault (core dumped)

When I disable the jit compiler it gives:
Illegal instruction at 40810000, opcode = 4cdf1808
?
[00000000]->


Cat_7
Gwenole

Post by Gwenole »

Here are several independent tests you may want to take:
- set "ignoresegv" to "false", so that you could get the real initial SIGSEGV
- In sysdeps.h, try to set PPC_REENTRANT_JIT to 1 and rebuild
- In sysdeps.h, try to set DYNGEN_ASM_OPTS to 1 and rebuild ppc-dyngen-ops.cpp (remove obj/ppc-dyngen-ops.o and make)
- In sysdeps.h, try to set DYNGEN_DIRECT_BLOCK_CHAINING to 0 and rebuild

It's pretty strange it crashes when trying to execute code at 0x40810000. In rsrc_patches.cpp, around line 328, can you try to put another fake address, e.g. (((uint32)fake) >> 16), and (((uint32)fake) & 0xffff). Where fake is defined as static const uint8 fake[4096].

As for 2.2-11mdk, it's unfortunate but it was broken at some extent, I will upload a new one next week.
ShadowFox
Tinkerer
Posts: 70
Joined: Thu Feb 05, 2004 4:41 am
Location: Connecticut

Post by ShadowFox »

Over here adding #define DYNGEN_DIRECT_BLOCK_CHAINING 0 to sysdeps.h and recompiling did the trick! SheepShaver boots fine with JIT enabled! It's also very speedy, even at a 60Hz refresh rate! Also seems very stable, with virtually no stuttering as I've experienced with previous builds. (In the pre-built binaries I used before, SheepShaver would hang for a second or two, hesitating to perform an operation, then continuing on, until it ultimately froze completely, but all seems well with this build).
Post Reply