fcitx / fcitx5

maybe a new fcitx.
1.57k stars 117 forks source link

Emacs crashes when used with fcitx #213

Closed searene closed 3 years ago

searene commented 3 years ago

Describe the bug Emacs sometimes crashes when used with fcitx. The frequency is about every few days. I've attached gdb to it while crashing and got the following backtrace:

searene@archlinux:~$ sudo gdb attach 14210
GNU gdb (GDB) 10.1
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

    For help, type "help".
    Type "apropos word" to search for commands related to "word"...
    attach: No such file or directory.
    Attaching to process 14210
    [New LWP 14212]
    [New LWP 14216]
    [New LWP 14217]
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/usr/lib/libthread_db.so.1".
    0x00007f569cd2046f in poll () from /usr/lib/libc.so.6
    (gdb) bt full
    #0  0x00007f569cd2046f in poll () at /usr/lib/libc.so.6
    #1  0x00007f569dfd263b in  () at /usr/lib/libxcb.so.1
    #2  0x00007f569dfd437b in xcb_wait_for_event () at /usr/lib/libxcb.so.1
    #3  0x00007f569e038209 in _XReadEvents () at /usr/lib/libX11.so.6
    #4  0x00007f569e01f396 in XIfEvent () at /usr/lib/libX11.so.6
    #5  0x00007f569e068ca0 in  () at /usr/lib/libX11.so.6
    #6  0x00007f569e0699d2 in  () at /usr/lib/libX11.so.6
    #7  0x00007f569e069c6c in _XimRead () at /usr/lib/libX11.so.6
    #8  0x00007f569e0583ce in  () at /usr/lib/libX11.so.6
    #9  0x00007f569e045955 in XSetICValues () at /usr/lib/libX11.so.6
    #10 0x0000561ace6df9b3 in  ()
    #11 0x0000561ace6627a7 in  ()
    #12 0x0000561ace61e5a5 in  ()
    #13 0x0000561ace61eb33 in  ()
    #14 0x0000561ace61ffdb in  ()
    #15 0x0000561ace6201fb in  ()
    #16 0x0000561ace659154 in  ()
    #17 0x0000561ace65a6b5 in  ()
    #18 0x0000561ace7054ff in  ()
    #19 0x0000561ace7bc9e0 in  ()
    #20 0x0000561ace6210d3 in  ()
    #21 0x0000561ace707efd in  ()
    #22 0x0000561ace708928 in  ()
    #23 0x0000561ace70a06f in  ()
    #24 0x0000561ace7779e7 in  ()
    #25 0x0000561ace6fae65 in  ()
    #26 0x0000561ace777942 in  ()
    #27 0x0000561ace6fadfd in  ()
    #28 0x0000561ace70040b in  ()
    #29 0x0000561ace700734 in  ()
    --Type <RET> for more, q to quit, c to continue without paging--
    #30 0x0000561ace616de1 in  ()
    #31 0x00007f569cc53152 in __libc_start_main () at /usr/lib/libc.so.6
    #32 0x0000561ace61753e in  ()

Seems like it's due to xim. I tried to disable xim by adding the following line to ~/.Xresources

emacs*useXIM: false

The hanging doesn't occur again. But I cannot input with fcitx as well, since fcitx seems to use xim?

My related installed packages info:

fcitx

OS

Emacs In GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.22, cairo version 1.17.3) of 2020-08-29 built on juergen Windowing system distributor 'The X.Org Foundation', version 11.0.12010000 System Description: Arch Linux

Desktop (please complete the following information):

searene@ArchLinux:~$ fcitx-diagnose 
# System Info:
1.  `uname -a`:

        Linux ArchLinux 5.10.6-arch1-1 #1 SMP PREEMPT Sat, 09 Jan 2021 18:22:35 +0000 x86_64 GNU/Linux

2.  `lsb_release -a`:

        LSB Version:    1.4
        Distributor ID: Arch
        Description:    Arch Linux
        Release:    rolling
        Codename:   n/a

3.  `lsb_release -d`:

        Description:    Arch Linux

4.  `/etc/lsb-release`:

        LSB_VERSION=1.4
        DISTRIB_ID=Arch
        DISTRIB_RELEASE=rolling
        DISTRIB_DESCRIPTION="Arch Linux"

