Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arguments to dbus_type_is_basic() were incorrect #2639

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Closed

arguments to dbus_type_is_basic() were incorrect #2639

SDLBugzilla opened this issue Feb 11, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

Reported in version: 2.0.6
Reported for operating system, platform: Linux, x86_64

Comments on the original bug report:

On 2017-09-29 12:56:54 +0000, Aaron wrote:

As of 2.0.6, all of my games are failing with the following error:

process 31778: arguments to dbus_type_is_basic() were incorrect, assertion "dbus_type_is_valid (typecode) || typecode == DBUS_TYPE_INVALID" failed in file dbus-signature.c line 322.
This is normally a bug in some application using the D-Bus library.
D-Bus not built with -rdynamic so unable to print a backtrace

This can be worked around by compiling with --disable-dbus.

On 2017-09-29 18:47:14 +0000, Ozkan Sezer wrote:

Reproduced this on Fedora 20 / x86_64: running the checkkeys test
against a newly built SDL2 fails:
$ LD_LIBRARY_PATH=$HOME/opt/SDL2/lib ./checkkeys
process 12645: arguments to dbus_type_is_basic() were incorrect, assertion "dbus_type_is_valid (typecode) || typecode == DBUS_TYPE_INVALID" failed in file dbus-signature.c line 322.
This is normally a bug in some application using the D-Bus library.
D-Bus not built with -rdynamic so unable to print a backtrace
Aborted (core dumped)

On 2017-09-29 19:52:21 +0000, Ozkan Sezer wrote:

The issue seems to have started with changeset 11042
by Ryan: https://hg.libsdl.org/SDL/rev/303c875e47f0

Rev. 11041 does not have this issue.

On 2017-09-30 11:45:45 +0000, Ozkan Sezer wrote:

This issue has been reported to RedHat/Fedora, too :
https://bugzilla.redhat.com/show_bug.cgi?id=1496895

On 2017-09-30 17:01:24 +0000, Sam Lantinga wrote:

Ryan, this is a critical bug affecting Steam as well. Can you fix ASAP?

Thanks!

On 2017-10-01 12:53:14 +0000, Silvan wrote:

I can confirm this issue on Arch Linux as well. Please find a stacktrace below.

process 3729: arguments to dbus_type_is_basic() were incorrect, assertion "dbus_type_is_valid (typecode) || typecode == DBUS_TYPE_INVALID" failed in file dbus-signature.c line 322.
This is normally a bug in some application using the D-Bus library.
D-Bus not built with -rdynamic so unable to print a backtrace

Program received signal SIGABRT, Aborted.
0x00007ffff77088a0 in raise () from /usr/lib/libc.so.6
(gdb) bt

0 0x00007ffff77088a0 in raise () from /usr/lib/libc.so.6

1 0x00007ffff7709f09 in abort () from /usr/lib/libc.so.6

2 0x00007ffff495d8a7 in ?? () from /usr/lib/libdbus-1.so.3

3 0x00007ffff49543e7 in _dbus_warn_check_failed () from /usr/lib/libdbus-1.so.3

4 0x00007ffff494f4ed in dbus_type_is_basic () from /usr/lib/libdbus-1.so.3

5 0x00007ffff4946863 in dbus_message_append_args_valist () from /usr/lib/libdbus-1.so.3

6 0x00007ffff7b8414c in SDL_DBus_CallVoidMethodInternal (ap=0x7fffffffd870, method=0x55555578bb40 "\001",

interface=0x7ffff7ba5c80 <IBUS_INPUT_INTERFACE> "org.freedesktop.IBus.InputContext", path=<optimized out>,
node=0x7ffff7ba5cf0 <IBUS_SERVICE> "org.freedesktop.IBus", conn=0x55555578ff70) at /home/silvan/build/SDL2-2.0.6/src/core/linux/SDL_dbus.c:220

7 SDL_DBus_CallVoidMethodOnConnection (conn=0x55555578ff70, node=node@entry=0x7ffff7ba5cf0 <IBUS_SERVICE> "org.freedesktop.IBus", path=,

interface=interface@entry=0x7ffff7ba5c80 <IBUS_INPUT_INTERFACE> "org.freedesktop.IBus.InputContext", method=method@entry=0x7ffff7ba5baf "FocusOut")
at /home/silvan/build/SDL2-2.0.6/src/core/linux/SDL_dbus.c:240

8 0x00007ffff7b851c6 in IBus_SimpleMessage (method=0x7ffff7ba5baf "FocusOut") at /home/silvan/build/SDL2-2.0.6/src/core/linux/SDL_ibus.c:482

9 SDL_IBus_SetFocus (focused=) at /home/silvan/build/SDL2-2.0.6/src/core/linux/SDL_ibus.c:490

