Subject: bug#45927: Emacs hangs every few week due to xim

From: Eli Zaretskii <[email-masked]>
Date: Sun, 17 Jan 2021 16:33:10 +0200

> From: Joey Green <[email-masked]>
> Date: Sun, 17 Jan 2021 10:18:01 +0800
> 
> 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 my input method(fcitx) as well, this is a huge
> problem for me. I want to see if there's a solution for it. Even a method to unblock it is helpful, otherwise I
> have to kill Emacs and recover-session each time, which sometimes can cause data loss.
> 
> My related installed packages info:
> 
> fcitx
> - fcitx 4.2.9.8-1
> - fcitx-configtool 0.4.10-4
> - fcitx-sogoupinyin 2.4.0.2732-1
> 
> ArchLinuxLinux
> - ArchLinux 5.10.6-arch1-1 #1 SMP PREEMPT Sat, 09 Jan 2021 18:22:35 +0000 x86_64 GNU/Linux
> 
> Here are some related issues I found online about this, seems to be an old bug:
> - https://bugzilla.redhat.com/show_bug.cgi?id=452849
> - https://lists.gnu.org/archive/html/bug-gnu-emacs/2017-07/msg00520.html

The bugzilla report has some details regarding the reasons for the
hang.  Can you verify that what it describes is indeed what happens,
i.e. both Emacs and XIM are waiting for each other?  And if so, can
you suggest how to modify the logic on our side to avoid this
deadlock?

Thanks.