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

[APP BUG]: Locally built Qt versions after PR #2138 segfault on opening the GUI on Linux #2143

Open
1 of 2 tasks
kalaposfos13 opened this issue Jan 13, 2025 · 2 comments
Open
1 of 2 tasks

Comments

@kalaposfos13
Copy link
Contributor

kalaposfos13 commented Jan 13, 2025

Checklist

  • I have searched for a similar issue in this repository and did not find one.
  • I am using an official build obtained from releases or updated one of those builds using its in-app updater.

Describe the Bug

With the new SDL library change, the Qt GUI initialization segfaults here:

m_mediaPlayer = new QMediaPlayer(this);

This does not happen with the downloaded appimages.

Reproduction Steps

Build the latest release on Linux, and open the app.

Expected Behavior

The app opens normally

Specify OS Version

Linux Mint 22

@morten71
Copy link

morten71 commented Jan 14, 2025

I got this problem too. My problem came from the recent update of SDL3:

The crash happens, when QT calls g_signal_connect_data or g_object_unref from libgdk at startup. Those 2 names are declared in externals/sdl3/src/tray/unix/SDL_tray.c lines 56 and 57 because SDL3 loads libgdk on its own at startup, and calls the 2 functions through its own pointers.

To me it looks like QT ends up calling those 2 functions through SDL3's function pointers, which is pretty bonkers, and I am not 100% sure this is actually what happens. But the problem is definitely fixed, when I rename those 2 pointers in the SDL_tray.c file.

So basically I just run these 2 sed scripts on SDL_tray.c:

s/g_signal_connect_data/g_signal_connect_data_tmp/
s/g_object_unref/g_object_unref_tmp/

And that fixes it for me.

Only thing is I don't remember if my crash happened in the same line as your crash. But my guess is it's probably caused by the same thing. There are other function pointers that SDK3 declares in the same file, so if renaming the 2 I had problems with doesn't work for you, maybe try renaming the rest of them too.

Edit: Just reverted my changes to check my crash, and it definitely happens much earlier than yours. My backtrace looks like this, so it's already in the QApplication constructor call:

#0  0x0000555557536b58 in g_signal_connect_data ()
#1  0x00007fffe3a0fa2c in ??? () at /usr/lib64/qt6/plugins/platformthemes/../../../libgtk-3.so.0
#2  0x00007fffe39f0b7b in ??? () at /usr/lib64/qt6/plugins/platformthemes/../../../libgtk-3.so.0
#3  0x00007ffff4ac2e0a in g_option_context_parse () at /usr/lib64/libglib-2.0.so.0
#4  0x00007fffe39f0834 in gtk_parse_args () at /usr/lib64/qt6/plugins/platformthemes/../../../libgtk-3.so.0
#5  0x00007fffe39f08aa in gtk_init_check () at /usr/lib64/qt6/plugins/platformthemes/../../../libgtk-3.so.0
#6  0x00007fffe39f08fd in gtk_init () at /usr/lib64/qt6/plugins/platformthemes/../../../libgtk-3.so.0
#7  0x00007fffe811284c in ??? () at /usr/lib64/qt6/plugins/platformthemes/libqgtk3.so
#8  0x00007fffe810bb7a in ??? () at /usr/lib64/qt6/plugins/platformthemes/libqgtk3.so
#9  0x00007ffff23b4cd7 in QPlatformThemeFactory::create(QString const&, QString const&) () at /usr/lib64/libQt6Gui.so.6
#10 0x00007ffff236fe3b in ??? () at /usr/lib64/libQt6Gui.so.6
#11 0x00007ffff2372fe3 in QGuiApplicationPrivate::createPlatformIntegration() () at /usr/lib64/libQt6Gui.so.6
#12 0x00007ffff2373a68 in QGuiApplicationPrivate::createEventDispatcher() () at /usr/lib64/libQt6Gui.so.6
#13 0x00007ffff1f29cff in QCoreApplicationPrivate::init() () at /usr/lib64/libQt6Core.so.6
#14 0x00007ffff2376175 in QGuiApplicationPrivate::init() () at /usr/lib64/libQt6Gui.so.6
#15 0x00007ffff70ecd4d in QApplicationPrivate::init() () at /usr/lib64/libQt6Widgets.so.6
#16 0x0000555555b5ebd9 in main ()

@kalaposfos13
Copy link
Contributor Author

It has been confirmed by Varringard on Discord, that for some setups, the appimages are broken, too. They seem to be crashing much later than either me or @morten71 though, it happens while the games are loading. Discord message link to the video showing it, scroll down to see that it is indeed fixed by going back to a previous version.

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

2 participants