Skip to content

osu! segfault in libX11.so when IM daemon exits and window regains focus (X11) #38423

Description

Type

Crash to desktop

Bug description

Application-Specific IM Error Handling: IM Daemon Crash/Exit While Window is Backgrounded

Environment:

  • OS: Linux Mint 22.3 - Cinnamon 64-bit
  • Kernel: 6.14.0-37-generic
  • osu! version: 2026.711.0-lazer (Flatpak), 2026.726.0-lazer (Flatpak & AppImage)
  • Display Server: X11
  • Mesa: 25.2.8
  • Input method framework: IBus

Steps to reproduce:

  1. Start fcitx5 input method / ibus-daemon
  2. Start osu! (Flatpak / AppImage)
  3. Exit fcitx5 / pkill fcitx5 / pkill ibus-daemon while osu! is running
  4. Alt+Tab to switch windows back to osu! → Segfault
    Note: Starting osu! before fcitx5 / ibus-daemon does not trigger the crash, confirming the issue is in osu!'s IM context binding and cleanup logic.

Expected behavior:
No crash; graceful IM cleanup when fcitx5 / ibus-daemon exits

Actual behavior:
osu! segfaults in libX11.so.6.4.0 when window regains focus after fcitx5 / ibus-daemon termination (stack trace shows IM event handling)

Workaround (confirmed working):
Launch osu! with: flatpak run --env=GTK_IM_MODULE=none --env=QT_IM_MODULE=none --env=XMODIFIERS= sh.ppy.osu
Launch Steam with: flatpak run --env=GTK_IM_MODULE=none --env=QT_IM_MODULE=none --env=XMODIFIERS= com.valvesoftware.Steam
or just launch osu! before fcitx5 / ibus-daemon does.
Note: Steam exhibits a related but distinct issue — it does not crash immediately when window regains focus, but segfaults on exit without displaying the normal exit popup. This suggests a different crash point in the IM context cleanup chain.

The X11 IM module fails to gracefully handle IM daemon termination when the IM context is still active. Disabling IM modules entirely prevents both crashes, confirming the root cause lies in IM context handling.

Additional observations:

  • Observed one spontaneous segfault in libbassmix.so (GameThread[3164]) during idle, resulting in core dump, but unable to reproduce consistently.

Screenshots or videos

Not applicable — issue is reliably reproducible following the provided steps.

Version

2026.711.0-lazer (Flatpak), 2026.726.0-lazer (Flatpak & AppImage)

Logs

gnome-terminal-[13429]: Unable to connect to ibus: The given address is empty
kernel: osu![19249]: segfault at 571e734de245 ip 000076f775f091c3 sp 00007ffd54e7f8a8 error 4 in libX11.so.6.4.0[5a1c3,76f775ecd000+99000] likely on CPU 4 (core 8, socket 0)
kernel: Code: 41 5c 41 5d 5d c3 e8 9c 73 fc ff 90 66 66 2e 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 48 85 ff 74 17 48 83 7f 08 00 74 10 48 8b 07 <ff> 60 08 66 2e 0f 1f 84 00 00 00 00 00 c3 0f 1f 40 00 66 66 2e 0f
systemd[1]: Started systemd-coredump@2-19410-0.service - Process Core Dump (PID 19410/UID 0).
(sd-parse-elf)[19417]: Could not parse number of program headers from core file: invalid `Elf' handle
(sd-parse-elf)[19417]: Could not parse number of program headers from core file: invalid `Elf' handle
(sd-parse-elf)[19417]: Could not parse number of program headers from core file: invalid `Elf' handle
(sd-parse-elf)[19417]: Could not parse number of program headers from core file: invalid `Elf' handle
(sd-parse-elf)[19417]: Could not parse number of program headers from core file: invalid `Elf' handle
systemd-coredump[19411]: [🡕] Process 19249 (osu!) of user 1000 dumped core.
                                              
                                              Module /app/bin/libbassmix.so without build-id.
                                              Module /app/bin/libbassmix.so
                                              Module /app/bin/librealm-wrappers.so without build-id.
                                              Module /app/bin/librealm-wrappers.so
                                              Module /app/bin/libbass_fx.so without build-id.
                                              Module /app/bin/libbass_fx.so
                                              Module /app/bin/libSDL3.so without build-id.
                                              Module /app/bin/libSDL3.so
                                              Module /app/bin/libbass.so without build-id.
                                              Module /app/bin/libbass.so
                                              Stack trace of thread 2:
                                              #0  0x000076f775f091c3 n/a (/usr/lib/x86_64-linux-gnu/libX11.so.6.4.0 + 0x5a1c3)
                                              ELF object binary architecture: AMD x86-64
systemd[1]: systemd-coredump@2-19410-0.service: Deactivated successfully.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions