segmentation fault at XSetICFocus & Xutf8LookupString causes Minecraft to hang upon losing focus
This bug is originally filed at bugs.archlinux.org.
Description: While playing Minecraft (1.18.1 & 1.17.1, w/ jdk-openjdk 17.0.1.u12-19) on Arch Linux, if the game window loses focus for a period of time it will hang (no mouse input feedback etc) and the whole process will become unresponsive. The JVM crash log (as shown below) indicates that libx11 had a segmentation fault (SIGSEGV) at XSetICFocus.
package version: libx11 1.7.3.1-1
JVM crash log:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007fc5793a5b5f, pid=392706, tid=392710
#
# JRE version: OpenJDK Runtime Environment (17.0.1+12) (build 17.0.1+12)
# Java VM: OpenJDK 64-Bit Server VM (17.0.1+12, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# C [libX11.so.6+0x4eb5f] XSetICFocus+0xf
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h" (or dumping to <redacted>)
#
# An error report file with more information is saved as:
# <redacted>
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
sometimes the problematic frame will change to
[libX11.so.6+0x4ec5a] Xutf8LookupString+0xa
with the same symptoms. This will happen when trying to use input method in the game(I'm using fcitx5 in this case).
Steps to reproduce:
- Use a Minecraft launcher (tested on MultiMC and HMCL) to launch the game.
- Click somewhere outside the game window and use other applications for a while.
- Switch back to the game window. The game should now hang and the process should be unresponsive.