# \[Solved\]Help bring a Guile game to live

**URL:** <https://forum.systemcrafters.net/t/solved-help-bring-a-guile-game-to-live/664>\
**Category:** Programming\
**Tags:** guile\
**Created:** [May 9, 2024, 1:01pm UTC](https://forum.systemcrafters.net/t/solved-help-bring-a-guile-game-to-live/664 "2024-05-09T13:01:51Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![wxie](https://avatars.discourse-cdn.com/v4/letter/w/ee59a6/32.png) [@wxie](https://forum.systemcrafters.net/u/wxie)\
**Post date:** [May 9, 2024, 1:01pm UTC](https://forum.systemcrafters.net/t/solved-help-bring-a-guile-game-to-live/664/1 "2024-05-09T13:01:51Z")

</div>

Hi

I am working on a game

> **[BallandPaddle](https://codeberg.org/wxie/BallandPaddle)**
>
> This is a clone for the following project from GNU:
> https://savannah.gnu.org/projects/ballandpaddle/
> 
> The purpose is to move it to Guile 3.0 and SDL2.
> 
> This software is part of the GNU Project.
> 
> Ball and Paddle is an extensible ball and paddle game...

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

> **[BallandPaddle](https://codeberg.org/wxie/BallandPaddle/issues)**
>
> This is a clone for the following project from GNU:
> https://savannah.gnu.org/projects/ballandpaddle/
> 
> The purpose is to move it to Guile 3.0 and SDL2.
> 
> This software is part of the GNU Project.
> 
> Ball and Paddle is an extensible ball and paddle game...

Could someone in the community guide?

Thank you.

---

<div class="post-metadata">

**Author:** ![ashraz](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/ashraz/32/509_2.png) [@ashraz](https://forum.systemcrafters.net/u/ashraz)\
**Post date:** [May 9, 2024, 3:13pm UTC](https://forum.systemcrafters.net/t/solved-help-bring-a-guile-game-to-live/664/2 "2024-05-09T15:13:19Z")

</div>

> [@wxie](#):
>
> Could someone in the community guide?

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 🙂

---

<div class="post-metadata">

**Author:** ![DataDiode](https://avatars.discourse-cdn.com/v4/letter/d/db5fbb/32.png) [@DataDiode](https://forum.systemcrafters.net/u/DataDiode)\
**Post date:** [May 9, 2024, 4:11pm UTC](https://forum.systemcrafters.net/t/solved-help-bring-a-guile-game-to-live/664/3 "2024-05-09T16:11:12Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![mirkoh](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@mirkoh](https://forum.systemcrafters.net/u/mirkoh)\
**Post date:** [May 9, 2024, 8:19pm UTC](https://forum.systemcrafters.net/t/solved-help-bring-a-guile-game-to-live/664/4 "2024-05-09T20:19:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![wxie](https://avatars.discourse-cdn.com/v4/letter/w/ee59a6/32.png) [@wxie](https://forum.systemcrafters.net/u/wxie)\
**Post date:** [May 9, 2024, 9:30pm UTC](https://forum.systemcrafters.net/t/solved-help-bring-a-guile-game-to-live/664/5 "2024-05-09T21:30:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![wxie](https://avatars.discourse-cdn.com/v4/letter/w/ee59a6/32.png) [@wxie](https://forum.systemcrafters.net/u/wxie)\
**Post date:** [May 9, 2024, 9:33pm UTC](https://forum.systemcrafters.net/t/solved-help-bring-a-guile-game-to-live/664/6 "2024-05-09T21:33:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![wxie](https://avatars.discourse-cdn.com/v4/letter/w/ee59a6/32.png) [@wxie](https://forum.systemcrafters.net/u/wxie)\
**Post date:** [May 9, 2024, 9:35pm UTC](https://forum.systemcrafters.net/t/solved-help-bring-a-guile-game-to-live/664/7 "2024-05-09T21:35:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![DataDiode](https://avatars.discourse-cdn.com/v4/letter/d/db5fbb/32.png) [@DataDiode](https://forum.systemcrafters.net/u/DataDiode)\
**Post date:** [May 10, 2024, 2:31am UTC](https://forum.systemcrafters.net/t/solved-help-bring-a-guile-game-to-live/664/8 "2024-05-10T02:31:05Z")

</div>

> [@wxie](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![wxie](https://avatars.discourse-cdn.com/v4/letter/w/ee59a6/32.png) [@wxie](https://forum.systemcrafters.net/u/wxie)\
**Post date:** [May 10, 2024, 10:48am UTC](https://forum.systemcrafters.net/t/solved-help-bring-a-guile-game-to-live/664/9 "2024-05-10T10:48:36Z")

</div>

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

This issue can be considered closed.
