Segmentation fault running PlaydateSimulator on Linux

Hi,
I'm unable to run the PlaydateSimulator on my machine. The desktop app won't open and when I try to run it from the bin/ directory in the SDK i get:

$ ./PlaydateSimulator 
09:12:16: Debug: SimulatorApp::OnInit()
09:12:16: Debug: Vendor Name: [Panic] [Panic]
09:12:16: Debug: App Name: [Playdate Simulator] [Playdate Simulator]
09:12:16: Logging started [2022-03-01T09:12:16]
09:12:16: Logging to [/home/leon/.Playdate Simulator/Playdate Simulator.log]
09:12:16: GetExecutablePath: /home/leon/PlaydateSDK-1.9.0/bin/PlaydateSimulator
09:12:16: GetAppDocumentsDir: /home/leon/Documents
09:12:16: GetUserDataDir: /home/leon/.Playdate Simulator
09:12:16: GetUserLocalDataDir: /home/leon/.Playdate Simulator
09:12:16: PDX Version 10500
09:12:16: Default SDK Directory: /home/leon/PlaydateSDK-1.9.0
09:12:16: SetupSimulator
09:12:16: Virtual Disk: /home/leon/PlaydateSDK-1.9.0/Disk
09:12:16: soundDevice: 0
09:12:16: recordDevice: 0
[1]    518479 segmentation fault  ./PlaydateSimulator

Any hints on what i can do to make it work ?

OS: Debian GNU/Linux bookworm/sid x86_64

Thank you :playdate_happy:

I have the same experience. My understanding so far is that the PlaydateSimulator binary ships with a built-in libpng, and the symbols get picked up by the system's libgdk, with an incompatible ABI.

Depending on how PlaydateSimulator, it could instead be rebuilt using a libpng with different symbol names to avoid conflicts: https://github.com/winlibs/libpng/blob/master/INSTALL#L223

1 Like

Wow this is deeper than I imagined.... Were you able to fix the problem using this method?

I don't feel comfortable enough to rebuilt the PlaydateSimulator myself. Maybe we can hope that it will be patched in a next version?

We cannot rebuild PlaydateSimulator, as we are not provided with its source code.

I tried using libs (libgtk-3, libgdk-pixbuf, libpng, libjpeg) from ubuntu 20.04 but could not get it to work either, libgdk-pixbuf seem tricky. My attempt failed approximately at the same place (libgdk-pixbuf trying to load an icon), but it failed in a slightly different way:

(PlaydateSimulator:40187): Gtk-WARNING **: 20:25:56.584: Could not load a pixbuf from icon theme.
This may indicate that pixbuf loaders or the mime database could not be found.
**
Gtk:ERROR:../../../../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /usr/share/icons/Adwaita/16x16/status/image-missing.png: Fatal error reading PNG image file: Invalid IHDR data (gdk-pixbuf-error-quark, 0)
Bail out! Gtk:ERROR:../../../../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /usr/share/icons/Adwaita/16x16/status/image-missing.png: Fatal error reading PNG image file: Invalid IHDR data (gdk-pixbuf-error-quark, 0)
Aborted

ok I have found a solution which is an absolutely horrifying hack, but it works. Brace yourself.

sed -i s/png_/PNG_/g bin/PlaydateSimulator

5 Likes

it works! bravo for finding this hack and thanks a lot for sharing it!

Thanks for the report, we'll get this sorted out for the next release.

3 Likes

Would you mind trying this build and let me know if it launches for you?

Sorry, I did not see this earlier. This works for me!

Awesome, thanks for letting me know.