Title: IDLE crashes with Tk-related error on macOS with ActiveTcl 8.6
Type: Stage:
Components: IDLE, macOS, Tkinter Versions: Python 3.8
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: ned.deily, ronaldoussoren, serhiy.storchaka, taleinat, terry.reedy, vtudorache, wordtech
Priority: normal Keywords:

Created on 2018-08-01 20:49 by taleinat, last changed 2018-08-05 07:04 by taleinat.

Messages (8)
msg322888 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-08-01 20:49
On macOS 10.13.5 (the latest available) with ActiveTcl 8.6.7 (the latest available), I'm building Python from latest master (to be 3.8.0).  I'm consistently having IDLE crash almost immediately, just by opening any file for editing.  The crash results in the following error:

$ root/bin/python3 -m idlelib
objc[50759]: Invalid or prematurely-freed autorelease pool 0x7fb74091f050.
[1]    50759 abort      root/bin/python3 -m idlelib

In issue34120, @vtudorache reported a similar issue (also on macOS).

With Python 3.7.0 from, everything works fine.

Strangely, replacing ActiveTcl with version resolves this issue.

I'm not sure whether this is specific to IDLE; I'll try to provide a minimal way to reproduce.
msg322898 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-08-01 23:49
I presume then that you tested PR8603 without opening an editor (which is certainly possible).

10.13.6 was released in the last month.

PCBuild/build.bat -e downloads missing external dependency source code into externals/ and then compiles it into compatible .dlls.  This includes doing updates as appropriate. I presume that the source and compilation flags are the same as used to make a release. AFAIK, Zach Ware is mainly responsible for the current easy-to-use, easy-to-get-right status.

For a stripped-down reporducer, you might start with the files I attached to #34047.
msg322927 - (view) Author: Vlad Tudorache (vtudorache) * Date: 2018-08-02 08:29
I confirm the crashes. I've tried with personal builds of python 3.5, 3.6, 3.7, with ActiveTcl and personal builds of Tcl 8.6.x, the problem does not appear with 8.5.18, but shows itself with 8.5.19 (strange, API changes?). I'll try to investigate.
msg322930 - (view) Author: Vlad Tudorache (vtudorache) * Date: 2018-08-02 08:57
The problem shows itself on macOS High Sierra in some Tk Demos, independently of Python's IDLE. So there is something completely different, to report to the Tcl/Tk community. Strangely, I didn't notice the issues on Sierra, but I have no Sierra Mac right now to check it again. Even in Tk 8.5.18 (ActiveState or self-compiled) there are issues (notably the cascade menus demo, the button menus demo, others to) in rendering some UI elements. Sometimes bad indexes are reported (sort of [lindex {A LIST} index $N] gives $N not found even when in range)...
msg322976 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-08-02 16:15
Kevin, more tk mac issues.
msg323008 - (view) Author: Kevin Walzer (wordtech) * Date: 2018-08-03 02:00
The crash reported by the OP did show up at times in recent releases of Tk 8.6.x, but a lot of work went into refactoring memory management in 8.6.8 and those problems do not seem present in the current release (8.6.7 is a year old). I'd try updating to 8.6.8 and seeing if that fixes things.
msg323040 - (view) Author: Vlad Tudorache (vtudorache) * Date: 2018-08-03 08:27
I was telling only that I've seen myself the issues with some Tcl/Tk versions. As I often build Tcl/Tk on macOS, I can confirm that on 8.6.8 I didn't see issues (those were effectively present in (ActiveState or not) Tcl 8.5.18, 8.5.19, 8.6.6, 8.6.7. The only issue I had was an @autoreleasepool after several open/close of the Preferences dialog in IDLE (see the 34120 issue), related probably to a partial release of resources.
msg323134 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2018-08-05 07:04
I can confirm the these issues do *not* occur on my macOS setup when using tcl/tk 8.6.8 built from source.
Date User Action Args
2018-08-05 07:04:48taleinatsetmessages: + msg323134
2018-08-03 08:27:26vtudorachesetmessages: + msg323040
2018-08-03 02:00:18wordtechsetmessages: + msg323008
2018-08-02 16:15:46terry.reedysetnosy: + wordtech
messages: + msg322976
2018-08-02 08:57:41vtudorachesetmessages: + msg322930
2018-08-02 08:29:31vtudorachesetmessages: + msg322927
2018-08-01 23:49:55terry.reedysetnosy: + ned.deily, ronaldoussoren, - gpolo
messages: + msg322898

assignee: terry.reedy ->
components: + macOS
2018-08-01 20:49:42taleinatcreate