Emacs hangs in xlib's Ximread (when the ibus daemon goes away and I think in other some situations even not using ibus but just xkb). I'm attaching a full backtrace which may be more verbose than desired. Maybe it is possible to work around this case, or suggest something some way xlib could handle it. -- Madhu In GNU Emacs 30.0.50 (build 4, x86_64-pc-linux-gnu, X toolkit, cairo version 1.17.8, Xaw3d scroll bars) of 2023-07-20 Windowing system distributor 'The X.Org Foundation', version 11.0.12201007 System Description: Gentoo/Linux Configured using: 'configure --with-x-toolkit=athena --with-native-compilation -C' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XAW3D XDBE XIM XINPUT2 XPM LUCID ZLIB Important settings: value of $LC_COLLATE: C value of $LANG: en_US.utf8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix