AZO234 / NP2kai

Neko Project II kai
http://domisan.sakura.ne.jp/article/np2kai/np2kai.html
MIT License
246 stars 61 forks source link

Saving state causes segfault in xnp21kai #151

Open DestyNova opened 1 year ago

DestyNova commented 1 year ago

I checked out the latest version (commit 2b09ea6a589cdcae27bca27160b3f82638fbb45d) and installed sdlnp21kai and xnp21kai.

xnp21kai works, but exits with a segfault when I try to make a savestate (either from the "Stat" or "Debug" menus).

Here's the backtrace captured by gdb:

Thread 1 "xnp21kai" received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in  ()
#1  0x00005555555f1854 in flagsave_com (tbl=<optimized out>, tbl=0x555555751de0 <np2tbl+1312>, sfh=0x5555571627d0) at /home/omf/emu/pc98/NP2kai/statsave.c:1416
#2  statsave_save_d () at /home/omf/emu/pc98/NP2kai/statsave.c:1594
#3  0x000055555569fdb5 in mainloop (p=<optimized out>) at /home/omf/emu/pc98/NP2kai/x/np2.c:351
#4  0x00007ffff7eb9c24 in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff7f0e6f8 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#6  0x00007ffff7eb9293 in g_main_loop_run () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#7  0x00007ffff79dc2d2 in gtk_main () at /lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#8  0x00005555556b93d3 in gui_gtk_widget_mainloop () at /home/omf/emu/pc98/NP2kai/x/gtk2/gtk_main.c:337
#9  0x0000555555587330 in main (argc=<optimized out>, argv=<optimized out>) at /home/omf/emu/pc98/NP2kai/x/main.c:441

sdlnp21kai works, but can't upscale the screen so it's too hard to see what's happening on my laptop...

DestyNova commented 1 year ago

The line that seems to cause the segfault in statsave.c is this:

        flag = (COMFLAG)cm->msg(cm, COMMSG_GETFLAG, 0);

The device it's trying to save flags for is cm_rs232c, which is non-null.

eadmaster commented 1 year ago

same here an Android libretro.