Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tkinter app on macOS 10.14.6 causes WindowServer event port death #4334

Open
peterruhl opened this issue Jul 25, 2019 · 13 comments

Comments

@peterruhl
Copy link

commented Jul 25, 2019

OS: macOS 10.14.6
Python: 3.6.6, 3.6.8, 3.7.4
Tkinter: 8.6 (bundled with python)
Pyinstaller: 3.5

On macOS 10.14.6, when trying to run any python application using Tkinter that has been frozen, my WindowServer crashes, and brings me back to the macOS login screen.
No issues while following the same procedure on macOS 10.14.5.

The minimum code to reproduce (found below) runs fine on its own on macOS 10.14.6

I have tried both methods found here: #3753 to ensure that TKinter is included.

I tried a number of different commands to freeze my application, all producing the same crash. Most recent command was pyinstaller --windowed myapp.py as suggested in issue #3753

Output:

2019-07-25 09:30:21.328 Main[3268:17227] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-07-25 09:30:21.328 Main[3268:17227] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-07-25 09:30:21.328 Main[3268:17227] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-07-25 09:30:21.328 Main[3268:17227] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-07-25 09:30:21.329 Main[3268:17227] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-07-25 09:30:21.329 Main[3268:17227] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-07-25 09:30:21.329 Main[3268:17227] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-07-25 09:30:21.329 Main[3268:17227] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-07-25 09:30:21.329 Main[3268:17227] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-07-25 09:30:21.329 Main[3268:17227] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-07-25 09:30:21.329 Main[3268:17227] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-07-25 09:30:21.329 Main[3268:17227] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-07-25 09:30:21.329 Main[3268:17227] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-07-25 09:30:21.329 Main[3268:17227] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-07-25 09:30:21.329 Main[3268:17227] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-07-25 09:30:21.329 Main[3268:17227] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-07-25 09:30:21.329 Main[3268:17227] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-07-25 09:30:21.329 Main[3268:17227] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-07-25 09:30:21.329 Main[3268:17227] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-07-25 09:30:21.329 Main[3268:17227] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-07-25 09:30:21.329 Main[3268:17227] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-07-25 09:30:21.329 Main[3268:17227] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-07-25 09:30:21.329 Main[3268:17227] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-07-25 09:30:21.329 Main[3268:17227] CGSTrackingRegionSetIsEnabled returned CG error 268435459
2019-07-25 09:30:21.342 Main[3268:17227] HIToolbox: received notification of WindowServer event port death.
2019-07-25 09:30:21.342 Main[3268:17227] port matched the WindowServer port created in BindCGSToRunLoop

Minimum code required to reproduce:


from tkinter import *
class Main:
    def __init__(self, parent):

        #Configure the main window
        self.myparent = parent
        self.myparent.wm_title("Please Don't Crash")
        self.myparent.geometry('440x300')
        
root = Tk()
myapp = Main(root)
root.mainloop()

This issue was reported on another project that uses pyinstaller as well. nh-server/fusee-interfacee-tk#1

@pklein15

This comment has been minimized.

Copy link

commented Aug 5, 2019

MacOS 10.14.6 caused my 2018 MacBook Air to restart when running Tkinter python script program. Worked fine before the update, then went to hell.

@tazzben

This comment has been minimized.

Copy link

commented Aug 5, 2019

I'm wondering if those reporting this issue have (or have had) Anaconda installed. Note: I'm not saying you are executing the program with Anaconda, simply having it installed causes the problem. See:

ContinuumIO/anaconda-issues#11165

@ihaveamac

This comment has been minimized.

Copy link

commented Aug 5, 2019

I've never used anaconda, and still have this issue. In addition, I've noticed that the crash doesn't occur in a virtual machine (VMware), or in safe mode.

Also, I couldn't seem to reproduce the crash on the latest 10.15 Beta 5 (19A526h). It was happening before. Both times were a clean system (just installed, doesn't have Python 3.x otherwise)

@pklein15

This comment has been minimized.

Copy link

commented Aug 5, 2019

I do have anaconda installed, and it crashed both running it using an anaconda notebook and then from just a straight python (3.7.4 I think) prompt. I purchased the Mac Air on Friday and it worked fine. The automatic update 10.14.6 installed Friday night. Failed Saturday of course.

@Achim63

This comment has been minimized.

Copy link

commented Aug 7, 2019

Same issue with an app build with py2app. I get kicked to the login screen and it worked fine in 10.14.5. I tried to rebuild it with Python 3.6.8 to no avail (now I'm back to 3.7.4).

@manish9909

This comment has been minimized.

Copy link

commented Aug 7, 2019

I have the same problem, have updated my mac and tkinter crashes my mac and logs me out.

@shuntera

This comment has been minimized.

Copy link

commented Aug 7, 2019

Same issue for me too on Mojave 10.14.6 and Python 3.7.3

@peterruhl

This comment has been minimized.

Copy link
Author

commented Aug 7, 2019

@tazzben I've also never installed Anaconda on this machine.

@bentkidder

This comment has been minimized.

Copy link

commented Aug 13, 2019

Same issue for me on Mojave 10.14.6 and Python 3.7.3 running Anaconda.

@thuwzr

This comment has been minimized.

Copy link

commented Aug 17, 2019

Same issue for me on Mojave 10.14.6 and Python 3.73 runing pyplot.show

@zacek100

This comment has been minimized.

Copy link

commented Aug 19, 2019

Same here Mojave 10.14.6 and Python 3.72 runing pyinstaller 3.4

@sharahamo

This comment has been minimized.

Copy link

commented Aug 22, 2019

Same issue here. DO we have a fix yet?

@AnthonyCheetham

This comment has been minimized.

Copy link

commented Aug 22, 2019

Not a fix, but people googling the error message might come across this and find it useful. If you don't mind changing your matplotlib backend until this is fixed you can add a line to the start of your code to change to the MacOSX backend (or Qt4Agg etc.):

import matplotlib
matplotlib.use('MacOSX')

Or you can change this permanently by adding
backend: MacOSX
to your matplotlibrc file (probably in $HOME/.matplotlib/matplotlibrc )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.