Bug#1105818: gimp crashes on startup in GNOME Wayland session if appmenu-gtk-module enabled

Simon McVittie smcv at debian.org
Thu May 15 13:39:18 BST 2025


Control: retitle -1 gimp crashes on startup in GNOME Wayland session if appmenu-gtk-module enabled
Control: reassign -1 gimp,appmenu-gtk-module
Control: found -1 gimp/3.0.2-3

On Thu, 15 May 2025 at 12:42:33 +0200, Giacomo Mulas wrote:
>The present version of gimp on startup first hangs, then crashes _when running in a gnome session on Wayland.
>It happens also on a freshly created new account, to make sure there are no funny accumulated, old configurations in my gnome session causing the problem.
...
>Playing with differences, I eventually found out that if the environment variable GTK_MODULES is set to contain the module "appmenu-gtk-module", then gimp crashes. If it does not contain it, it starts flawlessly.
>I hope this helps tracking and solving the problem for good. For the time being, I can just work around it by unsetting GTK_MODULES before starting gimp.
>By the way, where is "appmenu-gtk-module" appended to the GTK_MODULES variable?

gimp and its direct dependencies are not responsible for requesting 
appmenu-gtk-module. It appears to be appmenu-gtk-module.service in the 
appmenu-gtk-module-common package that does this:
https://sources.debian.org/src/appmenu-gtk-module/25.04-1/data/appmenu-gtk-module.service.in/

GTK modules execute arbitrary code in every GTK 3 process, so if there 
is any bug in either the appmenu-gtk-module code or its interactions 
with some specific app like gimp, it can easily cause a crash.

Can you get a backtrace from this crash? 
(See https://wiki.debian.org/HowToGetABacktrace, usually the easiest way 
is to use the systemd-coredump package)

Are other GTK 3 applications like the ones in the gtk-3-examples package 
affected by this crash?

Looking at the appmenu-gtk-module source code, I see that it interposes 
itself into the GTK code by overwriting GTK classes' internal function 
pointers. This is the sort of thing that can very easily cause crashes 
when an internal implementation detail of GTK or the app changes, which 
is a large part of why GTK 4 no longer supports arbitrary loadable 
modules.

>The weird thing is that it works flawlessly if I simply ssh to localhost before running it.

I wonder whether the logic in appmenu-gtk-module.service might be 
accidentally removing appmenu-gtk-module from the GTK_MODULES passed to 
D-Bus-activated services as a side-effect of logging out from the ssh 
session?

     smcv



More information about the pkg-gnome-maintainers mailing list