indigodarkwolf / box16

A fork of the official X16 emulator, converted to C++20 and with a bunch of features tweaked and added.
MIT License
41 stars 19 forks source link

Bug: Emulator crash on linux when stepping into a read from $9F23 when Data0's address is $00000 and increment is negative #53

Closed mooinglemur closed 1 year ago

mooinglemur commented 1 year ago

Minimal test case:

    stz $9F20
    stz $9F21
    lda #$18
    sta $9F22
    stp                         ;press F10 here while execution is stopped in the debugger
    lda $9F23
    rts
*** buffer overflow detected ***: terminated
Aborted (core dumped)

For some reason it doesn't crash without the intervening STP instruction that invokes the emulator debugger.

Test case PRG: https://mooinglemur.com/x16/CRASHDEMO.PRG

indigodarkwolf commented 1 year ago

CRASHDEMO.zip

indigodarkwolf commented 1 year ago

Couldn't repro, followed up on Discord and it turned out that a make clean; make fixed the problem.