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

Issues with Tkinter example on exit and during window resize (Win, Mac) #441

Open
cztomczak opened this issue Jul 31, 2018 · 4 comments
Open

Comments

@cztomczak
Copy link
Owner

cztomczak commented Jul 31, 2018

Started occurring in v66.0 on Windows 7 with Tk 8.5.

With Python 3.7 and Tk 8.6.8 it resizes and exits fine for me on Windows, but other users report problems with Tk 8.6 as well.

Issues also occur on Mac (Catalina 10.15, Tk 8.5). When resizing window it doesn't hang, but strange resize issues occur. On exit it crashes with this log messages:

Fatal Python error: PyEval_RestoreThread: NULL tstate
zsh: abort      python tkinter_.py

Stack trace for exit crash:

Thread 0 Crashed:: CrBrowserMain  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	0x00007fff6e68033a __pthread_kill + 10
1   libsystem_pthread.dylib       	0x00007fff6e73ce60 pthread_kill + 430
2   libsystem_c.dylib             	0x00007fff6e607808 abort + 120
3   org.python.python             	0x00007fff3f70a0ff 0x7fff3f640000 + 827647
4   org.python.python             	0x00007fff3f6e1c3a Py_FatalError + 9
5   org.python.python             	0x00007fff3f6c0746 PyEval_RestoreThread + 27
6   _tkinter.so                   	0x000000011afaec65 0x11afa9000 + 23653
7   Tcl                           	0x00007fff41ee756e TclInvokeStringCommand + 121
8   Tcl                           	0x00007fff41ee897f 0x7fff41eda000 + 59775
9   Tcl                           	0x00007fff41ee9b31 0x7fff41eda000 + 64305
10  Tcl                           	0x00007fff41eeaf14 Tcl_GlobalEval + 59
11  Tk                            	0x00007fff4205afc2 TkWmProtocolEventProc + 167
12  Tk                            	0x00007fff41fb7621 Tk_HandleEvent + 1220
13  Tk                            	0x00007fff4205ac83 TkGenWMDestroyEvent + 116
14  Tk                            	0x00007fff4205ac00 0x7fff41fa3000 + 752640
15  com.apple.AppKit              	0x00007fff31b04d51 __19-[NSWindow __close]_block_invoke + 181
16  com.apple.AppKit              	0x00007fff31b04c8f -[NSWindow __close] + 292
17  com.apple.AppKit              	0x00007fff319807a7 -[NSApplication(NSResponder) sendAction:to:from:] + 299
18  com.apple.AppKit              	0x00007fff31980642 -[NSControl sendAction:to:] + 86
19  com.apple.AppKit              	0x00007fff31980574 __26-[NSCell _sendActionFrom:]_block_invoke + 136
20  com.apple.AppKit              	0x00007fff31980476 -[NSCell _sendActionFrom:] + 171
21  com.apple.AppKit              	0x00007fff319803bd -[NSButtonCell _sendActionFrom:] + 96
22  com.apple.AppKit              	0x00007fff31ad0882 -[NSButtonCell performClick:] + 675
23  com.apple.Foundation          	0x00007fff36ba20dd __NSThreadPerformPerform + 204
24  com.apple.CoreFoundation      	0x00007fff344cdd52 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
25  com.apple.CoreFoundation      	0x00007fff344cdcf1 __CFRunLoopDoSource0 + 103
26  com.apple.CoreFoundation      	0x00007fff344cdb67 __CFRunLoopDoSources0 + 301
27  com.apple.CoreFoundation      	0x00007fff344cc83a __CFRunLoopRun + 927
28  com.apple.CoreFoundation      	0x00007fff344cbe3e CFRunLoopRunSpecific + 462
29  com.apple.HIToolbox           	0x00007fff330f8abd RunCurrentEventLoopInMode + 292
30  com.apple.HIToolbox           	0x00007fff330f87d5 ReceiveNextEventCommon + 584
31  com.apple.HIToolbox           	0x00007fff330f8579 _BlockUntilNextEventMatchingListInModeWithFilter + 64
32  com.apple.AppKit              	0x00007fff3173e039 _DPSNextEvent + 883
33  com.apple.AppKit              	0x00007fff3173c880 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1352
34  Tk                            	0x00007fff420576d3 0x7fff41fa3000 + 739027
35  org.chromium.ContentShell.framework	0x000000011200a140 base::MessagePumpNSApplication::DoRun(base::MessagePump::Delegate*) + 224 (message_pump_mac.mm:825)
36  org.chromium.ContentShell.framework	0x0000000112008e6e base::MessagePumpCFRunLoopBase::Run(base::MessagePump::Delegate*) + 110 (message_pump_mac.mm:192)
37  org.chromium.ContentShell.framework	0x0000000112028919 base::RunLoop::RunUntilIdle() + 57 (run_loop.cc:146)
38  org.chromium.ContentShell.framework	0x0000000111d1cbaf CefBrowserMessageLoop::DoMessageLoopIteration() + 31 (browser_message_loop.cc:117)
39  cefpython_py27.so             	0x000000010ffe06b4 __pyx_pw_14cefpython_py27_35MessageLoopWork(_object*, _object*) + 116
40  org.python.python             	0x00007fff3f6c5bed PyEval_EvalFrameEx + 18934
41  org.python.python             	0x00007fff3f6c0bec PyEval_EvalCodeEx + 531
42  org.python.python             	0x00007fff3f667aa8 0x7fff3f640000 + 162472
43  org.python.python             	0x00007fff3f64a143 PyObject_Call + 97
44  org.python.python             	0x00007fff3f6c6276 PyEval_EvalFrameEx + 20607
45  org.python.python             	0x00007fff3f6c0bec PyEval_EvalCodeEx + 531
46  org.python.python             	0x00007fff3f667aa8 0x7fff3f640000 + 162472
47  org.python.python             	0x00007fff3f64a143 PyObject_Call + 97
48  org.python.python             	0x00007fff3f6c6276 PyEval_EvalFrameEx + 20607
49  org.python.python             	0x00007fff3f6c0bec PyEval_EvalCodeEx + 531
50  org.python.python             	0x00007fff3f667aa8 0x7fff3f640000 + 162472
51  org.python.python             	0x00007fff3f64a143 PyObject_Call + 97
52  org.python.python             	0x00007fff3f6548f4 0x7fff3f640000 + 84212
53  org.python.python             	0x00007fff3f64a143 PyObject_Call + 97
54  org.python.python             	0x00007fff3f6c9feb PyEval_CallObjectWithKeywords + 159
55  _tkinter.so                   	0x000000011afaed0c 0x11afa9000 + 23820
56  Tcl                           	0x00007fff41ee756e TclInvokeStringCommand + 121
57  Tcl                           	0x00007fff41ee897f 0x7fff41eda000 + 59775
58  Tcl                           	0x00007fff41f28891 0x7fff41eda000 + 321681
59  Tcl                           	0x00007fff41f2c83b 0x7fff41eda000 + 337979
60  Tcl                           	0x00007fff41eea3a1 TclEvalObjEx + 118
61  Tcl                           	0x00007fff41f6b1ee 0x7fff41eda000 + 594414
62  Tcl                           	0x00007fff41f6b438 0x7fff41eda000 + 595000
63  Tcl                           	0x00007fff41f51fe4 Tcl_ServiceEvent + 139
64  Tcl                           	0x00007fff41f5228c Tcl_DoOneEvent + 319
65  _tkinter.so                   	0x000000011afacadf 0x11afa9000 + 15071
66  org.python.python             	0x00007fff3f6c5bbf PyEval_EvalFrameEx + 18888
67  org.python.python             	0x00007fff3f6c0bec PyEval_EvalCodeEx + 531
68  org.python.python             	0x00007fff3f6ca6ea 0x7fff3f640000 + 567018
69  org.python.python             	0x00007fff3f6c5b00 PyEval_EvalFrameEx + 18697
70  org.python.python             	0x00007fff3f6ca68f 0x7fff3f640000 + 566927
71  org.python.python             	0x00007fff3f6c5b00 PyEval_EvalFrameEx + 18697
72  org.python.python             	0x00007fff3f6c0bec PyEval_EvalCodeEx + 531
73  org.python.python             	0x00007fff3f6c09d3 PyEval_EvalCode + 32
74  org.python.python             	0x00007fff3f6e29b6 0x7fff3f640000 + 666038
75  org.python.python             	0x00007fff3f6e2a5d PyRun_FileExFlags + 130
76  org.python.python             	0x00007fff3f6e25e4 PyRun_SimpleFileExFlags + 718
77  org.python.python             	0x00007fff3f6f431b Py_Main + 3219
78  libdyld.dylib                 	0x00007fff6e538cc9 start + 1
@cztomczak cztomczak added this to the v66 milestone Jul 31, 2018
@cztomczak cztomczak changed the title tkinter.py example hangs on exit on Windows tkinter.py example hangs on exit with Python 2.7 on Windows Jul 31, 2018
@cztomczak cztomczak changed the title tkinter.py example hangs on exit with Python 2.7 on Windows tkinter.py example hangs on exit with Python 2.7 / Tk 8.5 on Windows Jul 31, 2018
@cztomczak cztomczak changed the title tkinter.py example hangs on exit with Python 2.7 / Tk 8.5 on Windows tkinter.py example hangs on exit and during window resize with Python 2.7 / Tk 8.5 on Windows Aug 16, 2018
@cztomczak cztomczak changed the title tkinter.py example hangs on exit and during window resize with Python 2.7 / Tk 8.5 on Windows tkinter.py example hangs on exit and during window resize with Tk 8.5 on Windows Aug 16, 2018
@cztomczak
Copy link
Owner Author

