[hatari-devel] Wrong bus error stack frame with 68000 and JSR |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: [hatari-devel] Wrong bus error stack frame with 68000 and JSR
- From: Christian Zietz <czietz@xxxxxxx>
- Date: Tue, 19 Mar 2024 21:45:03 +0100
- Autocrypt: addr=czietz@xxxxxxx; keydata= xsFNBGMHkrYBEACc4fljFVcoEo+DzmhTRd8pOfnj39wkNL+VEIzUpz5OfxFNx/KYWhtHxLN9 VWD3rojS5ww3bNgWiYdqDLisuaO6jLXZ7JNBQU3ruJg+g4iCuwfwFf/tVAHvMCr5U/ibiE94 VZuHs6yYJnXHuKrZEBzWQTEPHltqFLVq+cr4dzMV14SIWP8/OnUCaQeeCE1jdh8itXw75Cv9 Bc4wqhT1eU75WmcUwJ1hNrwZm6M2acFoABmZL0CWm0L8+7PXDgZXlwyNoWuPoupjuAvjsdsY 5x+uWtfyufrC/auTcc7LKiAxRQcZ/ABtLhnAa13Su4BsrVwJIxFIGDrZe/CpX48CvYdWljQF JqElP5ShsaM01odrLhmS8OreMEODo6Vhr3zqs3wUA/bl8gEkxDbSz0LewqC07sajTiYIVABW bVWkyn2T8JANSbtVV9YgUnbK+CsMckruarab1iSrTBB+aTvK5TN7LP4iKHaXfZAbq5wtQfXe yrvyPjkbmzvbYb+lnVe24fqLQS1RVB6p/LGAkKFBT1SjEQWVtzVIiAAlbjhRxIsdOqJK1kl/ 6GyQyGfUlPByUETzzFKe6qcCtQlUZPwd7vquryw+3PSVkhL9PiEtUSMiOIVpRzfomxwKXNGT avDoYjTZL1ROuzQYfL+ekpGu4Ti53GGxagxJT1tBhon1qUkMwwARAQABzSBDaHJpc3RpYW4g WmlldHogPGN6aWV0ekBnbXgubmV0PsLBkQQTAQgAOxYhBElYYBdDcemT9uBa0ocIs0yCexWe BQJjB5K2AhsDBQsJCAcCAiICBhUKCQgLAgQWAgMBAh4HAheAAAoJEIcIs0y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6pQEdIuaAy8=
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1710881106; x=1711485906; i=czietz@xxxxxxx; bh=kfeQwtoHx/o5vL4UYbK3ugwN5fxnu9eek2AR7+GB+08=; h=X-UI-Sender-Class:Date:To:From:Subject; b=OWmwD2AzLFM1TQ2NzPaiiax1JzWxAWeGH3gVF+Ak1Zm/zJF7UwNO9s4QbdcgPmHb cb94/SxgablFKXePcFnH91jzMa4sj9VXAM9Hr5o/vgD85+VAD79C3IWAjqfqh9JXM VKsjs9b2CaMU+ZOhHvkCxGfjBn3cxMrI2GREOEcBqOzNH+v/YQkzYomgfojdml30J tr5F85MBPBAg3uTCEIxuhBX6NT7QcSUcaPjVAEUW1LDnvdBbeWFNstC4fxY9Xs9Cr FAg5oup4a2q81JtjIpvwOMwqPnvIr4xUdZvw3wLEDKH6w0f2SHbbtHg9oj6eUYs9H cRkxNuZUkOS3mWB3qw==
- Ui-outboundreport: notjunk:1;M01:P0:cEHVvWuQbx4=;OPwdChdxrrpZUUXWB9Kl2njh/ct 8X01/wMTmYeN3ZoXjCCRM60JrTBeoluGIk2eAIcXY6yao5vkIP9CI0Ao1r2ZIO3SN50uQky5N C6H0lH0wxUw6J/7NI3wJEz9vO940aZfSbGTpp8E6NwHsp7MP8vFgLUr3YvNr4D6iBlEYFzSne 8eBso6J19X9y1bisg1k1ycYHJ8+10hDKq4DFkzPCyt/76m2+yQtHSmPgCZlqmkM7NhC940c3Z pYEsxFM9a4QALOjJT8z7yCnCuGyQABrbxI44vQEHJ9fIiHLWMh4r9C+M/eM/xw8v7Fyjdqiyy JPUmDhq1d/GizSf3QNZhOSKvp3PGcKUf3cWroD2uDJ+cd87gT6jCNi9dSlpTGoNKoSzGySSU/ tkkU+wjKafXKoSnFYEEZTFuPmiP7GukEq0Sb9xFYmnwLA64ewgehg31ZZb633POKil4np9Arb JVxqWuvcHdop8HDvdaEUqUqRp6A4+wvesKfXW0Cbdpst/MS1LbL55Jba/0IJ10Cs6HUP2fvVW a3d4Er9chFWp1BYGSq5XhbGvL8NuD94sOYznOSK+C8PxmG5rJFG0bav0px9/ydFEDMHcDkRl3 lIievBKJBblDAkhBnDGS/U0KL9LTcABvicrhCZBNa71/cWd8nZzSANTUC8robLGMRRcsr5JmA ViKggexLvqe9huWlhuM2JlIdZjiQObBCaz754uduu0CV7SEd2tWaiSTblaeWnJPmjeE9zbEuw eK5zF3mULVRL3JGMCZj2Mj4qkeZTp2kOoSBgRoQjzOUGA65BYRJCHJvhr8moKwYQLGXrkt12a 48D4paydrltyJmg76efVLscKaCzr1JIrOh2HWAY4dOobQ=
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