tomm / fab-agon-emulator

Agon Light, Agon Light 2, Agon Console8 Emulator for Linux, Windows, any system with libSDL
GNU General Public License v3.0
87 stars 19 forks source link

Emulator crashes running my plasma program #56

Closed jblang closed 2 months ago

jblang commented 5 months ago

I am working on a plasma demo for Agon: https://github.com/jblang/z80demos. The plasma.bin or test.bin binary on that repo will reproduce the crash. The crash only occurs when building from Github main, and only on Linux (Ubuntu 22.04 on WSL2 in my case). The backtrace from gdb is as follows:

0x00007ffff6ee1360 in Context::cursorCR (this=0x7fffe8029000, cursor=0x83008200810080, viewport=0x93009200910090) at vdp-console8/video/context/cursor.h:465
465                     cursor->X = cursorBehaviour.invertHorizontal ? (viewport->X2 + 1 - getFont()->width - getXAdjustment()) : viewport->X1;
(gdb) bt 10
#0  0x00007ffff6ee1360 in Context::cursorCR (this=0x7fffe8029000, cursor=0x83008200810080,
    viewport=0x93009200910090) at vdp-console8/video/context/cursor.h:465
#1  0x00007ffff6ee13d7 in Context::cursorHome (this=0x7fffe8029000, cursor=0x83008200810080,
    viewport=0x93009200910090) at vdp-console8/video/context/cursor.h:475
#2  0x00007ffff6ee13a4 in Context::cursorHome (this=0x7fffe8029000)
    at vdp-console8/video/context/cursor.h:472
#3  0x00007ffff6ef7464 in VDUStreamProcessor::vdu (this=0x7fffe8028f70, c=30 '\036', usePeek=true)
    at vdp-console8/video/vdu.h:169
#4  0x00007ffff6ee895e in VDUStreamProcessor::processAllAvailable (this=0x7fffe8028f70)
    at vdp-console8/video/vdu_stream_processor.h:372
#5  0x00007ffff6eede58 in VDUStreamProcessor::bufferCall (this=0x7fffe8028f70, callBufferId=65535,
    offset=...) at vdp-console8/video/vdu_buffered.h:292
#6  0x00007ffff6eecb94 in VDUStreamProcessor::vdu_sys_buffered (this=0x7fffe8028f70)
    at vdp-console8/video/vdu_buffered.h:33
#7  0x00007ffff6ef5da3 in VDUStreamProcessor::vdu_sys_video (this=0x7fffe8028f70)
    at vdp-console8/video/vdu_sys.h:276
#8  0x00007ffff6ef55f0 in VDUStreamProcessor::vdu_sys (this=0x7fffe8028f70)
    at vdp-console8/video/vdu_sys.h:81
#9  0x00007ffff6ef7396 in VDUStreamProcessor::vdu (this=0x7fffe8028f70, c=23 '\027', usePeek=true)
    at vdp-console8/video/vdu.h:144
(More stack frames follow...)

This same code runs fine on the real hardware, on the current release of the emulator (0.9.43), and on the latest build of the emulator on Windows.

sijnstra commented 2 months ago

I've tested this under the pre-compiled 0.9.55 and for me on Win it crashed immediately. I've also now tried it under the pre-compiled 0.9.57 and it did not crash. Could it be related to this fix?

Fix VDP crash when defining characters >127

tomm commented 2 months ago

yeah the plasma.bin crash is fixed in 0.9.57