Anki Forums

Windows update broke Anki

I did that too. The text shown is the same that someone posted above.

It might be a long shot, but maybe

1 Like

Hi @kelciour , thanks for all the details!
I followed the steps one by one.

At the end, when I run the command
\pyenv\scripts\anki

Same thing happens, I see the process Anki.exe starting in the task manager and then gone after a few secs.
If I look in the event viewer this time I can see python.exe failing:

Faulting application name: python.exe, version: 3.8.7150.1013, time stamp: 0x5fe0e34b
Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000
Exception code: 0xc0000005
Fault offset: 0x0000000000000000
Faulting process id: 0x24bc
Faulting application start time: 0x01d6daab0ff334e3
Faulting application path: C:\Users\unarc\AppData\Local\Programs\Python\Python38\python.exe
Faulting module path: unknown
Report Id: f9eaa863-9b15-4712-90a9-80bae829744d
Faulting package full name:
Faulting package-relative application ID:

Although I see this error only when I try to run
\pyenv\scripts\anki`

I can normally use the rest of python apps and I can also run python.exe itself.

I’m not sure if my skills will be enough to help with it but I googled a bit and at the moment can suggest to

  • Uninstall Python 3.8, delete pyenv folder from C:\, then install Python 3.9.1 from https://www.python.org/downloads/ and try to run Anki again using pre-built Python wheels.

  • Run the following command (or something similar) to print the full event log for the most recent crash or maybe it’ll be the same as in the event viewer and won’t reveal anything new.

    wevtutil qe application /rd:true /c:1 /format:text /q:"*[System[Provider[@Name='Application Error']]][EventData[Data='python.exe']]"

    Additionally, start Anki using the following command. It might provide some new information (if I get it right).

    \pyenv\scripts\python -X faulthandler -c "import aqt; aqt.run()"

    or

    set PYTHONFAULTHANDLER=1 && \pyenv\scripts\python -c "import aqt; aqt.run()"

    Issue 29908: Inconsistent crashing with an access violation - Python tracker

2 Likes

hi @kelciour,
thanks again for the detail and the effort you are taking.

Following again the steps one on one. the sfc didn’t find any issue twice.

The wevtutil displayed the same that I showed before. And the faulthandler displayed this:

Thank you. It looks like the error is originated from the Qt toolkit that Anki uses for any GUI-related stuff.

File C:\pyenv\lib\site-packages\aqt\__init__.py, line 247 in __init__

Line 247: QApplication.__init__(self, argv)

Unfortunately, it’s still not clear where in Qt and why it happens and I don’t know how to get a better stack trace.


Maybe try to reproduce the same behaviour with a simple python script from this gist - test.py

Save it as test.py, copy to Desktop and run using the following command.

\pyenv\scripts\python -X faulthandler %HOMEPATH%\Desktop\test.py

If everything goes smoothly, a new window should appear, but I doubt it’ll happen and instead you’ll get the same error message: “Windows fatal exception: access violation”.

2020-12-26_005556


I’ve found something similar related to Qt but it doesn’t seem to be related to our case.

After a bit more googling, maybe a few more suggestions.

  • Windows Memory Diagnostic tool
  • Process Monitor

Start procmon.exe and set it to filter out all events except for your dvr.exe (that way you will not get swamped by thousands of events from other programs like explorer.exe etc.)
Then start dvr.exe and when it crashes, look in procmon.exe’s window to see what the last events were before dying…

image

i.e. run procmon.exe, create a new filter for anki.exe and click Add, and start Anki normally, i.e. with anki.exe.

I’m out of ideas.

1 Like

Hi @kelciour,
I tried the test.py and it WORKED perfectly.
I tried Anki 2.1.15, same thing happened (anki.exe self-closes).
I tried Anki 2.0.52, and it “works”: Let me explain,
I see the Profiles window
image

But when I pick my profile y see for half a second Anki, and then it self-closes and goes back to the above screen.

Now I have 2 doubts:

  1. What is changed from from anki 2.0.52 to 2.1.15 (and looking at the changelog I know that plenty of things… )
  2. I wonder if the error that is happening in the 2.0.52 is what is causing newer versions of Anki to fail, or maybe it is something totally unrelated… (I imagine it could be the same if for example whatever is loaded after picking a profile , in newer versions is loaded before picking a profile, etc… )

Did you try ‘angle’, ‘software’ and ‘auto’ for the video drivers? Maybe one will work where the others don’t.

If test.py works, that makes me think the problem may be related to QtWebEngine. If you make another test that uses WebEngine, does that work or crash?

2.0.52 likely can’t open your profile because it’s been opened with a more recent Anki version.

1 Like

If test.html and simple.py from ZetCode is working for you, maybe try to open qutebrowser since it’s based on Python and PyQt5 too.

https://qutebrowser.org

Regarding Anki 2.0, maybe try with -b option.

"C:\Program Files (x86)\Anki\anki.exe" -b "C:\AnkiDataFolder"

https://apps.ankiweb.net/docs/manual20.html#startup-options

Maybe give Process Monitor a try with the latest Anki version and 2.1.15. Maybe it’ll give some additional information.

It might not be related, but maybe double-check that C:\ has some free space, maybe 1GB, and maybe try with or without pagefile.sys.

Maybe temporarily turn off real-time protection / Windows Defender.

Additionally, maybe delete your installed graphics card driver, restart Windows and open Anki.

Hi @dae , sorry what do you mean by this? I am not sure what are you referring to.

As for the QtWebEngine test, I get this error, but seems not related, probably it is just me doing something wrong
image

It is failing in QApplication , I have the import, but I am not sure if I have to install something beforehand?

Hi @kelciour,

Seems that we are getting closer to the root cause: Qutebrowser does not work and it has the exact same error.

Faulting application name: qutebrowser.exe, version: 1.14.1.0, time stamp: 0x5f2e9a84
Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000
Exception code: 0xc0000005
Fault offset: 0x0000000000000000
Faulting process id: 0x2d0
Faulting application start time: 0x01d6db824f7c763c
Faulting application path: C:\Users\unarc\AppData\Local\qutebrowser\qutebrowser.exe
Faulting module path: unknown
Report Id: c89a23b9-46af-4956-90ab-0ab6be7c13d3
Faulting package full name:
Faulting package-relative application ID:

Anki 2.0 worked using the -b command, which proves that the issue happens from the versions 2.1.

Used the Process Monitor, but I am not sure if there is any useful information here:


(just showing the last lines here as there are thousands… I tried to export for you, but it is 100Mb).
I just see many “NAME NOT FOUND” and “PATH NOT FOUND”, but I am not sure if those are normal or not.

I disabled Microsoft Defender, but it didn’t help, same error.

About the drive space, I have more than enough.

2 Likes

About ‘angle’, ‘software’ and ‘auto’, it’s about

echo angle > %APPDATA%\Anki2\gldriver

https://changes.ankiweb.net/#/known-issues?id=hardware-acceleration-and-startup-issues-on-windowslinux

If ‘angle’, ‘software’ and ‘auto’ makes no difference, could you run simple.py again but with Process Monitor?

  1. In Process Monitor create a new filter with Process Name is python.exe

  2. Run simple.py the same way as before

    \pyenv\scripts\python -X faulthandler D:\simple.py

  3. Take two screenshots. The last lines (as before) and maybe one screen before, i.e. scroll up a bit.

The output probably will be the same, i.e. the last screen will contain a lot of igdgmm32.dll “NOT FOUND” errors and igdgmm32.dll seems to be related to Intel HD Graphics Driver. It looks like anki.exe is trying to find igdgmm32.dll using all known dll paths. A few “NOT FOUND” errors should be fine if there’s SUCCESS but I don’t see it here.

If this is the case, I’d suggest to uninstall Intel HD Graphics Driver using “Add or remove programs”, restart PC and try to run the same simple.py script again (on anki.exe) with Process Monitor. If it still won’t run, maybe dll name (that was not found) will be different this time.

And maybe re-install DirectX 11 and open dxdiag just to check that no problems were found.

About qutebrowser, maybe try each line one by one by opening cmd.exe in the folder with qutebrowser.exe.

https://lifehacker.com/quickly-open-a-command-prompt-from-the-windows-explorer-5989434

qutebrowser -s qt.force_software_rendering chromium chrome://gpu

qutebrowser -s qt.force_software_rendering qt-quick chrome://gpu

qutebrowser -s qt.force_software_rendering software-opengl chrome://gpu

1 Like

@kelciour !! You nailed it!!

echo angle > %APPDATA%\Anki2\gldriver

did the trick!! I tried auto and software and they don’t work , but angle does!!

You told me to try that in your first message and so I did, but then it didn’t work… I guess we have done something along the way that affected… (maybe the windows updates? or the python installation? … ) Who knows, but I am happy now!

Thank you so so much for the time and effort you invested in it!!! I can continue using Anki :smiling_face_with_three_hearts:

2 Likes

I reverted everything I did one by one because I was curious to know what did the trick… And finally I realized that it was nothing else but this command…
The first time you posted this, I opened the link bellow and then I copy-pasted the command on the link without realizing that in your post it was “angle” and in the website it was “auto” … I thought you were just quoting what was on the page… So basically I did the test with auto and didn’t work… and then discarded it… And it wasn’t till the end that I tried angle… shut me… it could have been solved since the beginning… :roll_eyes:

Well, for anyone else with the problem, here is the fix:

**

echo angle > %APPDATA%\Anki2\gldriver

**

3 Likes

Hello guys.

I tried all the steps explained by the colleagues, but I had not succeeded until now.

The only thing that worked was:

  1. find this folder on your system (Anki2)
    image

  2. Change the folder name to any other
    image

  3. Run ANKI as an administrator (NOTE THAT HE IS IN ANOTHER FOLDER IN THE SYSTEM)

  4. It worked!

It worked to me
Thank you

Updating anki broke my hoochie family add-ons, so I decided to downgrade to anki 2.1.26

The problem was when I installed the 2.1.26 version, the update dialog box shows up at the same time as the syncing dialog box, and the program freezes. I fixed it by disabling the internet connection and launching Anki, then it let me in. I then installed this add-on to disable the update box

Hello everyone,

My problem is the same,
it has driven me crazy last night, and in the morning I find out the defect.
I don’t know how it works. Anyone can explain!!! Maybe because of the region. :smiley:
just changing in “Decimal symbol” commas instead of periods or vice versa.
Hoping it can help. :smile:

Well done on figuring out a way to reproduce this! If I set the decimal symbol to , on my machine, 2.1.49 fails to start. It’s likely either a bug in Qt 5.14, or in the packaging tool 2.1.49 used. Neither the qt5 nor qt6 2.1.50 seems to suffer from this problem. I’ve added a mention of this to Startup Issues - Anki Manual

1 Like

:smile: yeah, I see!