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

DearPyGUI creashes and exit without any error message #2405

Open
tonyzhangnxp opened this issue Oct 24, 2024 · 12 comments
Open

DearPyGUI creashes and exit without any error message #2405

tonyzhangnxp opened this issue Oct 24, 2024 · 12 comments
Labels
state: pending not addressed yet type: bug bug

Comments

@tonyzhangnxp
Copy link

  1. PLEASE CAREFULLY READ: FAQ

  2. PLEASE CAREFULLY READ: Documentation

  3. FOR FIRST-TIME USERS ISSUES, please use the Discord server.

  4. REMOVE ALL 3RD PARTY LIBRARIES.

  5. PLEASE MAKE SURE that you have: read the FAQ; explored the examples; searched among Issues; and read the link provided in (1) (2).

  6. Be mindful that messages are being sent to the e-mail box of "Watching" users. Try to proof-read your messages before sending them. Edits are not seen by those users.

  7. Delete points 1-7 and PLEASE FILL THE TEMPLATE BELOW before submitting your issue or we will immediately close it.

Thank you!


Version of Dear PyGui

Version: 2.0
Operating System: Windows 10

My Issue/Question

In version 1.11.1, it can still work for a while. After upgrading to version 2.0, dearpygui crashes immediately after UI being displayed without any error prompts.

I was trying to debug on VS, when the UI displayed and when I step over the "dpg.render_dearpygui_frame()" again, then it crashes without any information.

Is there any way to capture and analyze error information?
Since there is a relatively large amount of code, it is not very suitable for uploading.

@tonyzhangnxp tonyzhangnxp added state: pending not addressed yet type: bug bug labels Oct 24, 2024
@v-ein
Copy link
Contributor

v-ein commented Oct 24, 2024

Does a minimal example also crash on 2.0 on your system? Like this...

import dearpygui.dearpygui as dpg

dpg.create_context()
dpg.create_viewport(title='Test', width=600, height=300)

with dpg.window(label="Example Window"):
    dpg.add_text("Hello, world")

dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()

@tonyzhangnxp
Copy link
Author

It's working fine.

@tonyzhangnxp
Copy link
Author

tonyzhangnxp commented Oct 24, 2024

And with the same codes, v1.11 could stay longer, and will crash without information as well.
Is there any way to capture this issue?

crashes

@v-ein
Copy link
Contributor

v-ein commented Oct 24, 2024

You mentioned VS - does this mean Visual Studio or is it Visual Studio Code? If you have Visual Studio installed, Windows typically offers to debug the app in VS when it crashes. If you can do that, can you post a screenshot of the call stack? It might give some clues.

Since the PyPI version was built without debug info, there's little you can pull out of it. If you really want to pursue this, you can try to build DPG yourself - and use either Debug or RelWithDebInfo configuration (I'd recommend to start with RelWithDebInfo because it has optimizations just like Release - the app behavior on Debug might be different).

@v-ein
Copy link
Contributor

v-ein commented Oct 24, 2024

My typical approach to debugging such issues is to (1) recreate the issue with a RelWithDebInfo build, and (2) on crash, open Visual Studio and.. well, debug it 🤣. AFAIK, DPG doesn't have any logging or something that would make it easier.

@v-ein
Copy link
Contributor

v-ein commented Oct 24, 2024

Also: if you start your app on 1.11 and don't touch the UI, does it eventually crash as well?

@tonyzhangnxp
Copy link
Author

Also: if you start your app on 1.11 and don't touch the UI, does it eventually crash as well?

Yes, but not so quick.
I'm using VS code debugging the scripts. I can't see the stack info when crash happened.
I will build the DPG locally and try the RelWithDebInfo .
Thank you for your reply.

@tonyzhangnxp
Copy link
Author

I have a question, DPG build into so, how to debug with so library?

@v-ein
Copy link
Contributor

v-ein commented Oct 24, 2024

Well, a .so is for Linux, but your description and GIF indicate Windows. On Windows, DPG builds into a .pyd file, which is essentially a DLL, just renamed to .pyd (a .so is also like a DLL but for Linux).

I'm not sure that VS Code can debug DLLs (maybe it can, depends on extensions; I've never used it this way). Visual Studio (not Code), if you have it, might be a better choice.

@tonyzhangnxp
Copy link
Author

Hi
I had Visual Studio 2022. Open the dpg folder, but which of the items should be selected ?
image

@v-ein
Copy link
Contributor

v-ein commented Oct 25, 2024

When your program crashes on this system, does it show a message box suggesting to debug the program? If not, then probably Visual Studio is not selected as the default postmortem debugger. See this topic to enable such debugging.

https://stackoverflow.com/questions/197171/how-to-set-visual-studio-as-the-default-post-mortem-debugger

In theory, after you tick the "Native" checkbox, it should start offering you to debug the app. The StackOverflow topic is pretty old, but seems to still apply to later versions of VS (not sure about 2022, I have an older version).

@v-ein
Copy link
Contributor

v-ein commented Oct 25, 2024

Also see the comment in there about WER in Windows 10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: pending not addressed yet type: bug bug
Projects
None yet
Development

No branches or pull requests

2 participants