[hatari-devel] Wrong bus error stack frame with 68000 and JSR

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

the following bug report is probably something for Toni, but I don't
know how to reach him.

I investigated why Spectre (the Mac emulator) crashes under Hatari. This
has been reported before, but never resolved or investigated in detail
as far as I can see:
https://www.atari-forum.com/viewtopic.php?p=451553#p451553

I have found out that it crashes while handling an expected bus error,
because the stack frame is different on Hatari compared to a real 68000.

Consider the case where a JSR is executed to a target address that
causes a bus error. This happens on the emulated Macintosh, when
something tries to jump into the Mac ROM above 0x400000. Spectre has
code to handle this, but it chokes on the incorrect stack frame.

A test program is attached, as well as results from a real 68000 (.jpg)
and from Hatari's 68000 emulation (.png). As you can see, on Hatari the
stacked PC is the address that causes the exception (0x401234 in my test
program), i.e., *after* the JSR. Whereas on the real 68000 the stacked
PC is still in ST-RAM, i.e., *before* the JSR.

Note that this is not a regression. A similar crash is observed with
Hatari 2.4. Nevertheless, I think it should be fixed.

Regards
Christian
--
Christian Zietz  -  CHZ-Soft  -  czietz@xxxxxxx
WWW: https://www.chzsoft.de/
New GnuPG-Key-ID: 0x8708B34C827B159E

Attachment: grab0001.png
Description: PNG image

Attachment: IMG_6010.JPG
Description: JPEG image

Attachment: berr_jsr.zip
Description: Zip compressed data



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/