10 IBus_SetupConnection (dbus=dbus@entry=0x7ffff7dd7480 ,

addr=addr@entry=0x55555578bcb0 "unix:abstract=/tmp/dbus-OWLLq6hr,guid=ccac163e8d8b220cedc3577559d09fe4")
at /home/silvan/build/SDL2-2.0.6/src/core/linux/SDL_ibus.c:346

11 0x00007ffff7b852f4 in SDL_IBus_Init () at /home/silvan/build/SDL2-2.0.6/src/core/linux/SDL_ibus.c:436

12 0x00007ffff7b84836 in SDL_IME_Init () at /home/silvan/build/SDL2-2.0.6/src/core/linux/SDL_ime.c:91

13 0x00007ffff7b6f11a in X11_InitKeyboard (_this=_this@entry=0x555555759660) at /home/silvan/build/SDL2-2.0.6/src/video/x11/SDL_x11keyboard.c:410

14 0x00007ffff7b7710c in X11_VideoInit (_this=0x555555759660) at /home/silvan/build/SDL2-2.0.6/src/video/x11/SDL_x11video.c:446

15 0x00007ffff7b618e3 in SDL_VideoInit_REAL (driver_name=, driver_name@entry=0x0) at /home/silvan/build/SDL2-2.0.6/src/video/SDL_video.c:532

16 0x00007ffff7aa50d7 in SDL_InitSubSystem_REAL (flags=16928) at /home/silvan/build/SDL2-2.0.6/src/SDL.c:170

17 SDL_Init_REAL (flags=) at /home/silvan/build/SDL2-2.0.6/src/SDL.c:241

18 0x0000555555555350 in main (argc=, argv=0x7fffffffe5f8) at testjoystick.c:252

This line is most likely the culprit.

        if ((firstarg == DBUS_TYPE_INVALID) || dbus.message_append_args_valist(msg, firstarg, ap)) {

it looks like there would be an invalid type passed to dbus.message_append_args_valist.

On 2017-10-01 13:24:01 +0000, Ozkan Sezer wrote:

IBus_SimpleMessage() doesn't pass any vargars to SDL_DBus_CallVoidMethodOnConnection()
therefore it receives garbage I guess.

On 2017-10-01 13:36:15 +0000, Ozkan Sezer wrote:

The following patch fixes it for me: please review.

diff --git a/src/core/linux/SDL_ibus.c b/src/core/linux/SDL_ibus.c
--- a/src/core/linux/SDL_ibus.c
+++ b/src/core/linux/SDL_ibus.c
@@ -479,7 +479,7 @@ IBus_SimpleMessage(const char *method)
SDL_DBusContext *dbus = SDL_DBus_GetContext();

 if (IBus_CheckConnection(dbus)) {
  •    SDL_DBus_CallVoidMethodOnConnection(ibus_conn, IBUS_SERVICE, input_ctx_path, IBUS_INPUT_INTERFACE, method);
    
  •    SDL_DBus_CallVoidMethodOnConnection(ibus_conn, IBUS_SERVICE, input_ctx_path, IBUS_INPUT_INTERFACE, method, DBUS_TYPE_INVALID);
    
    }
    }

On 2017-10-01 15:07:02 +0000, Silvan wrote:

(In reply to Ozkan Sezer from comment # 7)

The following patch fixes it for me: please review.

diff --git a/src/core/linux/SDL_ibus.c b/src/core/linux/SDL_ibus.c
--- a/src/core/linux/SDL_ibus.c
+++ b/src/core/linux/SDL_ibus.c
@@ -479,7 +479,7 @@ IBus_SimpleMessage(const char *method)
SDL_DBusContext *dbus = SDL_DBus_GetContext();

 if (IBus_CheckConnection(dbus)) {
  •    SDL_DBus_CallVoidMethodOnConnection(ibus_conn, IBUS_SERVICE,
    

input_ctx_path, IBUS_INPUT_INTERFACE, method);

  •    SDL_DBus_CallVoidMethodOnConnection(ibus_conn, IBUS_SERVICE,
    

input_ctx_path, IBUS_INPUT_INTERFACE, method, DBUS_TYPE_INVALID);
}
}

I can confirm that this fixes the issue for me as well.

To me it looks like this would be the correct way to call SDL_DBus_CallVoidMethodOnConnection with no further arguments but somebody who is more familiar with that code should do a proper review.

On 2017-10-05 07:13:56 +0000, Ozkan Sezer wrote:

PING?

On 2017-10-05 16:37:49 +0000, Sam Lantinga wrote:

Fixed, thanks!
https://hg.libsdl.org/SDL/rev/dc7245e3d1f2

On 2017-10-05 16:38:00 +0000, Sam Lantinga wrote:

Marking fixed

On 2017-10-07 02:06:46 +0000, Ryan C. Gordon wrote:

*** Bug 3863 has been marked as a duplicate of this bug. ***

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant