dborth / snes9xgx

Snes9x GX - Port of Snes9x for Wii
http://wiibrew.org/wiki/Snes9x_GX
Other
437 stars 64 forks source link

freetype from devkitpro portlibs causes a crash #948

Closed wii4master closed 4 years ago

wii4master commented 4 years ago

Latest version crashes when wiimote wakes up. 'git revert 66da7346b94a15fee432a0a0ac4a54aed11ac162' fixes the issue.

To Reproduce Steps to reproduce the behavior:

  1. Run any game.
  2. Press HOME twice (to open and close the menu).
  3. Remove the batteries from the wiimote.
  4. Wait 5-10 seconds.
  5. Put the batteries back in.
  6. Press any buttons.
  7. Enjoy the "Exception (DSI) occurred!" message.
dborth commented 4 years ago

I haven't been able to reproduce this so far. Is the crash when playing the game or in the menu?

dborth commented 4 years ago

snes9xgx-wii.zip

Can you take a picture of the DSI screen with this build so I can get the stack trace?

wii4master commented 4 years ago

The crash happens when HOME or A button is pressed right after wiimote wakes up while playing the game.

I was not able to reproduce the crash with that build either. I'm using 3f0e3a6b902285d22162f5bb0d2c3b25e32da2ec version of snes9xgx with libogc-2.1.0-1 (installed with pacman) on Mac if it makes any difference. Attaching the screenshot of the crash using my build just in case fr_1441

dborth commented 4 years ago

I won't be able to get a stacktrace unless you attach the ELF you built here. Or you could try to get it yourself by running:

powerpc-eabi-addr2line -e snes9xgx-wii.elf 8024c2b0 8023b664 802400c4 80246008 80005118 802479f4 80261990 8025c5ec 8000469c

Have you replaced your freetype with an older version? You need to replace the freetype lib with these: https://github.com/dborth/snes9xgx/tree/master/buildtools

wii4master commented 4 years ago

I built it with the latest libogc (5cf144f). This looks like a memory corruption, so stacktrace is not very helpful.

$ /opt/devkitpro/devkitPPC/bin/powerpc-eabi-addr2line -e executables/snes9xgx-wii.elf 8024b254 8023aef0 8023f574 802454b8 80005118 80246ea4 8025fad8 8025a88c 8000469c
libogc/libogc/lwp_heap.c:136
libogc/wiiuse/io.c:61
wii/libogc/lwbt/bte.c:321
libogc/lwbt/l2cap.c:886 (discriminator 1)
??:?
libogc/lwbt/physbusif.c:89
libogc/libogc/usb.c:259 (discriminator 1)
wii/libogc/libogc/ipc.c:771
irq_handler.o:?

I have not replaced freetype lib yet. Will try it next.

dborth commented 4 years ago

I agree, it's memory corruption. But it's caused by freetype and not by that particular commit. This has been a known issue for a long time. It's been discussed here - https://devkitpro.org/viewtopic.php?t=9091

wii4master commented 4 years ago

Replacing freetype fixes the issue, thanks!

I'm just wondering if this can be integrated into Makefile to workaround the issue?

dborth commented 4 years ago

it's integrated into the CI...not sure how to have the build pull in a remote file like that.

wii4master commented 4 years ago

This quick hack works for me.

+LDFLAGS+=      -L../buildtools
dborth commented 4 years ago

You're completely right, I don't know why I didn't think about that.

I've added that.