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

Debug build only: C functions that raise Python exceptions must return nullptr #2097

Open
v-ein opened this issue May 23, 2023 · 1 comment
Labels
state: pending not addressed yet type: bug bug

Comments

@v-ein
Copy link
Contributor

v-ein commented May 23, 2023

Version of Dear PyGui

Version: 1.8.0 (a debug version built myself)
Operating System: Windows 10

My Issue/Question

When I was debugging DPG (a debug build, of course), I noticed that sometimes Python hits the same debug assertion in various DPG calls. The following causes it to happen:

  • a C function in DPG calls mvThrowPythonError or PyErr_SetStringand, effectively raising a Python exception,
  • that function then returns Py_None (typically via GetPyNone()).

Upon returning from a C function, Python expects to get either an exception or a PyObject*, but not both. A function that raised an exception must return NULL.

This issue does not occur in the release version but might substantially hinder the use of the debug build if DPG throws exceptions for some reason (e.g. a missing UUID).

To Reproduce

TBD. I still need to create a minimal example.

Expected behavior

No debug assertions in such cases.

Screenshots/Video

TBD

Standalone, minimal, complete and verifiable example

TBD

@v-ein v-ein added state: pending not addressed yet type: bug bug labels May 23, 2023
@v-ein
Copy link
Contributor Author

v-ein commented May 23, 2023

I have a partial fix for this issue, but still need to create an example program that can be used as a test. When fixing the issue, I was using my current project, which can't be used as a minimal example. Will submit the fix a bit later, when I have a chance to upgrade to DPG 1.9.1.

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

1 participant