AllenDang / giu

Cross platform rapid GUI framework for golang based on Dear ImGui.
MIT License
2.16k stars 128 forks source link

[bug] Selecting the ListBox or List tab in the widgets example crashes the application on macOS #724

Closed rokf closed 4 months ago

rokf commented 8 months ago

What happend?

Clicking on either the ListBox or List tab crashes the widgets application on macOS Sonoma 14.0.

The message in the console is File: /Users/runner/work/cimgui-go/cimgui-go/cimgui/imgui/imgui.cpp, Line: 2955 in both cases.

CleanShot 2023-10-24 at 19 13 16

Code example

I've noticed this on the official widgets example from examples/widgets.

To Reproduce

cd examples
go build widgets.go
./widgets

Click on either the ListBox or List tab on the bottom of the window.

Version

master

OS

macOS Sonoma 14.0

zachwelch commented 8 months ago

Reproduced today on Ubuntu 22.04:

goroutine 6 [syscall, locked to thread]:
runtime.cgocall(0x561230, 0xc0003b6f58)
        /usr/lib/go-1.21/src/runtime/cgocall.go:157 +0x4b fp=0xc0003b6f30 sp=0xc0003b6ef8 pc=0x40b18b
github.com/AllenDang/cimgui-go._Cfunc_ImGuiListClipper_Step(0xc0002f7a40)
        _cgo_gotypes.go:7253 +0x45 fp=0xc0003b6f58 sp=0xc0003b6f30 pc=0x4c7725
github.com/AllenDang/cimgui-go.(*ListClipper).Step.func2(0xc0003948a8?)
        .../go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20231009021832-f9856eb4a9a7/cimgui_funcs.go:2058 +0x34 fp=0xc0003b6f90 sp=0xc0003b6f58 pc=0x4ce114
github.com/AllenDang/cimgui-go.(*ListClipper).Step(0xc0002a2000?)
        .../go/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20231009021832-f9856eb4a9a7/cimgui_funcs.go:2058 +0x91 fp=0xc0003b7010 sp=0xc0003b6f90 pc=0x4ce091
github.com/AllenDang/giu.(*ListBoxWidget).Build.func1()
        .../src/giu/ExtraWidgets.go:319 +0xa5 fp=0xc0003b7128 sp=0xc0003b7010 pc=0x54c6c5
github.com/AllenDang/giu.(*CustomWidget).Build(0x0?)
        .../src/giu/ExtraWidgets.go:136 +0x17 fp=0xc0003b7138 sp=0xc0003b7128 pc=0x54c317
github.com/AllenDang/giu.Layout.Build(...)
        .../src/giu/Layout.go:28
github.com/AllenDang/giu.(*Layout).Build(0xc0002e9ba4?)
        <autogenerated>:1 +0x59 fp=0xc0003b7168 sp=0xc0003b7138 pc=0x557519
github.com/AllenDang/giu.Layout.Build(...)
        .../src/giu/Layout.go:28
github.com/AllenDang/giu.(*ChildWidget).Build(0xc000344240)
        .../src/giu/Widgets.go:76 +0x93 fp=0xc0003b71b0 sp=0xc0003b7168 pc=0x554df3
github.com/AllenDang/giu.(*ListBoxWidget).Build(0xc0002ea7e0)
        .../src/giu/ExtraWidgets.go:358 +0x28b fp=0xc0003b7238 sp=0xc0003b71b0 pc=0x54c5eb
....
gucio321 commented 8 months ago

I see, unfortunately can't focus on it right now because I'm quite busy with https://github.com/AllenDang/cimgui-go/pull/229 (causes many). Will look into this ass soon as I get some time ;-)

fnicastri commented 5 months ago

@gucio321 issue still there, any suggestion? I'm trying to use master to remove the 64 column limit on tablewidget

gucio321 commented 5 months ago

My suggestion is to fix the bug 😁 - contributions are welcome! Unfortunately i didn't finish working on the problem mentioned in a comment above. I was quite busy last few months tbh and had no time for my open source work.

fnicastri commented 5 months ago

My suggestion is to fix the bug 😁 - contributions are welcome!

I would try but... I would need to understand why it is not compiling on my machine, a AppleSilicon Mac running MacOs, and then dive in to the code. I'm sorry but right now I have no time to solve both.

Thank you

gucio321 commented 4 months ago

After my research on the latest commit (probably after #733 that updated cimgui-go) this doesn't happen anymore. image

LMK if someone still has this bug.

rokf commented 4 months ago

Have just tried repeating the steps on the latest master and can't reproduce it - it works now, at least on macOS Sonoma 14.3.1 (go version go1.21.3 darwin/arm64).

Thank you!