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

Adding more than certain amount of table columns causes segmentation fault #1560

Closed
retifrav opened this issue Jan 20, 2022 · 3 comments
Closed
Labels
state: pending not addressed yet type: bug bug

Comments

@retifrav
Copy link

retifrav commented Jan 20, 2022

Version of Dear PyGui

Version: 1.3.0
Operating system: Mac OS 11.6.2

My issue

If a certain amount of columns is added to a table, the application crashes with segmentation fault:

$ PYTHONFAULTHANDLER=1 python ./tbl.py
Fatal Python error: Segmentation fault

Thread 0x0000700000bc4000 (most recent call first):
<no Python frame>

Current thread 0x0000000118febe00 (most recent call first):
  File "/usr/local/lib/python3.9/site-packages/dearpygui/dearpygui.py", line 102 in start_dearpygui
  File "/Users/vasya/code/python/tap-adql-sandbox/./tbl.py", line 20 in <module>
Segmentation fault: 11

To reproduce

Steps to reproduce the behavior:

  1. Add some big amount of columns to a table
  2. Application crashes with segmentation fault
    • if it doesn't crash, increase the number of added columns

My suspicion is that the "acceptable" number of columns somehow depends on the width of the parent window. In the example below when you establish the number of columns that causes segfault in your case, try to increase window width from 1000 to 1100 - that should allow you to add some more columns before application starts to segfault again.

Expected behavior

Columns are added to the table, application doesn't crash.

Video

table-crash.mp4

Standalone, minimal, complete and verifiable example

import dearpygui.dearpygui as dpg

dpg.create_context()

with dpg.window(label="Table", width=1000, height=500):
    # 83 is okay, but 84 causes segmentation fault
    columnsCount = 84
    rowCount = 3
    with dpg.table(header_row=False):
        for i in range(columnsCount):
            dpg.add_table_column()
        for i in range(rowCount):
            with dpg.table_row():
                for j in range(columnsCount):
                    dpg.add_text(f"{i}-{j}")

dpg.create_viewport(title="Some", width=1200, height=600)
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
@hoffstadt
Copy link
Owner

Hi, the max number of columns is 64. This is the limit set by imgui! We will add it to the docs.

@retifrav
Copy link
Author

retifrav commented Jan 20, 2022

I saw that warning in the docs, but I also saw in one of the reported issues/discussions here that this limitation will go away after switching to the new table API from Dear ImGui, which I assumed already happened.

Also, I have more than 64 columns, and it (seems to) works fine.

@retifrav
Copy link
Author

retifrav commented Jan 20, 2022

...this limitation will go away after switching to the new table API from Dear ImGui, which I assumed already happened

Hmm, looks like I assumed wrong: even in Dear ImGui itself this seems to be not implemented yet: there was a comment on the matter, and then there is this pull request, which hasn't been merged yet.

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