Open 3526e307-f412-4420-93cf-8a03cc5b3850 opened 9 years ago
After running the Tkinter file dialog ( tkinter.filedialog.askopenfilename() ), and closing the tkinter window the following error message is displayed: alloc: invalid block: 0xb035e0: b0 0 To reproduce see the attached python script "tktest". This does not stop the program as far as i can see. Also happens for the directory selector. Platform is linux.
Unfortunately I can't reproduce this bug (Python 3.4.0, Linux). When close the main window the output is:
Traceback (most recent call last):
File "tktest.py", line 6, in <module>
filename = tkinter.filedialog.askopenfilename()
File "/usr/lib/python3.4/tkinter/filedialog.py", line 375, in askopenfilename
return Open(**options).show()
File "/usr/lib/python3.4/tkinter/commondialog.py", line 48, in show
s = w.tk.call(self.command, *w._options(self.options))
_tkinter.TclError: can't invoke "grab" command: application has been destroyed
Your output is different because you did not close the file dialog by selecting something and the pressing OK, or pressing cancel before destroying the main window. This is also the case here:
Traceback (most recent call last):
File "tktest.py", line 6, in <module>
filename = tkinter.filedialog.askopenfilename()
File "/usr/lib/python3.4/tkinter/filedialog.py", line 375, in askopenfilename
return Open(**options).show()
File "/usr/lib/python3.4/tkinter/commondialog.py", line 48, in show
s = w.tk.call(self.command, *w._options(self.options))
_tkinter.TclError: can't invoke "grab" command: application has been destroyed
alloc: invalid block: 0x1d2cda0: a0 1
zsh: abort python tktest.py
However, only the last two lines are relevant here, which you could not reproduce.
When first close the file dialog (by pressing either Open, or Cancel, or close window button, or Alt-F4 keystroke), I don't see any output at all.
What Tk version (tkinter.TkVersion) is used? What Linux distribution name and version are?
>print(TkVersion) 8.6 Tk version in package manager: python-pmw 2.0.0-2 Distribution: arch linux, kernel 3.17.2-1-ARCH
Tomas Nordin reported on bpo-24524 (will close as dup) that a similar script crashes python 2.7.9 on Linux debian.
On Windows 7, no problem on either 2.7.10 or 3.5.0b2 (running from Command Prompt so would see message is there were one).
This crashes reliably on Win10 with the same error message. Place cursor after the 2 in the top spin box. Type 0.
I have the following files in Anaconda3/tcl: tcl86t.lib, tcl86tg.lib, tclstub86.lib, tk86t.lib, tk86tg.lib, tkstub86.lib.
Python 3.6.0 |Anaconda 4.3.0 (64-bit)| (default, Dec 23 2016, 11:57:41) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.
Thanks Todd. I ran crash.py on Win10 64 bit, stock PSF 3.6.0 (no anaconda). Put cursor after 2 and hit '0'. Same error, different numbers. alloc: invalid block: 000002C8928640D0: 40 93 Followed by Windows' "Python has stopped working" box.
Cursor after the '6' in second spinbox, hit 0, nothing happens. I could not get rid of 6 to type in something new. Not sure if this is normal or something about particular code.
Cursor before the '2': '0's can be inserted, nothing else. After multiple insert and delete and arrow presses, got error when closing.
I think bpo-27405 could help to make a pure Tcl reproducer. If the same error happen with Tcl version, this is not Python bug.
> cursor after the '6' follows by '0'
The max is 21. See 'to' parameter. I don't know if my code is correct, but it seems to work more or less. Obviously the crash is an issue with tk or Python.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields: ```python assignee = None closed_at = None created_at =
labels = ['expert-tkinter', 'OS-windows', 'type-crash']
title = 'tkinter: "alloc: invalid block:" after askopenfilename'
updated_at =
user = 'https://bugs.python.org/lccat'
```
bugs.python.org fields:
```python
activity =
actor = 'mkiever'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Tkinter', 'Windows']
creation =
creator = 'lccat'
dependencies = []
files = ['37142', '46683']
hgrepos = []
issue_num = 22810
keywords = []
message_count = 11.0
messages = ['230768', '230771', '230791', '230795', '230798', '246198', '246223', '288780', '288824', '288827', '288830']
nosy_count = 10.0
nosy_names = ['terry.reedy', 'paul.moore', 'mkiever', 'tim.golden', 'zach.ware', 'serhiy.storchaka', 'steve.dower', 'lccat', 'tomnor', 'Todd Goldfinger']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'crash'
url = 'https://bugs.python.org/issue22810'
versions = ['Python 3.6']
```