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

[Error Message] alloc:Invalid block #6718

Open
6 of 7 tasks
shtmsh opened this issue Mar 19, 2024 · 10 comments
Open
6 of 7 tasks

[Error Message] alloc:Invalid block #6718

shtmsh opened this issue Mar 19, 2024 · 10 comments
Labels
Port - TK PySimpleGUI

Comments

@shtmsh
Copy link

shtmsh commented Mar 19, 2024

Type of Issue (Enhancement, Error, Bug, Question)

Error Message


Environment

Operating System

Windows version win11

PySimpleGUI Port (tkinter, Qt, Wx, Web)

tkinter


Versions

Python version (sg.sys.version)

3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD64)]

PySimpleGUI Version (sg.__version__)

4.60.4

GUI Version (tkinter (sg.tclversion_detailed), PySide2, WxPython, Remi)

8.6.12


Your Experience In Months or Years (optional)

Years Python programming experience
Years Programming experience overall
No Have used another Python GUI Framework? (tkinter, Qt, etc) (yes/no is fine)


Troubleshooting

These items may solve your problem. Please check those you've done by changing - [ ] to - [X]

  • Searched main docs for your problem www.PySimpleGUI.org
  • Looked for Demo Programs that are similar to your goal Demos.PySimpleGUI.org
  • If not tkinter - looked for Demo Programs for specific port
  • For non tkinter - Looked at readme for your specific port if not PySimpleGUI (Qt, WX, Remi)
  • Run your program outside of your debugger (from a command line)
  • Searched through Issues (open and closed) to see if already reported Issues.PySimpleGUI.org
  • Tried using the PySimpleGUI.py file on GitHub. Your problem may have already been fixed but not released

Detailed Description

alloc: invalid block: 00000293E7AC94A0: c0 e7

Code To Duplicate

# Paste your code here

Screenshot, Sketch, or Drawing

@jason990420
Copy link
Collaborator

No information provided how you got the error message, maybe detail and full error message also required.

@PySimpleGUI
Copy link
Owner

image

Can't say I've ever seen that error message. Sounds like a memory corruption problem or maybe a tkinter file dialog problem. As Jason said, much more info needed.

@shtmsh
Copy link
Author

shtmsh commented Mar 20, 2024

I was running my program when it suddenly exited without warning and without any error. alloc: invalid block: 00000293E7AC94A0: displayed on PyCharm c0 e7, that's all I can give back, I searched the Internet for information about it and found a problem with using tkinter and matplotlib in python, and his error was the same as mine. Since no error was reported, I could not accurately locate the location of the error, and this is an occasional occurrence, I have encountered at least 10 times, but not every time

Here is some information about PyCharm that I hope will help:

PyCharm 2021.2.4 (Community Edition)
Build #PC-212.5712.39, built on December 21, 2021
Runtime version: 11.0.13+8-b1504.49 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 2016M
Cores: 8
Registry: documentation.show.toolbar=true, ide.images.show.chessboard=true
Non-Bundled Plugins: com.chesterccw.excelreader (2.0.8), com.jetbrains.plugins.ini4idea (212.5712.51), YAML/Ansible support (0.11.2), net.seesharpsoft.intellij.plugins.csv (2.21.0), com.andrey4623.rainbowcsv (2.0.1)

@jason990420
Copy link
Collaborator

jason990420 commented Mar 20, 2024

Maybe you can check if it will be ok, add one more statement to close the matplotlib before you close the PySimpleGUI/tkinter window.

import matplotlib.pyplot as plt

window = sg.Window("Title", layout, enable_close_attempted_event=True)

while True:

    event, values = window.read()

    if event == sg.WINDOW_CLOSE_ATTEMPTED_EVENT:
        break

plt.close()
window.close()

@PySimpleGUI
Copy link
Owner

Does this happen only when running with PyCharm?

Have you added a try statement around your code to see if it can catch an exception? I doubt this will help since it's a hard crash.

Can you describe the operation you were doing when it exited? Sounds like you were actively using your program. It would be helpful to know what matplotlib or tkinter code may have been running or running just prior.

@jason990420 jason990420 added the Port - TK PySimpleGUI label Mar 22, 2024
@shtmsh
Copy link
Author

shtmsh commented Apr 3, 2024

When debugging and running the packaged program, I have had a sudden crash problem. But I can clearly see the above error message when I flash back on pycharm. And yesterday I found out that I had this error when I was closing the page

@PySimpleGUI
Copy link
Owner

I would open a bug with the mathplotlib or tkinter teams (or both) and see if they can give you an update on this error. They may be able to tell you a workaround.

I think Jason's catching the close attempt was a good addition.

You'll need to provide code to the other projects, and it would be helpful to get some here as well, that narrows the problem down to as few lines of code as possible. I know these are some of the most difficult problems to debug as they're intermittent. The more you can describe exactly what you were doing, and can use the smallest amount of code to do it, the better, so take good notes each time.

If it's a very rare thing, maybe use psgtest to run the program a few 1000 times to see if you can get it to happen that way in a minute or two.

@jason990420
Copy link
Collaborator

jason990420 commented Apr 6, 2024

image

navigate from page A to page B, then navigate back to Page A again and it show me this message

It tell us the failed message from the viewpoint of a user , not from that of a programmer, so it didn't help people to provide help.
If you try to debug this issue by yourself and you know nothing about what the environment and what the script run, also no any debug information, what can you do ?

So, please tell us more or most what you can, better like we sit at front of your computer.

@PySimpleGUI
Copy link
Owner

like we sit at front of your computer.

I like that suggestion! There are times where I have needed to say this to explain the kinds of details needed to debug.

A screenshot of your entire screen when this error is present would be helpful to give better context.

I've never personally seen, that I can recall, an error like this on Windows with Python. An alloc error is difficult to create with just Python, which likely means it's down in a driver or portion of code written in C in a package you are using (not standard Python). Or it may be from PyCharm itself? I still don't understand if you only see the error when running using PyCharm.

I've been struggling with a blue screen of death (BSOD) for the first time in years, after upgrading to PyCharm 2024

@IfTrueEqualsEqualsTrue
Copy link

When debugging and running the packaged program, I have had a sudden crash problem. But I can clearly see the above error message when I flash back on pycharm. And yesterday I found out that I had this error when I was closing the page

Did you get any fix for this ? Facing the same problem rn. Thanks !

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

No branches or pull requests

4 participants