gtk segmentation faults in Qt4/Qt5 application upgraded to Red Hat 9
-
I'm attempting to get a Qt 4 application designed on Red Hat Enterprise Linux 7 to run on RHEL 9. I am not a Qt developer, so bear with me. I've done what I can to understand what's going on but I'm pretty lost.
The application uses the adwaita style, determined by the lines in ~/.config/Trolltech.conf:
[Qt]
style=adwaitaWhen moved to RHEL9, no style configuration can stop it from segfaulting. I've tried running the raw binary file copied into the new environment with the shared libraries it depends on, and get this backtrace:
#0 in g_log () #1 in load_modules.lto_priv () at /usr/lib64/libgtk-x11-2.0.so.0 #2 in _gtk_modules_settings_changed () at /usr/lib64/libgtk-x11-2.0.so.0 #3 in display_opened_cb.lto_priv () at /usr/lib64/libgtk-x11-2.0.so.0 #4 in g_closure_invoke () at /usr/lib64/libgobject-2.0.so.0 #5 in signal_emit_unlocked_R () at /usr/lib64/libgobject-2.0.so.0 #6 in g_signal_emit_valist () at /usr/lib64/libgobject-2.0.so.0 #7 in g_signal_emit_by_name () at /usr/lib64/libgobject-2.0.so.0 #8 in gdk_display_open () at /usr/lib64/libgdk-x11-2.0.so.0 #9 in gdk_display_open_default_libgtk_only () at /usr/lib64/libgdk-x11-2.0.so.0 #10 in gtk_init () at /usr/lib64/libgdk-x11-2.0.so.0 #11 in QGtkStyleprivate::getIconThemeName() at ./lib/libQtGui.so.4 #12 in QGuiPlatformPlugin::systemIconThemeName() at ./lib/libQtGui.so.4 #13 in QIconLoader::updateSystemTheme() at ./lib/libQtGui.so.4 #14 in qt_set_x11_resources () at ./lib/libQtGui.so.4 #15 in qt_init () at ./lib/libQtGui.so.4 #16 in QApplicationPrivate::construct () at ./lib/libQtGui.so.4 #17 in QApplication::QApplication () at ./lib/libQtGui.so.4 #18 in main ()And I've tried running a version that was upgraded to Qt 5 with the QT_STYLE_OVERRIDE variable set to adwaita, and get a similar error:
#0 in g_log () #1 in _g_io_module_get_default () at /usr/lib64/libgio-2.0.so.0 #2 in g_vfs_get_default () at /usr/lib64/libgio-2.0.so.0 #3 in g_file_new_for_uri () at /usr/lib64/libgio-2.0.so.0 #4 in gtk_css_provider_load_from_resource () at /usr/lib64/libgtk-3.so.0 #5 in _gtk_css_provider_load_named () at /usr/lib64/libgtk-3.so.0 #6 in settings_update_theme () at /usr/lib64/libgtk-3.so.0 #7 in gtk_settings_get_for_display () at /usr/lib64/libgtk-3.so.0 #8 in display_opened_cb.lto_priv () at /usr/lib64/libgtk-3.so.0 #9 in g_cclosure_marshal_VOID__OBJECTv () at /usr/lib64/libgobject-2.0.so.0 #10 in g_signal_emit_valist () at /usr/lib64/libgobject-2.0.so.0 #11 in g_signal_emit () at /usr/lib64/libgobject-2.0.so.0 #12 in g_signal_emit_valist () at /usr/lib64/libgobject-2.0.so.0 #13 in g_signal_emit_by_name () at /usr/lib64/libgobject-2.0.so.0 #14 in _gdk_x11_display_open () at /usr/lib64/libgdk-3.so.0 #15 in gdk_display_manager_open_display () at /usr/lib64/libgdk-3.so.0 #16 in gtk_init_check () at /usr/lib64/libgtk-3.so.0 #17 in gtk_init () at /usr/lib64/libgtk-3.so.0 #18 in QGtk3Theme::GQtk3Theme () at /usr/lib64/qt5/plugins/platformthemes/libqgtk3.so #19 in QGtk3ThemePlugin::create () at /usr/lib64/qt5/plugins/platformthemes/libqgtk3.so #20 in QPlatformThemeFactory::create () at /usr/lib64/qt5/plugins/platformthemes/libqgtk3.so #21 in QGuiApplicationPrivate::createPlatformIntegration () at /usr/lib64/libQt5Gui.so.5 #22 in QGuiApplicationPrivate::createEventDispatcher () at /usr/lib64/libQt5Gui.so.5 #23 in QCoreApplicationPrivate::init () at /usr/lib64/libQt5Core.so.5 #24 in QGuiApplicationPrivate::init () at /usr/lib64/libQt5Gui.so.5 #25 in QApplicationPrivate::init () at /usr/lib64/libQt5Widgets.so.5 #26 in main ()I understand this has something to do with the GTK style, so my question is, can I just not use this style? When I remove the "style=adwaita" configuration from Trolltech.conf in RHEL7, I get a segmentation fault with this backtrace:
#0 in g_log () #1 in pixbuf_render () at /usr/lib64/gtk-2.0/2.10.0/engines/libpixmap.so #2 in theme_pixbuf_render () at /usr/lib64/gtk-2.0/2.10.0/engines/libpixmap.so #3 in draw_gap_image.isra.1.constprop.4 () at /usr/lib64/gtk-2.0/2.10.0/engines/libpixmap.so #4 in draw_box_gap () at /usr/lib64/gtk-2.0/2.10.0/engines/libpixmap.so #5 in QGtkPainter::paintBoxGap () at /usr/lib64/libQtGui.so.4 #6 in QGtkStyle::drawPrimitive () at /usr/lib64/libQtGui.so.4 #7 in QTabWidget::paintEvent () at /usr/lib64/libQtGui.so.4 #8 in QWidget::event () at /usr/lib64/libQtGui.so.4 #9 in QApplicationPrivate::notify_helper () at /usr/lib64/libQtGui.so.4 #10 in QApplication::notify () at /usr/lib64/libQtGui.so.4 #11 in QCoreApplication::notifyInternal () at /usr/lib64/libQtCore.so.4 #12 in QWidgetPrivate::drawWidget () at /usr/lib64/libQtGui.so.4 #13 in QWidgetPrivate::paintSiblingsRecursive () at /usr/lib64/libQtGui.so.4 #14 in QWidgetPrivate::drawWidget () at /usr/lib64/libQtGui.so.4 #15 in QWidgetBackingStore::sync() at /usr/lib64/libQtGui.so.4 #16 in QWidgetBackingStore::sync() at /usr/lib64/libQtGui.so.4 #17 in QETWidget::translatePaintEvent () at /usr/lib64/libQtGui.so.4 #18 in QApplication::x11ProcessEvent 9) at /usr/lib64/libQtGui.so.4 #19 in x11EventSourceDispatch () at /usr/lib64/libQtGui.so.4 #20 in g_main_context_dispatch () at /usr/lib64/libglib-2.0.so.0 #21 in g_main_context_iterate.isra.19 () at /usr/lib64/libglib-2.0.so.0 #22 in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0 #23 in QEventDispatcherGlib::processEvents () at /usr/lib64/libQtCore.so.4 #24 in QGuiEventDispatcherGlib::processEvents () at /usr/lib64/libQtGui.so.4 #25 in QEventLoop::processEvents () at /usr/lib64/libQtCore.so.4 #26 in QEventLoop::exec () at /usr/lib64/libQtCore.so.4 #27 in QCoreApplication::exec () at /usr/lib64/libQtCore.so.4 #28 in main ()So there seems to be something other than Trolltech.conf telling Qt to use gtk libraries, but I can't find any mention of adwaita or gtk in the source code. The closest thing is some CMake depend.make files referencing qgtkstyle.h.
I have no attachment to the style of the application, so whichever of fixing or removing gtk is simpler I'm happy to do. I just don't know where to begin on either approach.
-
I would guess you will the same answers as on SO - you can not simply move an executable around from one system to another. You have to recompile it on the destination system to make sure the correct libs are fetched. You might use another style with
-style windowsor-style fusionbut I guess it's crashing somewhere else then. -
I would guess you will the same answers as on SO - you can not simply move an executable around from one system to another. You have to recompile it on the destination system to make sure the correct libs are fetched. You might use another style with
-style windowsor-style fusionbut I guess it's crashing somewhere else then.@Christian-Ehrlicher The Qt5 version is recompiled on the destination system, and still shows a similar GTK error.
Using style fusion and windows don't make the RHEL7 version crash like removing the style completely does or switching to style GTK+, but it doesn't change anything on either of the versions in RHEL9.
Interestingly, I can't notice any visible difference when using fusion or windows vs using adwaita. I assume it's being read somehow, since excluding the style= configuration entirely makes it crash. Are the differences that subtle, or is there some other way to enforce the application style that I'm missing? I've tried changing Trolltech.conf, putting this in after app is defined:
app.setStyle("Fusion");and passing -style fusion as a command line argument. None result in any visible differences.
-
Ok, this is actually unrelated to the style. I assumed it was due to the backtrace containing references to gtk and the application being in a gtk style, but every other style gives the same result.
Why is Qt calling gtk libraries in the background? I assumed it was completely separate from gtk since they're both different tools to do the same thing. Does Qt have to use gtk in gnome environments?