5.  `/etc/os-release`:

        NAME="Arch Linux"
        PRETTY_NAME="Arch Linux"
        ID=arch
        BUILD_ID=rolling
        ANSI_COLOR="38;2;23;147;209"
        HOME_URL="https://www.archlinux.org/"
        DOCUMENTATION_URL="https://wiki.archlinux.org/"
        SUPPORT_URL="https://bbs.archlinux.org/"
        BUG_REPORT_URL="https://bugs.archlinux.org/"
        LOGO=archlinux

6.  Desktop Environment:

    Cannot determine desktop environment.

7.  Bash Version:

        BASH_VERSION='5.1.4(1)-release'

# Environment:
1.  DISPLAY:

        DISPLAY=':0'

2.  Keyboard Layout:

    1.  `setxkbmap`:

            xkb_keymap {
                xkb_keycodes  { include "evdev+aliases(qwerty)" };
                xkb_types     { include "complete"  };
                xkb_compat    { include "complete"  };
                xkb_symbols   { include "pc+us+inet(evdev)+capslock(ctrl_modifier)" };
                xkb_geometry  { include "pc(pc105)" };
            };

    2.  `xprop`:

            _XKB_RULES_NAMES(STRING) = "evdev", "pc105", "us", "", "caps:ctrl_modifier"

3.  Locale:

    1.  All locale:

            C
            en_US.utf8
            POSIX
            zh_CN.utf8

    2.  Current locale:

            LANG=en_US.UTF-8
            LC_CTYPE=zh_CN.UTF-8
            LC_NUMERIC="en_US.UTF-8"
            LC_TIME="en_US.UTF-8"
            LC_COLLATE="en_US.UTF-8"
            LC_MONETARY="en_US.UTF-8"
            LC_MESSAGES="en_US.UTF-8"
            LC_PAPER="en_US.UTF-8"
            LC_NAME="en_US.UTF-8"
            LC_ADDRESS="en_US.UTF-8"
            LC_TELEPHONE="en_US.UTF-8"
            LC_MEASUREMENT="en_US.UTF-8"
            LC_IDENTIFICATION="en_US.UTF-8"
            LC_ALL=

4.  Directories:

    1.  Home:

            /home/searene

    2.  `${XDG_CONFIG_HOME}`:

        Environment variable `XDG_CONFIG_HOME` is not set.

        Current value of `XDG_CONFIG_HOME` is `~/.config` (`/home/searene/.config`).

    3.  Fcitx Settings Directory:

        Current fcitx settings directory is `~/.config/fcitx` (`/home/searene/.config/fcitx`).

5.  Current user:

    The script is run as searene (1000).

# Fcitx State:
1.  executable:

    Found fcitx at `/usr/bin/fcitx`.

2.  version:

    Fcitx version: `4.2.9.7`

3.  process:

    Found 2 fcitx processes:

            779 fcitx
            812 fcitx-dbus-watc

4.  `fcitx-remote`:

    `fcitx-remote` works properly.

5.  DBus interface:

    Using `dbus-send` to check dbus.

    Owner of DBus name `org.fcitx.Fcitx` is `:1.7`.

    PID of DBus name `org.fcitx.Fcitx` owner is `779`.

# Fcitx Configure UI:
1.  Config Tool Wrapper:

    Found fcitx-configtool at `/usr/bin/fcitx-configtool`.

2.  Config GUI for gtk2:

    **Config GUI for gtk2 not found.**

3.  Config GUI for gtk3:

    Found `fcitx-config-gtk3` at `/usr/bin/fcitx-config-gtk3`.

4.  Config GUI for kde:

    **`kcmshell4` not found.**

# Frontends setup:
## Xim:
1.  `${XMODIFIERS}`:

    Environment variable XMODIFIERS is set to "@im=fcitx" correctly.
    Xim Server Name from Environment variable is fcitx.

2.  XIM_SERVERS on root window:

    Xim server name is the same with that set in the environment variable.

## Qt:
1.  qt4 - `${QT4_IM_MODULE}`:

    Environment variable QT_IM_MODULE is set to "fcitx" correctly.

