Skip to content

Crashes on GNOME attempting to use GTK 4

Electron 36 crashes with the following message when run on GNOME.

GTK 2/3 symbols detected. Using GTK 2/3 and GTK 4 in the same process is not supported

Looks like it's attempting to initialize a dlopen'ed GTK 4 when GTK 3 has already been loaded via DT_NEEDED. Maybe there were conflicting features enabled at build time? I guess GTK 4 is used to draw window decorations.

It does not crash when removing both XDG_CURRENT_DESKTOP (defaults to GNOME) and DESKTOP_SESSION (defaults to gnome) from the environment. Conversely, setting XDG_CURRENT_DESKTOP=GNOME and/or DESKTOP_SESSION=gnome in a non-GNOME environment should cause it to crash.

electron35 is not affected.

Backtrace:

#0  _g_log_abort (breakpoint=<optimized out>) at ../glib/glib/gmessages.c:431
#1  g_log_writer_default (log_level=6, fields=<optimized out>, n_fields=6, user_data=0x0) at ../glib/glib/gmessages.c:2955
#2  0x00007057fcf0b2a8 in g_log_structured_array (log_level=G_LOG_LEVEL_ERROR, fields=0x7ffc4934c5c0, n_fields=6) at ../glib/glib/gmessages.c:1874
#3  g_log_structured_array (log_level=log_level@entry=G_LOG_LEVEL_ERROR, fields=fields@entry=0x7ffc4934c5c0, n_fields=n_fields@entry=6) at ../glib/glib/gmessages.c:1847
#4  0x00007057fcf0b51f in g_log_structured_standard
    (log_domain=log_domain@entry=0x705757682759 "Gtk", log_level=log_level@entry=G_LOG_LEVEL_ERROR, file=file@entry=0x70575768f0b3 "../gtk/gtk/gtkmain.c", line=line@entry=0x70575768f144 "499", func=func@entry=0x705757631c00 <__func__.8.lto_priv.71> "do_pre_parse_initialization", message_format=message_format@entry=0x7057576b5e58 "GTK 2/3 symbols detected. Using GTK 2/3 and GTK 4 in the same process is not supported") at ../glib/glib/gmessages.c:1931
#5  0x000070575724bb79 in do_pre_parse_initialization () at ../gtk/gtk/gtkmain.c:499
#6  gtk_init_check () at ../gtk/gtk/gtkmain.c:635
#7  gtk_init_check () at ../gtk/gtk/gtkmain.c:620
#8  0x000057d795196701 in gtk::GtkInitCheck(int*, char**) ()
#9  0x000057d795198429 in gtk::GtkUi::Initialize() ()
#10 0x000057d795195af6 in ui::(anonymous namespace)::GetGtkUi() ()
#11 0x000057d7951957ab in ui::(anonymous namespace)::GetDefaultLinuxUiAndTheme() ()
#12 0x000057d7951955cb in ui::GetDefaultLinuxUi() ()
#13 0x000057d78c2fa833 in electron::ElectronBrowserMainParts::ToolkitInitialized() ()
#14 0x000057d78efad309 in content::BrowserMainLoop::InitializeToolkit() ()
#15 0x000057d78efae09b in content::BrowserMainRunnerImpl::Initialize(content::MainFunctionParams) ()
#16 0x000057d78efa98fa in content::BrowserMain(content::MainFunctionParams) ()
#17 0x000057d78c9025c5 in content::RunBrowserProcessMain(content::MainFunctionParams, content::ContentMainDelegate*) ()
#18 0x000057d78c903cac in content::ContentMainRunnerImpl::RunBrowser(content::MainFunctionParams, bool) ()
#19 0x000057d78c903ae7 in content::ContentMainRunnerImpl::Run() ()
#20 0x000057d78c9014e5 in content::RunContentProcess(content::ContentMainParams, content::ContentMainRunner*) ()
#21 0x000057d78c9015d3 in content::ContentMain(content::ContentMainParams) ()
#22 0x000057d78c1f16a5 in main ()

electron36 36.2.1-1
gtk4 1:4.18.5-2

Edited by Jan Alexander Steffens (heftig)
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information