[Linux, v24.11] Segmentation fault after close event

Opening this in case it’s relevant.

In debian oldstable and sid there is a segfault after closing the app.
This happens consistently when running like so:

gdb --args env QT_DEBUG_PLUGINS=1 anki
Here's the output with only the backtrace:
Thread 1 "anki" received signal SIGSEGV, Segmentation fault.
0x0000555555a93edd in new_threadstate ()
(gdb) bt full
#0  0x0000555555a93edd in new_threadstate ()
#1  0x0000555555a9462f in PyGILState_Ensure ()
#2  0x00007ffff3b619d8 in qtcore_MessageHandler(QtMsgType, QMessageLogContext const&, QString const&) () at /usr/local/share/anki/lib/PyQt6/QtCore.abi3.so
#3  0x00007ffff32ed79b in qt_message_output(QtMsgType, QMessageLogContext const&, QString const&) () at /usr/local/share/anki/lib/PyQt6/Qt6/lib/libQt6Core.so.6
#4  0x00007ffff33008f0 in QDebug::~QDebug() () at /usr/local/share/anki/lib/PyQt6/Qt6/lib/libQt6Core.so.6
#5  0x00007ffff35fd6a9 in ??? () at /usr/local/share/anki/lib/PyQt6/Qt6/lib/libQt6Core.so.6
#6  0x00007ffff36003f0 in ??? () at /usr/local/share/anki/lib/PyQt6/Qt6/lib/libQt6Core.so.6
#7  0x00007ffff35fd739 in ??? () at /usr/local/share/anki/lib/PyQt6/Qt6/lib/libQt6Core.so.6
#8  0x00007ffff7ccb1e1 in __run_exit_handlers (status=0, listp=0x7ffff7e70680 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true)
    at ./stdlib/exit.c:108
        atfct = <optimized out>
        onfct = <optimized out>
        cxafct = 0x7ffff35fd730
        arg = <optimized out>
        f = <optimized out>
        new_exitfn_called = 4847
        cur = 0x7ffff7e71fc0 <initial>
        restart = <optimized out>