2.  qt5 - `${QT_IM_MODULE}`:

    Environment variable QT_IM_MODULE is set to "fcitx" correctly.

3.  Qt IM module files:

    Found fcitx qt module: `/usr/lib/fcitx/qt/libfcitx-quickphrase-editor5.so`.
    Found fcitx im module for Qt5: `/usr/lib/qt/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so`.
    **Cannot find fcitx input method module for Qt4.**

## Gtk:
1.  gtk - `${GTK_IM_MODULE}`:

    Environment variable GTK_IM_MODULE is set to "fcitx" correctly.

2.  `gtk-query-immodules`:

    1.  gtk 2:

        Found `gtk-query-immodules` for gtk `2.24.33` at `/usr/bin/gtk-query-immodules-2.0`.
        Version Line:

            # Created by /usr/bin/gtk-query-immodules-2.0 from gtk+-2.24.33

        Found fcitx im modules for gtk `2.24.33`.

            "/usr/lib/gtk-2.0/2.10.0/immodules/im-fcitx.so" 
            "fcitx" "Fcitx (Flexible Input Method Framework)" "fcitx" "/usr/share/locale" "ja:ko:zh:*" 

    2.  gtk 3:

        Found `gtk-query-immodules` for gtk `3.24.24` at `/usr/bin/gtk-query-immodules-3.0`.
        Version Line:

            # Created by /usr/bin/gtk-query-immodules-3.0 from gtk+-3.24.24

        Found fcitx im modules for gtk `3.24.24`.

            "/usr/lib/gtk-3.0/3.0.0/immodules/im-fcitx.so" 
            "fcitx" "Fcitx (Flexible Input Method Framework)" "fcitx" "/usr/share/locale" "ja:ko:zh:*" 

3.  Gtk IM module cache:

    1.  gtk 2:

        Found immodules cache for gtk `2.24.33` at `/usr/lib/gtk-2.0/2.10.0/immodules.cache`.
        Version Line:

            # Created by /usr/bin/gtk-query-immodules-2.0 from gtk+-2.24.33

        Found fcitx im modules for gtk `2.24.33`.

            "/usr/lib/gtk-2.0/2.10.0/immodules/im-fcitx.so" 
            "fcitx" "Fcitx (Flexible Input Method Framework)" "fcitx" "/usr/share/locale" "ja:ko:zh:*" 

    2.  gtk 3:

        Found immodules cache for gtk `3.24.24` at `/usr/lib/gtk-3.0/3.0.0/immodules.cache`.
        Version Line:

            # Created by /usr/bin/gtk-query-immodules-3.0 from gtk+-3.24.24

        Found fcitx im modules for gtk `3.24.24`.

            "/usr/lib/gtk-3.0/3.0.0/immodules/im-fcitx.so" 
            "fcitx" "Fcitx (Flexible Input Method Framework)" "fcitx" "/usr/share/locale" "ja:ko:zh:*" 

4.  Gtk IM module files:

    1.  gtk 2:

        All found Gtk 2 immodule files exist.

    2.  gtk 3:

        All found Gtk 3 immodule files exist.

# Configuration:
## Fcitx Addons:
1.  Addon Config Dir:

    Found fcitx addon config directory: `/usr/share/fcitx/addon`.

2.  Addon List:

    1.  Found 30 enabled addons:

            fcitx-autoeng
            fcitx-chttrans
            fcitx-classic-ui
            fcitx-clipboard
            fcitx-cloudpinyin
            fcitx-dbus
            fcitx-freedesktop-notify
            fcitx-fullwidth-char
            fcitx-imselector
            fcitx-ipc
            fcitx-ipcportal
            fcitx-keyboard
            fcitx-kimpanel-ui
            fcitx-notificationitem
            fcitx-pinyin
            fcitx-pinyin-enhance
            fcitx-punc
            fcitx-quickphrase
            fcitx-remote
            fcitx-rime
            fcitx-sogoupinyin
            fcitx-spell
            fcitx-sunpinyin
            fcitx-table
            fcitx-unicode
            fcitx-vk
            fcitx-x11
            fcitx-xim
            fcitx-xkb
            fcitx-xkbdbus

    2.  Found 1 disabled addons:

            fcitx-qw

3.  Addon Libraries:

    All libraries for all addons are found.