The hang when resizing window during initial loading is fixed in Tk 8.6, relevant commits in Issue #535.

@cztomczak
Copy link
Owner Author

Related issue in Panda3D project: panda3d/panda3d#586 . It states that disabling Panda3D message loop fixed the issue. So enabling CEF multi-threaded message loop may fix the issue as well.

Blocked by: #380 .

@precsim
Copy link

precsim commented Jul 13, 2020

Maybe it is particular to my Windows 10 system but I see the issue again when resizing and Tk 8.6.9:

(base) C:\temp>python tkinter_.py
[tkinter_.py] CEF Python 66.0
[tkinter_.py] Python 3.7.7 64bit
[tkinter_.py] Tk 8.6.9

DevTools listening on ws://127.0.0.1:60207/devtools/browser/cb118573-4b70-4d33-bedc-e70496db94b9
Fatal Python error: PyEval_RestoreThread: NULL tstate

Current thread 0x00002bd4 (most recent call first):
File "tkinter_.py", line 193 in message_loop_work
File "C:\Miniconda3\lib\tkinter\__init__.py", line 749 in callit
File "C:\Miniconda3\lib\tkinter\__init__.py", line 1705 in __call__
File "C:\Miniconda3\lib\tkinter\__init__.py", line 1283 in mainloop
File "tkinter_.py", line 62 in main
File "tkinter_.py", line 392 in <module>

@cztomczak cztomczak changed the title tkinter.py example hangs on exit and during window resize with Tk 8.5 on Windows Issues with tkinter.py example on exit and during window resize (Win, Mac) Jul 20, 2020
@cztomczak cztomczak changed the title Issues with tkinter.py example on exit and during window resize (Win, Mac) Issues with Tkinter example on exit and during window resize (Win, Mac) Jul 20, 2020
@cztomczak cztomczak added the mac label Jul 20, 2020
cztomczak added a commit that referenced this issue Jul 20, 2020
Still some issues on startup, see: #583
@cztomczak
Copy link
Owner Author

Mac issues on exit and with window resize seem to be fixed by commit 0da1393 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants