AllenDang / giu

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

[bug] Segfaults in widgets.go example #716

Closed damntourists closed 8 months ago

damntourists commented 9 months ago

What happend?

Hi there, I'm trying to run the example/widgets.go example file and it works fine initially, however whenever I resize the window it crashes. Another issue I just encountered was a segfault when clicking the ListBox and List tab. Below you'll find an example where it crashed when switching to one of those tabs.

Code example

log ``` GOROOT=/home/brett/.goenv/versions/1.21.2 #gosetup GOPATH=/home/brett/go/1.21.2 #gosetup /home/brett/.goenv/versions/1.21.2/bin/go build -o /home/brett/.cache/JetBrains/GoLand2023.2/tmp/GoLand/___go_build_github_com_AllenDang_giu_examples_widgets github.com/AllenDang/giu/examples/widgets #gosetup # github.com/AllenDang/cimgui-go In file included from cimnodes_wrapper.h:6, from cimnodes_structs_accessor.cpp:6: cimgui/cimnodes.h:111:29: warning: declaration of ‘EmulateThreeButtonMouse ImNodesIO::EmulateThreeButtonMouse’ changes meaning of ‘EmulateThreeButtonMouse’ [-fpermissive] 111 | EmulateThreeButtonMouse EmulateThreeButtonMouse; | ^~~~~~~~~~~~~~~~~~~~~~~ cimgui/cimnodes.h:95:40: note: ‘EmulateThreeButtonMouse’ declared here as ‘typedef struct EmulateThreeButtonMouse EmulateThreeButtonMouse’ 95 | typedef struct EmulateThreeButtonMouse EmulateThreeButtonMouse; | ^~~~~~~~~~~~~~~~~~~~~~~ cimgui/cimnodes.h:112:33: warning: declaration of ‘LinkDetachWithModifierClick ImNodesIO::LinkDetachWithModifierClick’ changes meaning of ‘LinkDetachWithModifierClick’ [-fpermissive] 112 | LinkDetachWithModifierClick LinkDetachWithModifierClick; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ cimgui/cimnodes.h:101:44: note: ‘LinkDetachWithModifierClick’ declared here as ‘typedef struct LinkDetachWithModifierClick LinkDetachWithModifierClick’ 101 | typedef struct LinkDetachWithModifierClick LinkDetachWithModifierClick; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ cimgui/cimnodes.h:113:28: warning: declaration of ‘MultipleSelectModifier ImNodesIO::MultipleSelectModifier’ changes meaning of ‘MultipleSelectModifier’ [-fpermissive] 113 | MultipleSelectModifier MultipleSelectModifier; | ^~~~~~~~~~~~~~~~~~~~~~ cimgui/cimnodes.h:107:39: note: ‘MultipleSelectModifier’ declared here as ‘typedef struct MultipleSelectModifier MultipleSelectModifier’ 107 | typedef struct MultipleSelectModifier MultipleSelectModifier; | ^~~~~~~~~~~~~~~~~~~~~~ cc1plus: note: unrecognized command-line option ‘-Wno-changes-meaning’ may have been intended to silence earlier diagnostics # github.com/AllenDang/cimgui-go In file included from cimnodes_wrapper.h:6, from cimnodes_wrapper.cpp:4: cimgui/cimnodes.h:111:29: warning: declaration of ‘EmulateThreeButtonMouse ImNodesIO::EmulateThreeButtonMouse’ changes meaning of ‘EmulateThreeButtonMouse’ [-fpermissive] 111 | EmulateThreeButtonMouse EmulateThreeButtonMouse; | ^~~~~~~~~~~~~~~~~~~~~~~ cimgui/cimnodes.h:95:40: note: ‘EmulateThreeButtonMouse’ declared here as ‘typedef struct EmulateThreeButtonMouse EmulateThreeButtonMouse’ 95 | typedef struct EmulateThreeButtonMouse EmulateThreeButtonMouse; | ^~~~~~~~~~~~~~~~~~~~~~~ cimgui/cimnodes.h:112:33: warning: declaration of ‘LinkDetachWithModifierClick ImNodesIO::LinkDetachWithModifierClick’ changes meaning of ‘LinkDetachWithModifierClick’ [-fpermissive] 112 | LinkDetachWithModifierClick LinkDetachWithModifierClick; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ cimgui/cimnodes.h:101:44: note: ‘LinkDetachWithModifierClick’ declared here as ‘typedef struct LinkDetachWithModifierClick LinkDetachWithModifierClick’ 101 | typedef struct LinkDetachWithModifierClick LinkDetachWithModifierClick; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ cimgui/cimnodes.h:113:28: warning: declaration of ‘MultipleSelectModifier ImNodesIO::MultipleSelectModifier’ changes meaning of ‘MultipleSelectModifier’ [-fpermissive] 113 | MultipleSelectModifier MultipleSelectModifier; | ^~~~~~~~~~~~~~~~~~~~~~ cimgui/cimnodes.h:107:39: note: ‘MultipleSelectModifier’ declared here as ‘typedef struct MultipleSelectModifier MultipleSelectModifier’ 107 | typedef struct MultipleSelectModifier MultipleSelectModifier; | ^~~~~~~~~~~~~~~~~~~~~~ cc1plus: note: unrecognized command-line option ‘-Wno-changes-meaning’ may have been intended to silence earlier diagnostics /home/brett/.cache/JetBrains/GoLand2023.2/tmp/GoLand/___go_build_github_com_AllenDang_giu_examples_widgets SIGSEGV: segmentation violation PC=0x60c70e m=7 sigcode=1 signal arrived during cgo execution goroutine 13 [syscall, locked to thread]: runtime.cgocall(0x5612f0, 0xc0002070d8) /home/brett/.goenv/versions/1.21.2/src/runtime/cgocall.go:157 +0x4b fp=0xc0002070b0 sp=0xc000207078 pc=0x40b18b github.com/AllenDang/cimgui-go._Cfunc_ImGuiListClipper_Step(0xc000524f30) _cgo_gotypes.go:7253 +0x45 fp=0xc0002070d8 sp=0xc0002070b0 pc=0x4c77e5 github.com/AllenDang/cimgui-go.(*ListClipper).Step.func2(0xc0001dccd8?) /home/brett/go/1.21.2/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20231009021832-f9856eb4a9a7/cimgui_funcs.go:2058 +0x34 fp=0xc000207110 sp=0xc0002070d8 pc=0x4ce1d4 github.com/AllenDang/cimgui-go.(*ListClipper).Step(0xc000097300?) /home/brett/go/1.21.2/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20231009021832-f9856eb4a9a7/cimgui_funcs.go:2058 +0x91 fp=0xc000207190 sp=0xc000207110 pc=0x4ce151 github.com/AllenDang/giu.(*ListClipperWrapper).Build(0xc0003f9d10) /home/brett/work/__rnd__/prism/localized/giu/ListClipper.go:39 +0xd6 fp=0xc0002071f0 sp=0xc000207190 pc=0x5500b6 github.com/AllenDang/giu.Layout.Build(...) /home/brett/work/__rnd__/prism/localized/giu/Layout.go:28 github.com/AllenDang/giu.(*ChildWidget).Build(0xc0002ae800) /home/brett/work/__rnd__/prism/localized/giu/Widgets.go:76 +0x93 fp=0xc000207238 sp=0xc0002071f0 pc=0x554e73 github.com/AllenDang/giu.Layout.Build(...) /home/brett/work/__rnd__/prism/localized/giu/Layout.go:28 github.com/AllenDang/giu.(*TabItemWidget).BuildTabItem(0xc0002ae7c0) /home/brett/work/__rnd__/prism/localized/giu/Widgets.go:613 +0x79 fp=0xc000207280 sp=0xc000207238 pc=0x555e79 github.com/AllenDang/giu.(*TabBarWidget).Build(0xc000524b10) /home/brett/work/__rnd__/prism/localized/giu/Widgets.go:657 +0x5f fp=0xc0002072c0 sp=0xc000207280 pc=0x55601f github.com/AllenDang/giu.Layout.Build(...) /home/brett/work/__rnd__/prism/localized/giu/Layout.go:28 github.com/AllenDang/giu.(*WindowWidget).Layout(0xc0002ae100, {0xc0002078e8?, 0x17, 0x17}) /home/brett/work/__rnd__/prism/localized/giu/Window.go:149 +0x2c2 fp=0xc000207350 sp=0xc0002072c0 pc=0x556862 main.loop() /home/brett/work/__rnd__/prism/localized/giu/examples/widgets/widgets.go:46 +0x60eb fp=0xc000207a68 sp=0xc000207350 pc=0x55e00b github.com/AllenDang/giu.(*MasterWindow).render(0xc0001a1ce0) /home/brett/work/__rnd__/prism/localized/giu/MasterWindow.go:224 +0x169 fp=0xc000207cb0 sp=0xc000207a68 pc=0x551d09 github.com/AllenDang/giu.(*MasterWindow).render-fm() :1 +0x25 fp=0xc000207cc8 sp=0xc000207cb0 pc=0x557825 github.com/AllenDang/cimgui-go.loopCallback() /home/brett/go/1.21.2/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20231009021832-f9856eb4a9a7/backend.go:27 +0x34 fp=0xc000207ce0 sp=0xc000207cc8 pc=0x4cd094 _cgoexp_f375fbd198e5_loopCallback(0x0?) _cgo_gotypes.go:85415 +0xf fp=0xc000207cf0 sp=0xc000207ce0 pc=0x4d622f runtime.cgocallbackg1(0x4d6220, 0xc000207eb0?, 0x0) /home/brett/.goenv/versions/1.21.2/src/runtime/cgocall.go:329 +0x2c2 fp=0xc000207dc0 sp=0xc000207cf0 pc=0x40b682 runtime.cgocallbackg(0x446c9c?, 0xc000102680?, 0x300000002?) /home/brett/.goenv/versions/1.21.2/src/runtime/cgocall.go:245 +0x109 fp=0xc000207e50 sp=0xc000207dc0 pc=0x40b329 runtime.cgocallbackg(0x4d6220, 0x7f85fd9fecf7, 0x0) :1 +0x29 fp=0xc000207e78 sp=0xc000207e50 pc=0x46f0e9 runtime.cgocallback(0xc000207ed8, 0x40b1b5, 0x599ee0) /home/brett/.goenv/versions/1.21.2/src/runtime/asm_amd64.s:1035 +0xcc fp=0xc000207ea0 sp=0xc000207e78 pc=0x46ca6c runtime.systemstack_switch() /home/brett/.goenv/versions/1.21.2/src/runtime/asm_amd64.s:474 +0x8 fp=0xc000207eb0 sp=0xc000207ea0 pc=0x46ace8 runtime.cgocall(0x599ee0, 0xc000207f10) /home/brett/.goenv/versions/1.21.2/src/runtime/cgocall.go:175 +0x75 fp=0xc000207ee8 sp=0xc000207eb0 pc=0x40b1b5 github.com/AllenDang/cimgui-go._Cfunc_igRunLoop(0x2d1bb10, 0x55ed40, 0x55edb0, 0x55ee20, 0x55ef00) _cgo_gotypes.go:29432 +0x45 fp=0xc000207f10 sp=0xc000207ee8 pc=0x4ca6c5 github.com/AllenDang/cimgui-go.(*GLFWBackend).Run.func1(0x1?) /home/brett/go/1.21.2/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20231009021832-f9856eb4a9a7/glfw_backend.go:251 +0x9b fp=0xc000207f70 sp=0xc000207f10 pc=0x4d3cfb github.com/AllenDang/cimgui-go.(*GLFWBackend).Run(0x0?, 0x0?) /home/brett/go/1.21.2/pkg/mod/github.com/!allen!dang/cimgui-go@v0.0.0-20231009021832-f9856eb4a9a7/glfw_backend.go:251 +0x32 fp=0xc000207f88 sp=0xc000207f70 pc=0x4d3c32 main.main.(*MasterWindow).Run.func1() /home/brett/work/__rnd__/prism/localized/giu/MasterWindow.go:241 +0xcb fp=0xc000207fb0 sp=0xc000207f88 pc=0x55e2ab github.com/faiface/mainthread.Run.func1() /home/brett/go/1.21.2/pkg/mod/github.com/faiface/mainthread@v0.0.0-20171120011319-8b78f0a41ae3/mainthread.go:37 +0x23 fp=0xc000207fe0 sp=0xc000207fb0 pc=0x549e63 runtime.goexit() /home/brett/.goenv/versions/1.21.2/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc000207fe8 sp=0xc000207fe0 pc=0x46ccc1 created by github.com/faiface/mainthread.Run in goroutine 1 /home/brett/go/1.21.2/pkg/mod/github.com/faiface/mainthread@v0.0.0-20171120011319-8b78f0a41ae3/mainthread.go:36 +0xae goroutine 1 [select, locked to thread]: runtime.gopark(0xc000291eb8?, 0x2?, 0xff?, 0xff?, 0xc000291ea4?) /home/brett/.goenv/versions/1.21.2/src/runtime/proc.go:398 +0xce fp=0xc000517d50 sp=0xc000517d30 pc=0x43f7ae runtime.selectgo(0xc000517eb8, 0xc000291ea0, 0x7f864bc995b0?, 0x0, 0x18?, 0x1) /home/brett/.goenv/versions/1.21.2/src/runtime/select.go:327 +0x725 fp=0xc000517e70 sp=0xc000517d50 pc=0x44f285 github.com/faiface/mainthread.Run(0xc000130e10) /home/brett/go/1.21.2/pkg/mod/github.com/faiface/mainthread@v0.0.0-20171120011319-8b78f0a41ae3/mainthread.go:42 +0x10d fp=0xc000517ee8 sp=0xc000517e70 pc=0x549e0d github.com/AllenDang/giu.(*MasterWindow).Run(...) /home/brett/work/__rnd__/prism/localized/giu/MasterWindow.go:233 main.main() /home/brett/work/__rnd__/prism/localized/giu/examples/widgets/widgets.go:269 +0x16a fp=0xc000517f40 sp=0xc000517ee8 pc=0x55e1aa runtime.main() /home/brett/.goenv/versions/1.21.2/src/runtime/proc.go:267 +0x2bb fp=0xc000517fe0 sp=0xc000517f40 pc=0x43f35b runtime.goexit() /home/brett/.goenv/versions/1.21.2/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc000517fe8 sp=0xc000517fe0 pc=0x46ccc1 goroutine 2 [force gc (idle)]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) /home/brett/.goenv/versions/1.21.2/src/runtime/proc.go:398 +0xce fp=0xc00005efa8 sp=0xc00005ef88 pc=0x43f7ae runtime.goparkunlock(...) /home/brett/.goenv/versions/1.21.2/src/runtime/proc.go:404 runtime.forcegchelper() /home/brett/.goenv/versions/1.21.2/src/runtime/proc.go:322 +0xb3 fp=0xc00005efe0 sp=0xc00005efa8 pc=0x43f633 runtime.goexit() /home/brett/.goenv/versions/1.21.2/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc00005efe8 sp=0xc00005efe0 pc=0x46ccc1 created by runtime.init.6 in goroutine 1 /home/brett/.goenv/versions/1.21.2/src/runtime/proc.go:310 +0x1a goroutine 3 [GC sweep wait]: runtime.gopark(0x1?, 0x0?, 0x0?, 0x0?, 0x0?) /home/brett/.goenv/versions/1.21.2/src/runtime/proc.go:398 +0xce fp=0xc00005f778 sp=0xc00005f758 pc=0x43f7ae runtime.goparkunlock(...) /home/brett/.goenv/versions/1.21.2/src/runtime/proc.go:404 runtime.bgsweep(0x0?) /home/brett/.goenv/versions/1.21.2/src/runtime/mgcsweep.go:321 +0xdf fp=0xc00005f7c8 sp=0xc00005f778 pc=0x42adbf runtime.gcenable.func1() /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:200 +0x25 fp=0xc00005f7e0 sp=0xc00005f7c8 pc=0x420105 runtime.goexit() /home/brett/.goenv/versions/1.21.2/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc00005f7e8 sp=0xc00005f7e0 pc=0x46ccc1 created by runtime.gcenable in goroutine 1 /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:200 +0x66 goroutine 4 [GC scavenge wait]: runtime.gopark(0xc00007e000?, 0x98ab48?, 0x0?, 0x0?, 0x0?) /home/brett/.goenv/versions/1.21.2/src/runtime/proc.go:398 +0xce fp=0xc00005ff70 sp=0xc00005ff50 pc=0x43f7ae runtime.goparkunlock(...) /home/brett/.goenv/versions/1.21.2/src/runtime/proc.go:404 runtime.(*scavengerState).park(0xb95720) /home/brett/.goenv/versions/1.21.2/src/runtime/mgcscavenge.go:425 +0x49 fp=0xc00005ffa0 sp=0xc00005ff70 pc=0x428609 runtime.bgscavenge(0x0?) /home/brett/.goenv/versions/1.21.2/src/runtime/mgcscavenge.go:658 +0x59 fp=0xc00005ffc8 sp=0xc00005ffa0 pc=0x428bb9 runtime.gcenable.func2() /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:201 +0x25 fp=0xc00005ffe0 sp=0xc00005ffc8 pc=0x4200a5 runtime.goexit() /home/brett/.goenv/versions/1.21.2/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc00005ffe8 sp=0xc00005ffe0 pc=0x46ccc1 created by runtime.gcenable in goroutine 1 /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:201 +0xa5 goroutine 18 [finalizer wait]: runtime.gopark(0x0?, 0x95f630?, 0x0?, 0x40?, 0x1000000010?) /home/brett/.goenv/versions/1.21.2/src/runtime/proc.go:398 +0xce fp=0xc00005e628 sp=0xc00005e608 pc=0x43f7ae runtime.runfinq() /home/brett/.goenv/versions/1.21.2/src/runtime/mfinal.go:193 +0x107 fp=0xc00005e7e0 sp=0xc00005e628 pc=0x41f187 runtime.goexit() /home/brett/.goenv/versions/1.21.2/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc00005e7e8 sp=0xc00005e7e0 pc=0x46ccc1 created by runtime.createfing in goroutine 1 /home/brett/.goenv/versions/1.21.2/src/runtime/mfinal.go:163 +0x3d goroutine 34 [GC worker (idle)]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) /home/brett/.goenv/versions/1.21.2/src/runtime/proc.go:398 +0xce fp=0xc00005a750 sp=0xc00005a730 pc=0x43f7ae runtime.gcBgMarkWorker() /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1293 +0xe5 fp=0xc00005a7e0 sp=0xc00005a750 pc=0x421a85 runtime.goexit() /home/brett/.goenv/versions/1.21.2/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc00005a7e8 sp=0xc00005a7e0 pc=0x46ccc1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1217 +0x1c goroutine 35 [GC worker (idle)]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) /home/brett/.goenv/versions/1.21.2/src/runtime/proc.go:398 +0xce fp=0xc00005af50 sp=0xc00005af30 pc=0x43f7ae runtime.gcBgMarkWorker() /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1293 +0xe5 fp=0xc00005afe0 sp=0xc00005af50 pc=0x421a85 runtime.goexit() /home/brett/.goenv/versions/1.21.2/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc00005afe8 sp=0xc00005afe0 pc=0x46ccc1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1217 +0x1c goroutine 19 [GC worker (idle)]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) /home/brett/.goenv/versions/1.21.2/src/runtime/proc.go:398 +0xce fp=0xc0001d8750 sp=0xc0001d8730 pc=0x43f7ae runtime.gcBgMarkWorker() /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1293 +0xe5 fp=0xc0001d87e0 sp=0xc0001d8750 pc=0x421a85 runtime.goexit() /home/brett/.goenv/versions/1.21.2/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0001d87e8 sp=0xc0001d87e0 pc=0x46ccc1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1217 +0x1c goroutine 5 [GC worker (idle)]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) /home/brett/.goenv/versions/1.21.2/src/runtime/proc.go:398 +0xce fp=0xc000060750 sp=0xc000060730 pc=0x43f7ae runtime.gcBgMarkWorker() /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1293 +0xe5 fp=0xc0000607e0 sp=0xc000060750 pc=0x421a85 runtime.goexit() /home/brett/.goenv/versions/1.21.2/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0000607e8 sp=0xc0000607e0 pc=0x46ccc1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1217 +0x1c goroutine 6 [GC worker (idle)]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) /home/brett/.goenv/versions/1.21.2/src/runtime/proc.go:398 +0xce fp=0xc000060f50 sp=0xc000060f30 pc=0x43f7ae runtime.gcBgMarkWorker() /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1293 +0xe5 fp=0xc000060fe0 sp=0xc000060f50 pc=0x421a85 runtime.goexit() /home/brett/.goenv/versions/1.21.2/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc000060fe8 sp=0xc000060fe0 pc=0x46ccc1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1217 +0x1c goroutine 7 [GC worker (idle)]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) /home/brett/.goenv/versions/1.21.2/src/runtime/proc.go:398 +0xce fp=0xc000061750 sp=0xc000061730 pc=0x43f7ae runtime.gcBgMarkWorker() /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1293 +0xe5 fp=0xc0000617e0 sp=0xc000061750 pc=0x421a85 runtime.goexit() /home/brett/.goenv/versions/1.21.2/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0000617e8 sp=0xc0000617e0 pc=0x46ccc1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1217 +0x1c goroutine 8 [GC worker (idle)]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) /home/brett/.goenv/versions/1.21.2/src/runtime/proc.go:398 +0xce fp=0xc000061f50 sp=0xc000061f30 pc=0x43f7ae runtime.gcBgMarkWorker() /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1293 +0xe5 fp=0xc000061fe0 sp=0xc000061f50 pc=0x421a85 runtime.goexit() /home/brett/.goenv/versions/1.21.2/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc000061fe8 sp=0xc000061fe0 pc=0x46ccc1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1217 +0x1c goroutine 9 [GC worker (idle)]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) /home/brett/.goenv/versions/1.21.2/src/runtime/proc.go:398 +0xce fp=0xc0001d4750 sp=0xc0001d4730 pc=0x43f7ae runtime.gcBgMarkWorker() /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1293 +0xe5 fp=0xc0001d47e0 sp=0xc0001d4750 pc=0x421a85 runtime.goexit() /home/brett/.goenv/versions/1.21.2/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0001d47e8 sp=0xc0001d47e0 pc=0x46ccc1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1217 +0x1c goroutine 10 [GC worker (idle)]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) /home/brett/.goenv/versions/1.21.2/src/runtime/proc.go:398 +0xce fp=0xc0001d4f50 sp=0xc0001d4f30 pc=0x43f7ae runtime.gcBgMarkWorker() /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1293 +0xe5 fp=0xc0001d4fe0 sp=0xc0001d4f50 pc=0x421a85 runtime.goexit() /home/brett/.goenv/versions/1.21.2/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0001d4fe8 sp=0xc0001d4fe0 pc=0x46ccc1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1217 +0x1c goroutine 11 [GC worker (idle)]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) /home/brett/.goenv/versions/1.21.2/src/runtime/proc.go:398 +0xce fp=0xc0001d5750 sp=0xc0001d5730 pc=0x43f7ae runtime.gcBgMarkWorker() /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1293 +0xe5 fp=0xc0001d57e0 sp=0xc0001d5750 pc=0x421a85 runtime.goexit() /home/brett/.goenv/versions/1.21.2/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0001d57e8 sp=0xc0001d57e0 pc=0x46ccc1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1217 +0x1c goroutine 12 [GC worker (idle)]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) /home/brett/.goenv/versions/1.21.2/src/runtime/proc.go:398 +0xce fp=0xc0001d5f50 sp=0xc0001d5f30 pc=0x43f7ae runtime.gcBgMarkWorker() /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1293 +0xe5 fp=0xc0001d5fe0 sp=0xc0001d5f50 pc=0x421a85 runtime.goexit() /home/brett/.goenv/versions/1.21.2/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0001d5fe8 sp=0xc0001d5fe0 pc=0x46ccc1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1217 +0x1c goroutine 20 [GC worker (idle)]: runtime.gopark(0x1ed9804bb151f?, 0x0?, 0x0?, 0x0?, 0x0?) /home/brett/.goenv/versions/1.21.2/src/runtime/proc.go:398 +0xce fp=0xc0001d8f50 sp=0xc0001d8f30 pc=0x43f7ae runtime.gcBgMarkWorker() /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1293 +0xe5 fp=0xc0001d8fe0 sp=0xc0001d8f50 pc=0x421a85 runtime.goexit() /home/brett/.goenv/versions/1.21.2/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0001d8fe8 sp=0xc0001d8fe0 pc=0x46ccc1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1217 +0x1c goroutine 21 [GC worker (idle)]: runtime.gopark(0x1ed9804bb0bd5?, 0x0?, 0x0?, 0x0?, 0x0?) /home/brett/.goenv/versions/1.21.2/src/runtime/proc.go:398 +0xce fp=0xc0001d9750 sp=0xc0001d9730 pc=0x43f7ae runtime.gcBgMarkWorker() /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1293 +0xe5 fp=0xc0001d97e0 sp=0xc0001d9750 pc=0x421a85 runtime.goexit() /home/brett/.goenv/versions/1.21.2/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0001d97e8 sp=0xc0001d97e0 pc=0x46ccc1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1217 +0x1c goroutine 22 [GC worker (idle)]: runtime.gopark(0x1eda064955d15?, 0x3?, 0x1d?, 0xb?, 0x0?) /home/brett/.goenv/versions/1.21.2/src/runtime/proc.go:398 +0xce fp=0xc0001d9f50 sp=0xc0001d9f30 pc=0x43f7ae runtime.gcBgMarkWorker() /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1293 +0xe5 fp=0xc0001d9fe0 sp=0xc0001d9f50 pc=0x421a85 runtime.goexit() /home/brett/.goenv/versions/1.21.2/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0001d9fe8 sp=0xc0001d9fe0 pc=0x46ccc1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1217 +0x1c goroutine 23 [GC worker (idle)]: runtime.gopark(0xdbdc40?, 0x1?, 0x7e?, 0xcb?, 0x0?) /home/brett/.goenv/versions/1.21.2/src/runtime/proc.go:398 +0xce fp=0xc0001da750 sp=0xc0001da730 pc=0x43f7ae runtime.gcBgMarkWorker() /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1293 +0xe5 fp=0xc0001da7e0 sp=0xc0001da750 pc=0x421a85 runtime.goexit() /home/brett/.goenv/versions/1.21.2/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0001da7e8 sp=0xc0001da7e0 pc=0x46ccc1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1217 +0x1c goroutine 24 [GC worker (idle)]: runtime.gopark(0x1eda0649591e8?, 0x3?, 0x31?, 0xea?, 0x0?) /home/brett/.goenv/versions/1.21.2/src/runtime/proc.go:398 +0xce fp=0xc0001daf50 sp=0xc0001daf30 pc=0x43f7ae runtime.gcBgMarkWorker() /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1293 +0xe5 fp=0xc0001dafe0 sp=0xc0001daf50 pc=0x421a85 runtime.goexit() /home/brett/.goenv/versions/1.21.2/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0001dafe8 sp=0xc0001dafe0 pc=0x46ccc1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /home/brett/.goenv/versions/1.21.2/src/runtime/mgc.go:1217 +0x1c rax 0x0 rbx 0x0 rcx 0xc0002070d8 rdx 0xc000207068 rdi 0xc000524f30 rsi 0xc0005021a0 rbp 0x0 rsp 0x7f85fd9feb70 r8 0xc000500000 r9 0x0 r10 0x11 r11 0x30 r12 0xc000208000 r13 0x312493f924d2 r14 0xc000102680 r15 0x13a rip 0x60c70e rflags 0x10246 cs 0x33 fs 0x0 gs 0x0 Process finished with the exit code 2 ```

To Reproduce

  1. Run my demo
  2. will see the crash...

Version

master

OS

ubuntu

gucio321 commented 9 months ago

strange :thinking: It works on my fedora and it works on github codespace that uses ubuntu... Could you try delve?

gucio321 commented 9 months ago

ok, nevermind, now it crashes on my machine too. Error message is:

File: /home/runner/work/cimgui-go/cimgui-go/cimgui/imgui/imgui.cpp, Line: 6603
exit status 1
gucio321 commented 9 months ago

but the helloword example works for me fine

fniu commented 9 months ago

Just want to add that I run into crash/segfaults with all the examples (helloword example included). On Windows 11 pro.

gucio321 commented 8 months ago

I think its the problem with SingleWindowWithMenubar

gucio321 commented 8 months ago

also, imgui.cpp:6603

    IM_ASSERT(g.WithinFrameScope);                  // Forgot to call ImGui::NewFrame()
rokf commented 8 months ago

ℹ️ The issue has just happened to me on macOS Sonoma (14.0) as well - mentioned in #700.

gucio321 commented 8 months ago

Found the root cause of the crash: It happens only when SetSizeCallback method of imgui's backend is set, If size is changed or is too big by default it crashes.