Crash (SIGSEGV) via raw exit() during waveform-type change, inside fcitx5-qt QWindow teardown (Wayland)
Bug Description
Mixxx segfaults a few seconds after changing the waveform display type in
Preferences (e.g. to "RGB (GLSL)"), while running under Wayland with the
fcitx5 Qt input-context plugin active (QT_IM_MODULE=fcitx).
dmesg confirms a NULL-pointer dereference:
mixxx[544960]: segfault at 0 ip 00007f1895d71721 sp 00007ffdc6443380 error 4 in libQt6Core.so.6.11.2[371721,7f1895a94000+430000]The crashing thread's backtrace (from coredumpctl info, symbol names resolved
for Qt/libc; Mixxx's own frames are n/a because the Arch package ships
stripped and debuginfod.archlinux.org was unreachable when I tried to
resolve them):
#0 QThreadStorageData::get() (libQt6Core.so.6)
#1 QOpenGLContext::currentContext() (libQt6Gui.so.6)
#2 QWindow::~QWindow() (libQt6Gui.so.6)
#3 ?? (libfcitx5platforminputcontextplugin.so + 0x28815)
#4 QObject::event(QEvent*) (libQt6Core.so.6)
#5 QApplicationPrivate::notify_helper(QObject*, QEvent*) (libQt6Widgets.so.6)
#6 mixxx + 0x43a436 (custom QApplication::notify override)
#7 QCoreApplication::notifyInternal2(QObject*, QEvent*) (libQt6Core.so.6)
#8 QCoreApplicationPrivate::sendPostedEvents(...) (libQt6Core.so.6)
#9 libQt6Core.so.6 + 0x371e1a
#10 libQt6Core.so.6 + 0x371f74
#11 libc.so.6 + 0x40fbf (__run_exit_handlers-ish)
#12 exit() (libc.so.6)
#13 mixxx + 0x4448c8 (Mixxx code calling ::exit())
#14 libQt6Core.so.6 + 0x1eeff3
#15 QOpenGLWindow::resizeEvent(QResizeEvent*) (libQt6OpenGL.so.6)
#16 QWindow::event(QEvent*) (libQt6Gui.so.6)
#17 mixxx + 0x9f65cc
#18 QApplicationPrivate::notify_helper(...)
#19 mixxx + 0x43a436
#20 QCoreApplication::notifyInternal2(...)
#21 QGuiApplicationPrivate::processGeometryChangeEvent(...)
#22 QWindowSystemInterface::handleGeometryChange<SynchronousDelivery>(...)
#23 QtWaylandClient::QWaylandWindow::setGeometry(QRect const&)
#24 QtWaylandClient::QWaylandWindow::setVisible(bool)
#25 QWindowContainer::event(QEvent*)
...
#29 QWidgetPrivate::show_helper()
#30 QWidgetPrivate::setVisible(bool)
#31 mixxx + 0x5f99bf
...
#38 mixxx + 0x285579
#39 mixxx + 0x2050dc
#40 __libc_start_main
#42 mixxx + 0x2793a5What I think is happening
Reading the stack bottom-up: while a widget is being shown/resized (rebuilding
the OpenGL waveform windows after the display-type change), some Mixxx code
path (mixxx+0x4448c8) calls raw exit() instead of going through a
normal QApplication::quit() / return-from-main() shutdown. exit()'s
atexit/static-destruction machinery then flushes one more round of posted
Qt events (frames #8–#12) before the process actually terminates. One of
those leftover events gets delivered into the fcitx5 Qt platform
input-context plugin, which destroys a QWindow. That destructor calls
QOpenGLContext::currentContext(), which crashes inside
QThreadStorageData::get() with a null this/pointer — consistent with
the underlying QThreadStorage already having been torn down by that point
in the exit sequence.
This looks like an ordering hazard specific to calling exit() directly from
inside GUI code rather than returning normally from the Qt event loop — the
fcitx5 plugin's window teardown wasn't expecting to run in a
partially-destructed Qt runtime. I'm filing a parallel report against
fcitx5-qt for the plugin side of this (linked below), since the actual
faulting instruction is in their teardown path, but the trigger is Mixxx
calling exit() mid-event-handling.
Steps to Reproduce
- Run Mixxx on Wayland (Hyprland) with
fcitx5set as the Qt input method (QT_IM_MODULE=fcitx,fcitx5running). - Open Preferences → Waveforms, change the waveform display type (e.g. to "RGB (GLSL)").
- Mixxx segfaults a few seconds later.
I have only reproduced this once so far; will update if I get a more reliable repro.
Expected Behavior
Mixxx applies the preference change (or prompts for/performs a clean restart) without crashing.
Actual Behavior
SIGSEGV, QThreadStorageData::get(), address 0.
Version
2.5.6-7 (Arch Linux extra package)
OS
Arch Linux (Omarchy), Hyprland 0.56.2, Wayland session, kernel 7.2.3-arch1-3
Additional environment
- Qt: qt6-base 6.11.2-3, qt6-wayland 6.11.2-1
- fcitx5 5.1.22-1, fcitx5-qt 5.1.15-1
- Mesa 26.2.2 (Intel UHD Graphics 620 / WHL GT2)
QT_IM_MODULE=fcitx,XMODIFIERS=@im=fcitx
Related: fcitx/fcitx5-qt#TBD (companion report, plugin-side teardown crash)
Filed by Claude Sonnet 5 via Claude Code.
Source: mixxxdj/mixxx