Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tkinter crashes computer after MacOS 10.14.6 update

After updating my 2019 Macbook Pro yesterday to MacOS Mojave 10.14.6, a tkinter application that I have packaged with pyinstaller now crashes my computer. The screen turns black for a second, and then restarts to the login screen. When I run the program through the command line (unpackaged), it runs just fine.

The error code that appears several times in terminal is: CGSTrackingRegionSetIsEnabled returned CG error 268435459.

The research I've done has led me to these links:

  1. This unanswered StackOverflow question
  2. This semi-related SuperUser question
  3. This question on the Japanese Q&A site teratail

The unanswered StackOverflow question is slightly different than my own problem, as it seems that that user cannot create a Tk() window at all, whereas I can create a Tk() window (including the Python IDLE), but it breaks when I package it with pyinstaller.

The SuperUser question is unanswered, but as one of the answers suggest I have uninstalled and reinstalled pyinstaller to no avail.

The question on teratail was answered, and says that the problem was fixed by uninstalling "Anaconda", but I don't know what Anaconda is or how to uninstall it.

I suspect that this is a problem with the MacOS update, and that there is nothing I can do to fix it and I'll have to wait for a patch.

Why is this happening? How can I fix it?

like image 666
FIGBERT Avatar asked Aug 09 '19 19:08

FIGBERT


3 Answers

This problem has troubled me for a long time. My macOS version is 10.14.6 (Mojave). Running tkinter will crash the system, but I don’t want to update macOS version to 10.15 (Catalina) for this problem.

I got a solution by updating the python version.

My own test results, python versions 3.8.2 and 3.8.3 can fix the problem, but python versions 3.8.1, 3.7.x, 3.6.x will cause the crash.

like image 115
Kangkai Avatar answered Nov 11 '22 13:11

Kangkai


I can confirm that this happens with Python 3.7.x. Moving to 3.8.3 fixes the problem.

like image 2
Petio Petrov Avatar answered Nov 11 '22 14:11

Petio Petrov


Workaround: boot in Safe Mode.. (Other apps are experiencing this.)

The macOS Window Server is crashing.. The Console.app contains the crash report in the "System Reports" node.

Process: WindowServer Thread 0 (main thread) crashes in CGXBeginSurfaceLayerUpdate

like image 1
Brian Avatar answered Nov 11 '22 14:11

Brian