Bug#1115705: libsdl3-0: 3.3.x regression: SDL_image's showimage example segfaults on s390x

Simon McVittie smcv at debian.org
Tue Sep 23 13:03:50 BST 2025


On Tue, 23 Sep 2025 at 11:02:06 +0000, Pranav P wrote:
>Instead of hard coding the values, this was what I had come up with.
>
>diff --git a/src/core/linux/SDL_progressbar.c b/src/core/linux/SDL_progressbar.c
>index ac0789b2d..8ec28eba7 100644
>--- a/src/core/linux/SDL_progressbar.c
>+++ b/src/core/linux/SDL_progressbar.c
>@@ -120,8 +120,8 @@ bool DBUS_ApplyWindowProgress(SDL_VideoDevice *_this, SDL_Window *window)
>
>     const char *progress_visible_str = "progress-visible";
>     const char *progress_str = "progress";
>-    int dbus_type_boolean_str = DBUS_TYPE_BOOLEAN;
>-    int dbus_type_double_str = DBUS_TYPE_DOUBLE;
>+    char dbus_type_boolean_str = DBUS_TYPE_BOOLEAN;
>+    char dbus_type_double_str = DBUS_TYPE_DOUBLE;

This is not correct. In message_iter_open_container(), DBUS_TYPE_VARIANT
needs to be followed by a pointer to a nul-terminated string, but C does 
not guarantee that an initialized 'char' variable will be followed in 
memory by a zero byte. (Perhaps the stack layout used by practical s390x 
compilers does guarantee this, but C, in general, does not.)

To make this correct you would have to use

     char dbus_type_boolean_str[] = { DBUS_TYPE_BOOLEAN, '\0' };

but it's simpler to use string constants like "b", or equivalently 
DBUS_TYPE_BOOLEAN_AS_STRING.

The numeric values of DBUS_TYPE_BOOLEAN, DBUS_TYPE_DOUBLE, etc. are 
chosen to match mnemonic ASCII characters ('b' and 'd' in this case), so 
it is safe to hard-code them as strings (and the SDL_portaldialog module 
already does this). Their numeric values are part of the D-Bus 
Specification, 
<https://dbus.freedesktop.org/doc/dbus-specification.html>.

Does the change that I proposed work? I've attached it in the form of a 
patch for easier testing. I'm hoping to upload it to experimental soon, 
but I've encountered some trouble with my usual test game (openarena) 
crashing my GNOME session when started - which I *think* is a GNOME 
regression rather than an SDL bug, but I need to investigate that before 
uploading.

     smcv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-progress-Correct-calls-to-dbus_message_iter_open_con.patch
Type: text/x-diff
Size: 3389 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-sdl-maintainers/attachments/20250923/06bde55d/attachment.patch>


More information about the Pkg-sdl-maintainers mailing list