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 Demo crashes #2387

Open
helloginov opened this issue Sep 16, 2024 · 1 comment
Open

DearPyGui Demo crashes #2387

helloginov opened this issue Sep 16, 2024 · 1 comment
Labels
state: pending not addressed yet type: bug bug

Comments

@helloginov
Copy link

Version: 1.11.1
Operating System: Windows 11

As a beginner in DearPyGui, I was trying demo "application" promoted by official docs (section 1.3 Demo). Carefully studying and clicking all that is possible, I found the way to crash the program. I use VS Code and Anaconda

Steps to reproduce the behavior:

  1. Go to DearPyGui official tutorial
  2. Copy and run the code in section 1.3 Demo:
    import dearpygui.dearpygui as dpg
    import dearpygui.demo as demo

dpg.create_context()
dpg.create_viewport(title='Custom Title', width=600, height=600)

demo.show_demo()

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

  1. The application must be successfully opened. Click menu "Plots" --> tab "Custom" --> "Custom Series". Find the single legend at the shown plot and right click in.

  2. See error:
    The Kernel crashed while executing code in the current cell or a previous cell.
    Please review the code in the cell(s) to identify a possible cause of the failure.
    Click here for more info.
    View Jupyter log for further details.

Expected behavior: everything except crashing the program

@helloginov helloginov added state: pending not addressed yet type: bug bug labels Sep 16, 2024
@v-ein
Copy link
Contributor

v-ein commented Sep 16, 2024

Good catch!

The issue is caused by the ambiguous use of children items by different series:

  • Some (probably all) series put all their children into the legend popup menu
  • Custom series use slot 1 items to create a tooltip, slot 2 items to render its contents, and still use children from all slots to populate the legend popup.

There are multiple problems here:

  1. Slot 1 items are used both for the popup and for the tooltip - it should probably use them for tooltip only if tooltip=True is specified.
  2. Slot 2 items must not be rendered within the popup because they constitute the actual series data and not the popup menu.
  3. The crash occurs because custom_series attempts to render slot 2 items in the popup with the default drawlist, which is nullptr; however, the drawing primitives absolutely require a valid drawlist pointer. With drawlist == nullptr, they dereference a null pointer. This also applies to other series, all of which attempt to render slot 2 items in the popup window too; however, the drawing primitives probably can't be added to other series due to the "acceptable parents" restriction.

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