Segfault when trying to start Anki on Linux

Hello,
I have tried downloading both Anki 2.1.22 and 2.1.26 and installing. In both cases I initially get the window asking me what language I’d like the user interface to be, and after confirming, I get a segfault. When I try to open Anki again, I get a segfault immediately.
I am running OpenSUSE Tumbleweed. I have also tried the version packaged with my distribution, which is out of date, but I get the same results.
Here is the stack trace from the core dump:

                #0  0x00007f592b8cc4b1 raise (libc.so.6 + 0x3c4b1)
                #1  0x000000000040531c n/a (anki + 0x531c)
                #2  0x0000000000403170 n/a (anki + 0x3170)
                #3  0x00007f592b8b6cca __libc_start_main (libc.so.6 + 0x26cca)
                #4  0x0000000000401a9e n/a (anki + 0x1a9e)

Does anyone know what could be causing this issue?

I can’t reproduce this - I installed Tumbleweed today with the default KDE desktop, and Anki runs for me without crashing. Maybe it’s an issue with your video driver? https://changes.ankiweb.net/#/known-issues

2 Likes

Thank you for going through the effort to try and reproduce this issue. It was indeed caused by the video driver it seems. Using auto or angle both work. I’m sorry, I missed the startup issues heading when looking through the known issues before.

No problem, glad you were able to resolve the issue.

Hi,
I have the same error pattern on a Debian Linux System (Architecture amd64, Distribution Bullseye = Testing), using the anki package from debian’s repository “anki (2.1.15+dfsg-2)”.

Anki asks for the interface language and displays a confirmation dialog. Then it crashes.
If I try again anki crashes immediatly.

Output of console:
anki
mpv not found, reverting to mplayer
qt: QXcbConnection: XCB error: 3 (BadWindow), sequence: 1012, resource id: 50331724, major code: 40 (TranslateCoords), minor code: 0
Speicherzugriffsfehler

Content of crash.log:
Fatal Python error: Segmentation fault

Thread 0x00007fac8e717700 (most recent call first):
  File "/usr/lib/python3.8/selectors.py", line 415 in select
  File "/usr/lib/python3.8/socketserver.py", line 232 in serve_forever
  File "/usr/share/anki/aqt/mediasrv.py", line 61 in run
  File "/usr/lib/python3.8/threading.py", line 932 in _bootstrap_inner
  File "/usr/lib/python3.8/threading.py", line 890 in _bootstrap

Current thread 0x00007facde883740 (most recent call first):
  File "/usr/share/anki/aqt/main.py", line 269 in loadProfile
  File "/usr/share/anki/aqt/main.py", line 137 in setupProfile
  File "/usr/share/anki/aqt/progress.py", line 72 in handler
  File "/usr/share/anki/aqt/__init__.py", line 364 in _run
  File "/usr/share/anki/aqt/__init__.py", line 276 in run
  File "/usr/bin/anki", line 7 in <module>

Any idea?

Have you tried the same solution that worked for me?
echo auto > ~/.local/share/Anki2/gldriver

Can you reproduce the problem with the packaged version?

https://faqs.ankiweb.net/third-party-linux-packages-and-source-builds-are-not-supported.html

1 Like

Using anki-2.1.26-linux-amd64.tar.bz2:

make install -> everything is ok. The application gets compiled and installed.

Starting results in
/usr/local/bin/anki
qt: QXcbConnection: XCB error: 3 (BadWindow), sequence: 539, resource id: 37748883, major code: 40 (TranslateCoords), minor code: 0
mpv not found, reverting to mplayer
qt: QXcbConnection: XCB error: 3 (BadWindow), sequence: 648, resource id: 37748893, major code: 40 (TranslateCoords), minor code: 0
Speicherzugriffsfehler

with same behavior: anki asks for the gui language, then the confirmation dialog appears, then it crashes.

crash.log:
Fatal Python error: Segmentation fault

Thread 0x00007fc8feffd700 (most recent call first):
File “concurrent/futures/thread.py”, line 78 in _worker
File “threading.py”, line 870 in run
File “threading.py”, line 932 in _bootstrap_inner
File “threading.py”, line 890 in _bootstrap

Thread 0x00007fc8ff7fe700 (most recent call first):
File “subprocess.py”, line 1011 in communicate
File “subprocess.py”, line 491 in run
File “subprocess.py”, line 411 in check_output
File “distro.py”, line 1012 in _lsb_release_info
File “distro.py”, line 552 in get
File “distro.py”, line 899 in lsb_release_attr
File “distro.py”, line 737 in version
File “distro.py”, line 677 in linux_distribution
File “distro.py”, line 122 in linux_distribution
File “anki/utils.py”, line 358 in platDesc
File “aqt/update.py”, line 29 in _data
File “aqt/update.py”, line 39 in run

Thread 0x00007fc953bfd700 (most recent call first):
File “selectors.py”, line 415 in select
File “socketserver.py”, line 232 in serve_forever
File “aqt/mediasrv.py”, line 64 in run
File “threading.py”, line 932 in _bootstrap_inner
File “threading.py”, line 890 in _bootstrap

Current thread 0x00007fc9a582d740 (most recent call first):
File “aqt/main.py”, line 387 in loadProfile
File “aqt/main.py”, line 199 in setupProfile
File “aqt/progress.py”, line 43 in handler
File “aqt/init.py”, line 514 in _run
File “aqt/init.py”, line 368 in run
File “runanki”, line 4 in

echo auto > ~/.local/share/Anki2/gldriver seems to work. Application is able to start up.

Thanks a lot.

By the way: what’s the reason for this?

Looks like software rendering doesn’t work on some systems and this enables hardware accelerated rendering if I understand correctly.