A consistent way to crash Anki on Win11 (reopen)

I’ve been having this issue for 6 months now. I have reported it before, but didn’t provide enough info, and it was closed. This time I’ll try to better describe it.

Anki version: every version from v2.1.54 to v⁨2.1.64, not sure about earlier versions.
Win11 version: 21H2 and 22H2, not sure about earlier versions.
Python 3.9.15 Qt 6.4.3 PyQt 6.4.0+

On my PC, I have a consistent way to crashes anki.exe. This is how it happens:

  1. Go to Settings > Time & language > Typing > Advanced keyboard settings > Input language hot keys.
  2. Config a hotkey for switching to English.
  3. Press the hotkey to switch to English when Anki is in focus. (I use this hotkey in all kinds of programs hundreds of times every day whenever I type)
  4. Anki will crash if the hotkey is pressed when any Anki window is in focus - Main window, Add, Browse, etc, with or without a blinking cursor.
    (By “crash” I mean becomes frozen, unresponsive, need to force close)

Screenshot for step 1 and 2:

Screenshot for crash:

Some clarification:

  1. It triggers no matter which key I config to be the hotkey.
  2. It only triggers when switching to English. The other 3 hotkeys shown in my screenshot doesn’t trigger it.
  3. It triggers even if I’m already in English mode, and press the hotkey to switch to English again.
  4. Switching language by clicking the language button in the system tray does not trigger it.
  5. It’s not immediately reproducible after system boot. It only happens after R hours after system boot, where R is random. I’ve tried to close all other programs to see if they could be the cause, but didn’t find any. I also tried restart Window Explorer which didn’t help. I think I have proof that other programs aren’t the cause, more on that later

What DOESN’T fix it:

So after system boot, from time to time I’ll be typing inside Anki and press the hotkey to switch input language. After R hours, I’ll trigger the first crash, then it becomes consistently reproducible, in that:

  1. After Anki crashes, if I force close it and relaunch it, it’ll 100% crash again if I press the hotkey again.
  2. If I force close it, relaunch, then close it again before pressing the hotkey, I can get a “normal shut down”. But that doesn’t prevent the issue on the next launch.
  3. After each force close, a mpv process will be left behind. I don’t know what it is, but manually shutting down these mpv processes don’t prevent the issue on the next launch.

What DOES fix it:

  1. As mentioned, it’s not immediately reproducible after system boot, so rebooting the system temporarily fixes it for R hours.
  2. If I re-run the installer, and the installer is a newer version, it will temporarily fix it for R hours, just like a system reboot. This kinda proves other programs are not the cause.
  3. If I re-run the installer, and the installer is the same version, it doesn’t help.

I understand it may not be easy to reproduce elsewhere, so I wonder if there’s anyway to share something like a verbose log / crash dump file.

This is tracked on Anki hangs on switching language with hot keys for input languages on Windows 10 · Issue #1105 · ankitects/anki · GitHub

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