#9  0x00007ffff7ccb29a in __GI_exit (status=<optimized out>) at ./stdlib/exit.c:138
#10 0x00005555559a13b5 in std::sys::pal::unix::os::exit ()
#11 0x00005555559a1344 in std::process::exit ()
#12 0x000055555588b439 in anki::main ()
#13 0x0000555555889a43 in std::sys::backtrace::__rust_begin_short_backtrace ()
#14 0x000055555588e75b in main ()
And here the entire output:
GNU gdb (Debian 15.2-1) 15.2
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from env...
(No debugging symbols found in env)
(gdb) r
Starting program: /usr/bin/env QT_DEBUG_PLUGINS=1 anki
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
process 4577 is executing new program: /usr/local/share/anki/anki
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Anki starting...
Initial setup...
[Detaching after fork from child process 4580]
[Detaching after fork from child process 4595]
Preparing to run...
Wayland support is disabled by default due to bugs:
https://github.com/ankitects/anki/issues/1767
You can force it on with an env var: ANKI_WAYLAND=1
Qt debug: checking directory path "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms" ... 
Qt debug: looking at "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms/libqwayland-egl.so" 
Qt debug: Found metadata in lib /usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms/libqwayland-egl.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "wayland-egl"
        ]
    },
    "archlevel": 1,
    "className": "QWaylandEglPlatformIntegrationPlugin",
    "debug": false,
    "version": 394752
}

 
Qt debug: Got keys from plugin meta data QList("wayland-egl") 
Qt debug: looking at "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms/libqminimalegl.so" 
Qt debug: Found metadata in lib /usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms/libqminimalegl.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "minimalegl"
        ]
    },
    "archlevel": 1,
    "className": "QMinimalEglIntegrationPlugin",
    "debug": false,
    "version": 394752
}

 
Qt debug: Got keys from plugin meta data QList("minimalegl") 
Qt debug: looking at "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms/libqoffscreen.so" 
Qt debug: Found metadata in lib /usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms/libqoffscreen.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "offscreen"
        ]
    },
    "archlevel": 1,
    "className": "QOffscreenIntegrationPlugin",
    "debug": false,
    "version": 394752
}

 
Qt debug: Got keys from plugin meta data QList("offscreen") 
Qt debug: looking at "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms/libqwayland-generic.so" 
Qt debug: Found metadata in lib /usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms/libqwayland-generic.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "wayland"
        ]
    },
    "archlevel": 1,
    "className": "QWaylandIntegrationPlugin",
    "debug": false,
    "version": 394752
}

 
Qt debug: Got keys from plugin meta data QList("wayland") 
Qt debug: looking at "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms/libqxcb.so" 
Qt debug: Found metadata in lib /usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms/libqxcb.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "xcb"
        ]
    },
    "archlevel": 1,
    "className": "QXcbIntegrationPlugin",
    "debug": false,
    "version": 394752
}

 
Qt debug: Got keys from plugin meta data QList("xcb") 
Qt debug: looking at "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms/libqeglfs.so" 
Qt debug: Found metadata in lib /usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms/libqeglfs.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "eglfs"
        ]
    },
    "archlevel": 1,
    "className": "QEglFSIntegrationPlugin",
    "debug": false,
    "version": 394752
}

 
Qt debug: Got keys from plugin meta data QList("eglfs") 
Qt debug: looking at "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms/libqvnc.so" 
Qt debug: Found metadata in lib /usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms/libqvnc.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "vnc"
        ]
    },
    "archlevel": 1,
    "className": "QVncIntegrationPlugin",
    "debug": false,
    "version": 394752
}

 
Qt debug: Got keys from plugin meta data QList("vnc") 
Qt debug: looking at "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms/libqvkkhrdisplay.so" 
Qt debug: Found metadata in lib /usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms/libqvkkhrdisplay.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "vkkhrdisplay"
        ]
    },
    "archlevel": 1,
    "className": "QVkKhrDisplayIntegrationPlugin",
    "debug": false,
    "version": 394752
}

 
Qt debug: Got keys from plugin meta data QList("vkkhrdisplay") 
Qt debug: looking at "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms/libqlinuxfb.so" 
Qt debug: Found metadata in lib /usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms/libqlinuxfb.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "linuxfb"
        ]
    },
    "archlevel": 1,
    "className": "QLinuxFbIntegrationPlugin",
    "debug": false,
    "version": 394752
}

 
Qt debug: Got keys from plugin meta data QList("linuxfb") 
Qt debug: looking at "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms/libqminimal.so" 
Qt debug: Found metadata in lib /usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms/libqminimal.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "minimal"
        ]
    },
    "archlevel": 1,
    "className": "QMinimalIntegrationPlugin",
    "debug": false,
    "version": 394752
}

 
Qt debug: Got keys from plugin meta data QList("minimal") 
Qt debug: checking directory path "/usr/local/share/anki/platforms" ... 
Qt debug: "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms/libqxcb.so" loaded library 
[New Thread 0x7fffe18a96c0 (LWP 4596)]
[New Thread 0x7fffe10a86c0 (LWP 4597)]
Qt debug: checking directory path "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/platformthemes" ... 
Qt debug: looking at "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/platformthemes/libqgtk3.so" 
Qt debug: Found metadata in lib /usr/local/share/anki/lib/PyQt6/Qt6/plugins/platformthemes/libqgtk3.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformThemeFactoryInterface.5.1",
    "MetaData": {
        "Keys": [
            "gtk3"
        ]
    },
    "archlevel": 1,
    "className": "QGtk3ThemePlugin",
    "debug": false,
    "version": 394752
}

 
Qt debug: Got keys from plugin meta data QList("gtk3") 
Qt debug: looking at "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/platformthemes/libqxdgdesktopportal.so" 
Qt debug: Found metadata in lib /usr/local/share/anki/lib/PyQt6/Qt6/plugins/platformthemes/libqxdgdesktopportal.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformThemeFactoryInterface.5.1",
    "MetaData": {
        "Keys": [
            "xdgdesktopportal",
            "flatpak",
            "snap"
        ]
    },
    "archlevel": 1,
    "className": "QXdgDesktopPortalThemePlugin",
    "debug": false,
    "version": 394752
}

 
Qt debug: Got keys from plugin meta data QList("xdgdesktopportal", "flatpak", "snap") 
Qt debug: checking directory path "/usr/local/share/anki/platformthemes" ... 
Qt debug: "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/platformthemes/libqgtk3.so" loaded library 
[New Thread 0x7fffdb4616c0 (LWP 4598)]
[New Thread 0x7fffdac606c0 (LWP 4599)]
[New Thread 0x7fffda45f6c0 (LWP 4600)]
[New Thread 0x7fffd9c1d6c0 (LWP 4601)]
Qt debug: checking directory path "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforminputcontexts" ... 
Qt debug: looking at "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so" 
Qt debug: Found metadata in lib /usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so, metadata=
{
    "IID": "org.qt-project.Qt.QPlatformInputContextFactoryInterface.5.1",
    "MetaData": {
        "Keys": [
            "fcitx",
            "fcitx5"
        ]
    },
    "archlevel": 1,
    "className": "QFcitx5PlatformInputContextPlugin",
    "debug": false,
    "version": 394496
}

 
Qt debug: Got keys from plugin meta data QList("fcitx", "fcitx5") 
Qt debug: looking at "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so" 
Qt debug: Found metadata in lib /usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so, metadata=
{
    "IID": "org.qt-project.Qt.QPlatformInputContextFactoryInterface.5.1",
    "MetaData": {
        "Keys": [
            "compose",
            "xim"
        ]
    },
    "archlevel": 1,
    "className": "QComposePlatformInputContextPlugin",
    "debug": false,
    "version": 394752
}

 
Qt debug: Got keys from plugin meta data QList("compose", "xim") 
Qt debug: looking at "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so" 
Qt debug: Found metadata in lib /usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so, metadata=
{
    "IID": "org.qt-project.Qt.QPlatformInputContextFactoryInterface.5.1",
    "MetaData": {
        "Keys": [
            "ibus"
        ]
    },
    "archlevel": 1,
    "className": "QIbusPlatformInputContextPlugin",
    "debug": false,
    "version": 394752
}

 
Qt debug: Got keys from plugin meta data QList("ibus") 
Qt debug: checking directory path "/usr/local/share/anki/platforminputcontexts" ... 
Qt debug: "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so" loaded library 
Qt debug: checking directory path "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/xcbglintegrations" ... 
Qt debug: looking at "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/xcbglintegrations/libqxcb-glx-integration.so" 
Qt debug: Found metadata in lib /usr/local/share/anki/lib/PyQt6/Qt6/plugins/xcbglintegrations/libqxcb-glx-integration.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.Xcb.QXcbGlIntegrationFactoryInterface.5.5",
    "MetaData": {
        "Keys": [
            "xcb_glx"
        ]
    },
    "archlevel": 1,
    "className": "QXcbGlxIntegrationPlugin",
    "debug": false,
    "version": 394752
}

 
Qt debug: Got keys from plugin meta data QList("xcb_glx") 
Qt debug: looking at "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/xcbglintegrations/libqxcb-egl-integration.so" 
Qt debug: Found metadata in lib /usr/local/share/anki/lib/PyQt6/Qt6/plugins/xcbglintegrations/libqxcb-egl-integration.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.Xcb.QXcbGlIntegrationFactoryInterface.5.5",
    "MetaData": {
        "Keys": [
            "xcb_egl"
        ]
    },
    "archlevel": 1,
    "className": "QXcbEglIntegrationPlugin",
    "debug": false,
    "version": 394752
}

 
Qt debug: Got keys from plugin meta data QList("xcb_egl") 
Qt debug: checking directory path "/usr/local/share/anki/xcbglintegrations" ... 
Qt debug: "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/xcbglintegrations/libqxcb-glx-integration.so" loaded library 
[New Thread 0x7fffcd7ff6c0 (LWP 4602)]
[New Thread 0x7fffccffe6c0 (LWP 4603)]
[New Thread 0x7fffaffff6c0 (LWP 4604)]
[New Thread 0x7fffaf7fe6c0 (LWP 4605)]
[New Thread 0x7fffaeffd6c0 (LWP 4606)]
[New Thread 0x7fffae7fc6c0 (LWP 4607)]
[New Thread 0x7fffadffb6c0 (LWP 4608)]
[New Thread 0x7fffad7fa6c0 (LWP 4609)]
[New Thread 0x7fffacff96c0 (LWP 4610)]
[New Thread 0x7fffa7fff6c0 (LWP 4611)]
[New Thread 0x7fffa77fe6c0 (LWP 4612)]
[New Thread 0x7fffa6ffd6c0 (LWP 4613)]
[New Thread 0x7fffa67fc6c0 (LWP 4614)]
[New Thread 0x7fffa5ffb6c0 (LWP 4615)]
[New Thread 0x7fffa57fa6c0 (LWP 4616)]
Qt debug: checking directory path "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/styles" ... 
Qt debug: checking directory path "/usr/local/share/anki/styles" ... 
[New Thread 0x7fffa4ff96c0 (LWP 4617)]
[New Thread 0x7fff9bfff6c0 (LWP 4618)]
[New Thread 0x7fff9b7fe6c0 (LWP 4619)]
[Detaching after fork from child process 4620]
[New Thread 0x7fff9a7ff6c0 (LWP 4621)]
[New Thread 0x7fff99ffe6c0 (LWP 4622)]
2024-12-07 04:28:46,339:INFO:aqt.mediasrv: Serving on http://127.0.0.1:44567
Qt debug: checking directory path "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats" ... 
Qt debug: looking at "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqjpeg.so" 
Qt debug: Found metadata in lib /usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqjpeg.so, metadata=
{
    "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface",
    "MetaData": {
        "Keys": [
            "jpg",
            "jpeg"
        ],
        "MimeTypes": [
            "image/jpeg",
            "image/jpeg"
        ]
    },
    "archlevel": 1,
    "className": "QJpegPlugin",
    "debug": false,
    "version": 394752
}

 
Qt debug: Got keys from plugin meta data QList("jpg", "jpeg") 
Qt debug: looking at "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqpdf.so" 
Qt debug: Found metadata in lib /usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqpdf.so, metadata=
{
    "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface",
    "MetaData": {
        "Keys": [
            "pdf"
        ],
        "MimeTypes": [
            "application/pdf"
        ]
    },
    "archlevel": 1,
    "className": "QPdfPlugin",
    "debug": false,
    "version": 394752
}

 
Qt debug: Got keys from plugin meta data QList("pdf") 
Qt debug: looking at "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqtiff.so" 
Qt debug: Found metadata in lib /usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqtiff.so, metadata=
{
    "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface",
    "MetaData": {
        "Keys": [
            "tiff",
            "tif"
        ],
        "MimeTypes": [
            "image/tiff",
            "image/tiff"
        ]
    },
    "archlevel": 1,
    "className": "QTiffPlugin",
    "debug": false,
    "version": 394752
}

 
Qt debug: Got keys from plugin meta data QList("tiff", "tif") 
Qt debug: looking at "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqwbmp.so" 
Qt debug: Found metadata in lib /usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqwbmp.so, metadata=
{
    "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface",
    "MetaData": {
        "Keys": [
            "wbmp"
        ],
        "MimeTypes": [
            "image/vnd.wap.wbmp"
        ]
    },
    "archlevel": 1,
    "className": "QWbmpPlugin",
    "debug": false,
    "version": 394752
}

 
Qt debug: Got keys from plugin meta data QList("wbmp") 
Qt debug: looking at "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqicns.so" 
Qt debug: Found metadata in lib /usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqicns.so, metadata=
{
    "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface",
    "MetaData": {
        "Keys": [
            "icns"
        ],
        "MimeTypes": [
            "image/x-icns"
        ]
    },
    "archlevel": 1,
    "className": "QICNSPlugin",
    "debug": false,
    "version": 394752
}

 
Qt debug: Got keys from plugin meta data QList("icns") 
Qt debug: looking at "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqsvg.so" 
Qt debug: Found metadata in lib /usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqsvg.so, metadata=
{
    "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface",
    "MetaData": {
        "Keys": [
            "svg",
            "svgz"
        ],
        "MimeTypes": [
            "image/svg+xml",
            "image/svg+xml-compressed"
        ]
    },
    "archlevel": 1,
    "className": "QSvgPlugin",
    "debug": false,
    "version": 394752
}

 
Qt debug: Got keys from plugin meta data QList("svg", "svgz") 
Qt debug: looking at "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqico.so" 
Qt debug: Found metadata in lib /usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqico.so, metadata=
{
    "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface",
    "MetaData": {
        "Keys": [
            "ico",
            "cur"
        ],
        "MimeTypes": [
            "image/vnd.microsoft.icon",
            "image/vnd.microsoft.icon"
        ]
    },
    "archlevel": 1,
    "className": "QICOPlugin",
    "debug": false,
    "version": 394752
}

 
Qt debug: Got keys from plugin meta data QList("ico", "cur") 
Qt debug: looking at "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqgif.so" 
Qt debug: Found metadata in lib /usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqgif.so, metadata=
{
    "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface",
    "MetaData": {
        "Keys": [
            "gif"
        ],
        "MimeTypes": [
            "image/gif"
        ]
    },
    "archlevel": 1,
    "className": "QGifPlugin",
    "debug": false,
    "version": 394752
}

 
Qt debug: Got keys from plugin meta data QList("gif") 
Qt debug: looking at "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqtga.so" 
Qt debug: Found metadata in lib /usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqtga.so, metadata=
{
    "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface",
    "MetaData": {
        "Keys": [
            "tga"
        ],
        "MimeTypes": [
            "image/x-tga"
        ]
    },
    "archlevel": 1,
    "className": "QTgaPlugin",
    "debug": false,
    "version": 394752
}

 
Qt debug: Got keys from plugin meta data QList("tga") 
Qt debug: looking at "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqwebp.so" 
Qt debug: Found metadata in lib /usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqwebp.so, metadata=
{
    "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface",
    "MetaData": {
        "Keys": [
            "webp"
        ],
        "MimeTypes": [
            "image/webp"
        ]
    },
    "archlevel": 1,
    "className": "QWebpPlugin",
    "debug": false,
    "version": 394752
}

 
Qt debug: Got keys from plugin meta data QList("webp") 
Qt debug: checking directory path "/usr/local/share/anki/imageformats" ... 
Qt debug: "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqjpeg.so" loaded library 
Qt debug: "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqpdf.so" loaded library 
Qt debug: "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqtiff.so" loaded library 
Qt debug: "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqwbmp.so" loaded library 
Qt debug: "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqicns.so" loaded library 
Qt debug: "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqsvg.so" loaded library 
Qt debug: "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqico.so" loaded library 
Qt debug: "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqgif.so" loaded library 
Qt debug: "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqtga.so" loaded library 
Qt debug: "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/imageformats/libqwebp.so" loaded library 
Qt debug: checking directory path "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/iconengines" ... 
Qt debug: looking at "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/iconengines/libqsvgicon.so" 
Qt debug: Found metadata in lib /usr/local/share/anki/lib/PyQt6/Qt6/plugins/iconengines/libqsvgicon.so, metadata=
{
    "IID": "org.qt-project.Qt.QIconEngineFactoryInterface",
    "MetaData": {
        "Keys": [
            "svg",
            "svgz",
            "svg.gz"
        ]
    },
    "archlevel": 1,
    "className": "QSvgIconPlugin",
    "debug": false,
    "version": 394752
}

 
Qt debug: Got keys from plugin meta data QList("svg", "svgz", "svg.gz") 
Qt debug: checking directory path "/usr/local/share/anki/iconengines" ... 
[New Thread 0x7fff8f7ff6c0 (LWP 4627)]
[Detaching after fork from child process 4628]
[Detaching after fork from child process 4629]
[Detaching after fork from child process 4630]
[New Thread 0x7fff8effe6c0 (LWP 4633)]
[New Thread 0x7fff8e7fd6c0 (LWP 4634)]
[New Thread 0x7fff8dffc6c0 (LWP 4635)]
[New Thread 0x7fff8d7fb6c0 (LWP 4636)]
[New Thread 0x7fff8cffa6c0 (LWP 4638)]
[New Thread 0x7fff83fff6c0 (LWP 4637)]
[New Thread 0x7fff837fe6c0 (LWP 4639)]
[New Thread 0x7fff82ffd6c0 (LWP 4640)]
[New Thread 0x7fff81ffb6c0 (LWP 4642)]
[New Thread 0x7fff827fc6c0 (LWP 4641)]
[New Thread 0x7fff817fa6c0 (LWP 4643)]
[New Thread 0x7fff80ff96c0 (LWP 4644)]
[New Thread 0x7fff77fff6c0 (LWP 4645)]
[New Thread 0x7fff777fe6c0 (LWP 4646)]
[New Thread 0x7fff76ffd6c0 (LWP 4647)]
[New Thread 0x7fff767fc6c0 (LWP 4648)]
[New Thread 0x7fff75ffb6c0 (LWP 4649)]
[New Thread 0x7fff757fa6c0 (LWP 4650)]
Starting main loop...
Qt debug: checking directory path "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/accessiblebridge" ... 
Qt debug: checking directory path "/usr/local/share/anki/accessiblebridge" ... 
Qt debug: checking directory path "/usr/local/share/anki/lib/PyQt6/Qt6/plugins/accessible" ... 
Qt debug: checking directory path "/usr/local/share/anki/accessible" ... 
[New Thread 0x7fff74ff96c0 (LWP 4657)]
[New Thread 0x7fff6bfff6c0 (LWP 4659)]
[New Thread 0x7fff6affd6c0 (LWP 4665)]
[Detaching after fork from child process 4672]
mpv not found, reverting to mplayer
[New Thread 0x7fff6a7fc6c0 (LWP 4683)]
[New Thread 0x7fff747f86c0 (LWP 4684)]
[New Thread 0x7fff745f76c0 (LWP 4685)]
[4651:7:1207/042847.684471:ERROR:command_buffer_proxy_impl.cc(128)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
[4666:7:1207/042847.818175:ERROR:command_buffer_proxy_impl.cc(128)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
[4675:7:1207/042847.822381:ERROR:command_buffer_proxy_impl.cc(128)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
2024-12-07 04:28:48,751:WARNING:waitress: unhandled close event
[Thread 0x7fff9a7ff6c0 (LWP 4621) exited]
[Thread 0x7fff99ffe6c0 (LWP 4622) exited]
[Thread 0x7fff9b7fe6c0 (LWP 4619) exited]
[Thread 0x7fff9bfff6c0 (LWP 4618) exited]
[Thread 0x7fff6a7fc6c0 (LWP 4683) exited]
[Thread 0x7fff6affd6c0 (LWP 4665) exited]
[Thread 0x7fffa4ff96c0 (LWP 4617) exited]
[Thread 0x7fff767fc6c0 (LWP 4648) exited]
[Thread 0x7fff777fe6c0 (LWP 4646) exited]
[Thread 0x7fff77fff6c0 (LWP 4645) exited]
[Thread 0x7fff80ff96c0 (LWP 4644) exited]
[Thread 0x7fff8d7fb6c0 (LWP 4636) exited]
[Thread 0x7fff8e7fd6c0 (LWP 4634) exited]
[Thread 0x7fff76ffd6c0 (LWP 4647) exited]
[Thread 0x7fffe10a86c0 (LWP 4597) exited]
[Thread 0x7fffa5ffb6c0 (LWP 4615) exited]
[Thread 0x7fffa67fc6c0 (LWP 4614) exited]
[Thread 0x7fffa6ffd6c0 (LWP 4613) exited]
[Thread 0x7fffa77fe6c0 (LWP 4612) exited]
[Thread 0x7fffa7fff6c0 (LWP 4611) exited]
[Thread 0x7fffacff96c0 (LWP 4610) exited]
[Thread 0x7fffad7fa6c0 (LWP 4609) exited]
[Thread 0x7fffadffb6c0 (LWP 4608) exited]
[Thread 0x7fffae7fc6c0 (LWP 4607) exited]
[Thread 0x7fffaeffd6c0 (LWP 4606) exited]
[Thread 0x7fffaf7fe6c0 (LWP 4605) exited]
[Thread 0x7fffaffff6c0 (LWP 4604) exited]
[Thread 0x7fffccffe6c0 (LWP 4603) exited]
[Thread 0x7fffcd7ff6c0 (LWP 4602) exited]
[Thread 0x7fffa57fa6c0 (LWP 4616) exited]
[Thread 0x7fff745f76c0 (LWP 4685) exited]
[Thread 0x7fff747f86c0 (LWP 4684) exited]
[Thread 0x7fffe18a96c0 (LWP 4596) exited]

Thread 1 "anki" received signal SIGSEGV, Segmentation fault.
0x0000555555a93edd in new_threadstate ()
(gdb) bt full
#0  0x0000555555a93edd in new_threadstate ()
#1  0x0000555555a9462f in PyGILState_Ensure ()
#2  0x00007ffff3b619d8 in qtcore_MessageHandler(QtMsgType, QMessageLogContext const&, QString const&) () at /usr/local/share/anki/lib/PyQt6/QtCore.abi3.so
#3  0x00007ffff32ed79b in qt_message_output(QtMsgType, QMessageLogContext const&, QString const&) () at /usr/local/share/anki/lib/PyQt6/Qt6/lib/libQt6Core.so.6
#4  0x00007ffff33008f0 in QDebug::~QDebug() () at /usr/local/share/anki/lib/PyQt6/Qt6/lib/libQt6Core.so.6
#5  0x00007ffff35fd6a9 in ??? () at /usr/local/share/anki/lib/PyQt6/Qt6/lib/libQt6Core.so.6
#6  0x00007ffff36003f0 in ??? () at /usr/local/share/anki/lib/PyQt6/Qt6/lib/libQt6Core.so.6
#7  0x00007ffff35fd739 in ??? () at /usr/local/share/anki/lib/PyQt6/Qt6/lib/libQt6Core.so.6
#8  0x00007ffff7ccb1e1 in __run_exit_handlers (status=0, listp=0x7ffff7e70680 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true)
    at ./stdlib/exit.c:108
        atfct = <optimized out>
        onfct = <optimized out>
        cxafct = 0x7ffff35fd730
        arg = <optimized out>
        f = <optimized out>
        new_exitfn_called = 4847
        cur = 0x7ffff7e71fc0 <initial>
        restart = <optimized out>
#9  0x00007ffff7ccb29a in __GI_exit (status=<optimized out>) at ./stdlib/exit.c:138
#10 0x00005555559a13b5 in std::sys::pal::unix::os::exit ()
#11 0x00005555559a1344 in std::process::exit ()
#12 0x000055555588b439 in anki::main ()
#13 0x0000555555889a43 in std::sys::backtrace::__rust_begin_short_backtrace ()
#14 0x000055555588e75b in main ()

Anki version:

Anki 24.11 (87ccd24e)  
Python 3.9.18 Qt 6.6.2 PyQt 6.6.1
Platform: Linux-6.11.9-amd64-x86_64-with-glibc2.40

Previously mentioned by @dissopeach in Anki no longer produces sound after reboot (Linux) :

Notes about the log below… mildly odd that Anki segfaulted on close? Doesn’t do that without QT_DEBUG_PLUGINS=1, though, so ignore it.

What mesa version do you have? are you on Wayland? When did the problems appear?

24.2.7 according to glxinfo.

Yes.

No idea. I only noticed it because of @dissopeach (see quote in my topic above).

In debian oldstable this looks a little bit different.

gdb backtrace
Thread 1 "anki" received signal SIGSEGV, Segmentation fault.
0x0000555555a93edd in new_threadstate ()
(gdb) bt full
#0  0x0000555555a93edd in new_threadstate ()
#1  0x0000555555a9462f in PyGILState_Ensure ()
#2  0x00007ffff3b619d8 in qtcore_MessageHandler(QtMsgType, QMessageLogContext const&, QString const&) () at /usr/local/share/anki/lib/PyQt6/QtCore.abi3.so
#3  0x00007ffff32ed79b in qt_message_output(QtMsgType, QMessageLogContext const&, QString const&) () at /usr/local/share/anki/lib/PyQt6/Qt6/lib/libQt6Core.so.6
#4  0x00007ffff33008f0 in QDebug::~QDebug() ()
    at /usr/local/share/anki/lib/PyQt6/Qt6/lib/libQt6Core.so.6
#5  0x00007ffff35fd6a9 in  ()
    at /usr/local/share/anki/lib/PyQt6/Qt6/lib/libQt6Core.so.6
#6  0x00007ffff36003f0 in  ()
    at /usr/local/share/anki/lib/PyQt6/Qt6/lib/libQt6Core.so.6
#7  0x00007ffff35fd739 in  ()
    at /usr/local/share/anki/lib/PyQt6/Qt6/lib/libQt6Core.so.6
#8  0x00007ffff7c7a587 in __run_exit_handlers
    (status=0, listp=0x7ffff7e0d718 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:108
        atfct = <optimized out>
        onfct = <optimized out>
        cxafct = <optimized out>
        f = <optimized out>
        new_exitfn_called = 5053
        cur = 0x7ffff7e0ee20 <initial>
--Type <RET> for more, q to quit, c to continue without paging--c
#9  0x00007ffff7c7a72a in __GI_exit (status=<optimized out>) at exit.c:139
#10 0x00005555559a13b5 in  ()
#11 0x00005555559a1344 in  ()
#12 0x000055555588b439 in anki::main ()
#13 0x0000555555889a43 in std::sys::backtrace::__rust_begin_short_backtrace ()
#14 0x000055555588e75b in main ()

X11, mesa 20.3.5

I’ve made a quick and dirty fix for this:

2 Likes

I cloned your repo and ran ./run.

Anki now immediately throws the “a problem occured” dialog with the following contents:

Anki 24.10 (e9653956) (src) 
Python 3.9.18 Qt 6.6.2 PyQt 6.6.1
Platform: Linux-6.11.9-amd64-x86_64-with-glibc2.40

Traceback (most recent call last):
  File "/home/anon/Downloads/anki/Source_Code/anki_fix_segfault_on_exit/qt/aqt/progress.py", line 121, in handler
    func()
  File "/home/anon/Downloads/anki/Source_Code/anki_fix_segfault_on_exit/qt/aqt/main.py", line 226, in on_window_init
    fn()
  File "/home/anon/Downloads/anki/Source_Code/anki_fix_segfault_on_exit/qt/aqt/main.py", line 325, in setupProfile
    self.loadProfile()
  File "/home/anon/Downloads/anki/Source_Code/anki_fix_segfault_on_exit/qt/aqt/main.py", line 512, in loadProfile
    self.backend.init_addons(os.path.join(self.pm.profileFolder(), "addons"))
  File "/home/anon/Downloads/anki/Source_Code/anki_fix_segfault_on_exit/out/pylib/anki/_backend_generated.py", line 216, in init_addons
    raw_bytes = self._run_command(3, 6, message.SerializeToString())
  File "/home/anon/Downloads/anki/Source_Code/anki_fix_segfault_on_exit/pylib/anki/_backend.py", line 172, in _run_command
    raise backend_exception_to_pylib(err)
anki.errors.BackendIOError: No such file or directory (os error 2)

(as a sidenote: yes, doing the same with ankis repo works fine)

That’s odd. I really cannot see how anything in my patch could do that.

Something seems to be going wrong when Anki is loading addons, which I did not touch at all.

I’ve tested it running in a Debian 11 VM (new profile, no addons) and it’s fine.

1 Like

I’m in a vm, debian sid, no add ons.

I was confused about the init_addons line too but maybe it’s triggered by something else?

Does it still do it if you hold shift at startup to skip loading addon?

I would have guessed weird file permissions stuff from the No such file or directory (os error 2) but if the current Anki main on the same clean VM is working I do not have a clue what is going on.

Just as a sane test: I removed the folders Anki and Anki2.

Running ./run now asks to set the language (I chose english) and then another dialog that wants me to confirm. Afterwards I get the “error occured” popup with the debug info provided above.

Yes.

Same here. Missing files would be strange too considering current anki works great.

I’m afriad I have to tell you your computer has been cursed with dark magics. This makes no sense.

1 Like

I get where you’re coming from.

QT_DEBUG_PLUGINS=1 ./run by the way results in the same behavior.

This is really dumb, and should be no different to checking out main, but what happens when you comment out the only change I made?

qt/aqt/__init__.py line 529

It should read:

atexit.register(qInstallMessageHandler, None)

Actually, nevermind all the stuff I wrote above.

I forget to checkout fix-segfault-on-exit after cloning your repo (I was on wasm-addons-dev).

Your fix works, the process now exits normally with and without QT_DEBUG_PLUGINS=1.

Sorry about that.

I realised that just before you posted.

Over a month ago I made a proof-of-concept of using wasm to create Anki addons.

It’s the default branch of my fork and I forgot the version I pushed to the public repo required you to manually create some directories.

At least we know your computer is not cursed :partying_face:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.