[Solved]Help bring a Guile game to live

Hi

I am working on a game

Now I am stuck at debug it because the segment fault:

Could someone in the community guide?

Thank you.

Have you tried using a debugger? Also, a coredump would be more helpful than a stacktrace.

That being said, how would one reproduce the issue? Could you add the complete step and required packages? That would reduce the friction for contributors :slight_smile:

Looking through the savannah repo - the sources are pretty old (2008-2012). It’s likely written targeting guile 2 or likely even an earlier release. Are you trying to run it with guile 3?

This is a guess. The code uses sdl1.2 and (use-modules (system foreign)) is used for the bindings. Maybe that part of the code could be replaced by using guile-sdl2.

The compile and build follows:

  1. ./configure
  2. make

run it
cd src
./ballandpaddle

The crash happenes right after.

I could not make Guile debugger work for it so I got the strace and put it in the issue.

I have tried both Guile 2 and Guile 3. The result is the same.

It used to run for Guile 3 under Debian GNU/Linux 10, and now it crashes in Debian 11.

sdl1.2 and sdl2 are not compatible, and it is not straight to make the change.
The game used to work under sdl1.2 and Debian GNU/Linux 10 so to make it work at sdl1.2 and Debian 11 should be the first step.

In your s-trace it says right before the SIGSEGV you don’t have the splash asset at the expected path:

openat(AT_FDCWD, "/usr/share/ballandpaddle/images/splash.png", O_RDONLY) = -1 ENOENT (No such file or directory)

Looking at the scheme code it has hard coded paths to /usr/share that aren’t injected using autoconf. I copied the assets to the right spot it started for me.

ballandpaddle is just a scheme file. To debug it - you can start guile and load that file manually into the REPL . Alternatively, you can also start guile via gdb then load it and you’ll get at least a partial backtrace into the FFI. That points to SDL_DisplayFormatAlpha which coincides with a image loading. The game doesn’t appear to test if assets exist before trying to load them.

2 Likes

Thank you very much.
Now I have I know how to debug it.

This issue can be considered closed.