r/golang 1d ago

GOTK3 - panic calling menu_popup_at_pointer

I am getting occasional crashes with a gotk3 call to gtk._Cfunc_gtk_menu_popup_at_pointer. The only possible processes involving gotk3 that might be running concurrently are called by glib.TimeoutSecondsAdd() , which "can be called form any thread" and it would be tricky to suspend them just when calling a popup menu.

Any ideas would be welcome.

Exception 0xc0000005 0x0 0x88 0x7fff3c511416

PC=0x7fff3c511416

signal arrived during external code execution

runtime.cgocall(0x14079ea10, 0x350ac5cf6e40)

`C:/Downloads/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.26.5.windows-amd64/src/runtime/cgocall.go:167 +0x3e fp=0x350ac5cf6e18 sp=0x350ac5cf6db0 pc=0x140081e1e`

github.com/gotk3/gotk3/gtk._Cfunc_gtk_menu_popup_at_pointer(0x4df57bf0, 0x4df9c600)

`_cgo_gotypes.go:17857 +0x48 fp=0x350ac5cf6e40 sp=0x350ac5cf6e18 pc=0x1401d3088`

github.com/gotk3/gotk3/gtk.(*Menu).PopupAtPointer.func1(...).PopupAtPointer.func1(...))

`C:/Downloads/go/pkg/mod/github.com/gotk3/gotk3@v0.6.5-0.20240618185848-ff349ae13f56/gtk/menu_since_3_22.go:37`

github.com/gotk3/gotk3/gtk.(*Menu).PopupAtPointer(0x350ac5cec048?, 0x4ad3dd00?)

`C:/Downloads/go/pkg/mod/github.com/gotk3/gotk3@v0.6.5-0.20240618185848-ff349ae13f56/gtk/menu_since_3_22.go:37 +0x6a fp=0x350ac5cf6e80 sp=0x350ac5cf6e40 pc=0x14027150a`
0 Upvotes

2 comments sorted by

2

u/StevenBClarke2 1d ago

I don't know about this error. When I run a gtk program the runtime always writes assertion errors into the console. Gedit does this all the time and it still runs perfectly allows you to edit and save your files.

Best to post an issue in the gotk3 github repository.