# Segfault when trying to start Anki on Linux

**URL:** <https://forums.ankiweb.net/t/segfault-when-trying-to-start-anki-on-linux/727>\
**Category:** Help\
**Created:** [July 4, 2020, 12:01pm UTC](https://forums.ankiweb.net/t/segfault-when-trying-to-start-anki-on-linux/727 "2020-07-04T12:01:31Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![zilrich](https://avatars.discourse-cdn.com/v4/letter/z/3d9bf3/32.png) [@zilrich](https://forums.ankiweb.net/u/zilrich)\
**Post date:** [July 4, 2020, 12:01pm UTC](https://forums.ankiweb.net/t/segfault-when-trying-to-start-anki-on-linux/727/1 "2020-07-04T12:01:31Z")

</div>

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:

```auto
                #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?

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [July 5, 2020, 4:06am UTC](https://forums.ankiweb.net/t/segfault-when-trying-to-start-anki-on-linux/727/2 "2020-07-05T04:06:42Z")

</div>

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](https://changes.ankiweb.net/#/known-issues)

---

<div class="post-metadata">

**Author:** ![zilrich](https://avatars.discourse-cdn.com/v4/letter/z/3d9bf3/32.png) [@zilrich](https://forums.ankiweb.net/u/zilrich)\
**Post date:** [July 5, 2020, 6:52am UTC](https://forums.ankiweb.net/t/segfault-when-trying-to-start-anki-on-linux/727/3 "2020-07-05T06:52:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [July 6, 2020, 1:26am UTC](https://forums.ankiweb.net/t/segfault-when-trying-to-start-anki-on-linux/727/4 "2020-07-06T01:26:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jetri](https://avatars.discourse-cdn.com/v4/letter/j/22d042/32.png) [@jetri](https://forums.ankiweb.net/u/jetri)\
**Post date:** [July 8, 2020, 1:08pm UTC](https://forums.ankiweb.net/t/segfault-when-trying-to-start-anki-on-linux/727/5 "2020-07-08T13:08:15Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![zilrich](https://avatars.discourse-cdn.com/v4/letter/z/3d9bf3/32.png) [@zilrich](https://forums.ankiweb.net/u/zilrich)\
**Post date:** [July 8, 2020, 9:57pm UTC](https://forums.ankiweb.net/t/segfault-when-trying-to-start-anki-on-linux/727/6 "2020-07-08T21:57:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [July 9, 2020, 12:16am UTC](https://forums.ankiweb.net/t/segfault-when-trying-to-start-anki-on-linux/727/7 "2020-07-09T00:16:21Z")

</div>

Can you reproduce the problem with the packaged version?

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

---

<div class="post-metadata">

**Author:** ![jetri](https://avatars.discourse-cdn.com/v4/letter/j/22d042/32.png) [@jetri](https://forums.ankiweb.net/u/jetri)\
**Post date:** [July 9, 2020, 7:06am UTC](https://forums.ankiweb.net/t/segfault-when-trying-to-start-anki-on-linux/727/8 "2020-07-09T07:06:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jetri](https://avatars.discourse-cdn.com/v4/letter/j/22d042/32.png) [@jetri](https://forums.ankiweb.net/u/jetri)\
**Post date:** [July 9, 2020, 7:09am UTC](https://forums.ankiweb.net/t/segfault-when-trying-to-start-anki-on-linux/727/9 "2020-07-09T07:09:34Z")

</div>

> [@zilrich](#):
>
> echo auto \> ~/.local/share/Anki2/gldriver

`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?

---

<div class="post-metadata">

**Author:** ![zilrich](https://avatars.discourse-cdn.com/v4/letter/z/3d9bf3/32.png) [@zilrich](https://forums.ankiweb.net/u/zilrich)\
**Post date:** [July 9, 2020, 8:37am UTC](https://forums.ankiweb.net/t/segfault-when-trying-to-start-anki-on-linux/727/10 "2020-07-09T08:37:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [May 1, 2023, 5:41am UTC](https://forums.ankiweb.net/t/segfault-when-trying-to-start-anki-on-linux/727/11 "2023-05-01T05:41:16Z")

</div>


