fcitx/fcitx5-gtk

Fcitx 5 crashes Gimp 2.99 on NixOS

chayleaf opened this issue · 3 comments

NixOS/nixpkgs#260076 has specific details about how I encountered the issue, please refer to it

This is somehow related to immodules.cache files, so I propose the following reproduction steps for other distros

  1. Write
"/usr/lib/gtk-3.0/3.0.0/immodules/im-fcitx5.so"
"fcitx" "Fcitx5 (Flexible Input Method Framework5)" "fcitx5" "/usr/share/locale" "ja:ko:zh:*"

to any file (hopefully /usr/lib/gtk-3.0/3.0.0/immodules/im-fcitx5.so is the correct path)

  1. export GTK_IM_MODULE_FILE=<path to file>

  2. Launch Gimp 2.99 and try using Fcitx5 in the text tool's font selection textbox or font size selection textbox (specifically, in the floating window that opens above the image when writing text). It's usually packaged as gimp-devel.

Steps 1 and 2 aren't necessary if your OS manages immodules.cache correctly, but can be useful for testing.

wengxt commented

Thanks for the information. I'm able to produce it on my system.
However I feel it's a bug within gtk based on some gdb debugging. Unfortunately this bug is just triggered by fcitx5 im modules client side input panel feature on wayland.

I'm still debugging gtk code to understand why this happens, but if you just want to use gimp right now, you may choose some alternative way as a workaround:

  1. you may run it under X, or Xwayland, to enforce this just GDK_BACKEND=x11
  2. If your wayland compositor support zwp_input_method, set GTK_IM_MODULE=wayland and run gimp
    You may require additional setup (E.g. KDE you need to change some systemsettings, weston you will need to modifiy weston.ini)
    See https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland
    If you don't know how to do it just tell me your compositor/desktop and I can try to write a clearer step.
  3. if you use GNOME, use this extension: https://extensions.gnome.org/extension/261/kimpanel/

Those are just workarounds that you can try without any code fix.

wengxt commented

actually, can you help me to do one test?

First make sure im-fcitx5.so not being loaded. you can do either an empty cache file, or set GTK_IM_MODULE to sth else, or even remove fcitx5-gtk, to exclude any fcitx’s impact.

then, right click in the font selection combo box. The intended behavior is show a menu with “copy paste” just like any text box , but this will go with the same code path that fcitx5-gtk exercises.

I can crash gimp the same way here by doing that. So I wonder if you can also reproduce this? If so I’m more confident that it’s a gtk or gimp bug.

Yes, I can confirm it crashes for me on right clicking the textbox with GTK_IM_MODULE_FILE=. I've reported this upstream, thanks!