4.  User Interface:

    Found 2 enabled user interface addons:

        fcitx-classic-ui
        fcitx-kimpanel-ui

## Input Methods:
1.  Found 5 enabled input methods:

        fcitx-keyboard-us
        sogoupinyin
        sunpinyin
        rime
        googlepinyin

2.  Default input methods:

    You have a keyboard input method "fcitx-keyboard-us" correctly added as your default input method.

# Log:
1.  `date`:

        Sat Jan 23 07:57:30 PM CST 2021

2.  `~/.config/fcitx/log/`:

        total 4
        -rw-r--r-- 1 searene searene 1893 Jan 18 07:49 crash.log

3.  `~/.config/fcitx/log/crash.log`:

        =========================
        FCITX 4.2.9.7 -- Get Signal No.: 6
        Date: try "date -d @1610927384" if you are using GNU date ***
        ProcessID: 2702
        fcitx(+0x1a97)[0x557d480bea97]
        /lib/x86_64-linux-gnu/libc.so.6(+0x46210)[0x7f68e6f71210]
        /lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb)[0x7f68e6f7118b]
        /lib/x86_64-linux-gnu/libc.so.6(abort+0x12b)[0x7f68e6f50859]
        /lib/x86_64-linux-gnu/libc.so.6(+0x903ee)[0x7f68e6fbb3ee]
        /lib/x86_64-linux-gnu/libc.so.6(+0x9847c)[0x7f68e6fc347c]
        /lib/x86_64-linux-gnu/libc.so.6(+0x99de5)[0x7f68e6fc4de5]
        /usr/lib/x86_64-linux-gnu/fcitx/fcitx-sogoupinyin.so(+0x34524)[0x7f68e2514524]
        /usr/lib/x86_64-linux-gnu/fcitx/fcitx-sogoupinyin.so(+0x34475)[0x7f68e2514475]
        /usr/lib/x86_64-linux-gnu/fcitx/fcitx-sogoupinyin.so(+0x343a1)[0x7f68e25143a1]
        /usr/lib/x86_64-linux-gnu/fcitx/fcitx-sogoupinyin.so(+0x341be)[0x7f68e25141be]
        /usr/lib/x86_64-linux-gnu/fcitx/fcitx-sogoupinyin.so(+0x33c59)[0x7f68e2513c59]
        /usr/lib/x86_64-linux-gnu/fcitx/fcitx-sogoupinyin.so(+0x33c36)[0x7f68e2513c36]
        /usr/lib/x86_64-linux-gnu/fcitx/fcitx-sogoupinyin.so(+0x33922)[0x7f68e2513922]
        /usr/lib/x86_64-linux-gnu/fcitx/fcitx-sogoupinyin.so(+0x345ac)[0x7f68e25145ac]
        /lib/x86_64-linux-gnu/libc.so.6(+0x49a27)[0x7f68e6f74a27]
        /lib/x86_64-linux-gnu/libc.so.6(on_exit+0x0)[0x7f68e6f74be0]
        /lib/x86_64-linux-gnu/libX11.so.6(_XIOError+0x5c)[0x7f68e5d761ac]
        /lib/x86_64-linux-gnu/libX11.so.6(+0x3f16c)[0x7f68e5d7416c]
        /lib/x86_64-linux-gnu/libX11.so.6(XSync+0x51)[0x7f68e5d6f641]
        /lib/x86_64-linux-gnu/libX11.so.6(XCloseDisplay+0x7f)[0x7f68e5d5036f]
        /usr/lib/x86_64-linux-gnu/fcitx/fcitx-sogoupinyin.so(+0x36fbe)[0x7f68e2516fbe]
        /lib/x86_64-linux-gnu/libfcitx-core.so.0(+0x965a)[0x7f68e717865a]
        /lib/x86_64-linux-gnu/libfcitx-core.so.0(FcitxInstanceRun+0x57)[0x7f68e71789e7]
        fcitx(+0x1433)[0x557d480be433]
        /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7f68e6f520b3]
        fcitx(+0x14ae)[0x557d480be4ae]

Here are some related issues I found online about this, seems to be an old bug:

searene commented 3 years ago

Seems to have posted in the wrong repository, closed for now.