diamondburned/gotk4

[xcb] Unknown sequence number while processing queue

ayntgl opened this issue · 6 comments

I am receiving this error while running the gtk4/simple example from the examples repository:

[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
simple: xcb_io.c:269: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
SIGABRT: abort
PC=0x7f99fbb1834c m=0 sigcode=18446744073709551610
signal arrived during cgo execution

goroutine 1 [syscall, locked to thread]:
runtime.cgocall(0x7d8ce0, 0xc000109b00)
        /usr/lib/go/src/runtime/cgocall.go:156 +0x5c fp=0xc000109ad8 sp=0xc000109aa0 pc=0x54de7c
github.com/diamondburned/gotk4/pkg/gtk/v4._Cfunc_gtk_widget_show(0x2f7e300)
        _cgo_gotypes.go:52952 +0x45 fp=0xc000109b00 sp=0xc000109ad8 pc=0x6d6065
github.com/diamondburned/gotk4/pkg/gtk/v4.(*Widget).Show.func1(0x190)
        /home/user/go/pkg/mod/github.com/diamondburned/gotk4/pkg@v0.0.0-20220221063304-bbd86ac49f1b/gtk/v4/gtkwidget.go:6072 +0x3a fp=0xc000109b38 sp=0xc000109b00 pc=0x73783a
github.com/diamondburned/gotk4/pkg/gtk/v4.(*Widget).Show(0xc00013c000)
        /home/user/go/pkg/mod/github.com/diamondburned/gotk4/pkg@v0.0.0-20220221063304-bbd86ac49f1b/gtk/v4/gtkwidget.go:6072 +0x3e fp=0xc000109b50 sp=0xc000109b38 pc=0x7377de
main.activate(0x80)
        /home/user/code/gotk4-examples/gtk4/simple/main.go:23 +0x77 fp=0xc000109b80 sp=0xc000109b50 pc=0x7a5af7
main.main.func1()
        /home/user/code/gotk4-examples/gtk4/simple/main.go:11 +0x1d fp=0xc000109b98 sp=0xc000109b80 pc=0x7a5a5d
github.com/diamondburned/gotk4/pkg/gio/v2._gotk4_gio2_Application_ConnectActivate(0x54e446, 0xc0000001a0)
        /home/user/go/pkg/mod/github.com/diamondburned/gotk4/pkg@v0.0.0-20220221063304-bbd86ac49f1b/gio/v2/gapplication.go:589 +0x74 fp=0xc000109be0 sp=0xc000109b98 pc=0x615a94
_cgoexp_2e946dbfb880__gotk4_gio2_Application_ConnectActivate(0x7ffe8366e0b0)
        _cgo_gotypes.go:29181 +0x25 fp=0xc000109c00 sp=0xc000109be0 pc=0x661d05
runtime.cgocallbackg1(0x661ce0, 0xc000109db8, 0x0)
        /usr/lib/go/src/runtime/cgocall.go:306 +0x29a fp=0xc000109cd0 sp=0xc000109c00 pc=0x54e35a
runtime.cgocallbackg(0xc0000001a0, 0x300000002, 0xc0000001a0)
        /usr/lib/go/src/runtime/cgocall.go:232 +0x109 fp=0xc000109d60 sp=0xc000109cd0 pc=0x54e029
runtime.cgocallbackg(0x661ce0, 0x7ffe8366e450, 0x0)
        <autogenerated>:1 +0x2f fp=0xc000109d88 sp=0xc000109d60 pc=0x5ad18f
runtime.cgocallback(0x54dea5, 0x7f7850, 0xc000109e18)
        /usr/lib/go/src/runtime/asm_amd64.s:915 +0xb4 fp=0xc000109db0 sp=0xc000109d88 pc=0x5aadd4
runtime.systemstack_switch()
        /usr/lib/go/src/runtime/asm_amd64.s:350 fp=0xc000109db8 sp=0xc000109db0 pc=0x5a8dc0
runtime.cgocall(0x7f7850, 0xc000109e18)
        /usr/lib/go/src/runtime/cgocall.go:166 +0x85 fp=0xc000109df0 sp=0xc000109db8 pc=0x54dea5
github.com/diamondburned/gotk4/pkg/gio/v2._Cfunc_g_application_run(0x2c3e290, 0x1, 0x2c7b8b0)
        _cgo_gotypes.go:5564 +0x4c fp=0xc000109e18 sp=0xc000109df0 pc=0x6012ec
github.com/diamondburned/gotk4/pkg/gio/v2.(*Application).Run.func3(0x2c7b8b0, 0x129990, 0x2c7b8b0)
        /home/user/go/pkg/mod/github.com/diamondburned/gotk4/pkg@v0.0.0-20220221063304-bbd86ac49f1b/gio/v2/gapplication.go:1616 +0x71 fp=0xc000109e60 sp=0xc000109e18 pc=0x616f31
github.com/diamondburned/gotk4/pkg/gio/v2.(*Application).Run(0xc00000e048, {0xc0000121e0, 0x96e728, 0x1})
        /home/user/go/pkg/mod/github.com/diamondburned/gotk4/pkg@v0.0.0-20220221063304-bbd86ac49f1b/gio/v2/gapplication.go:1616 +0x1be fp=0xc000109f28 sp=0xc000109e60 pc=0x616e1e
main.main()
        /home/user/code/gotk4-examples/gtk4/simple/main.go:13 +0xb4 fp=0xc000109f80 sp=0xc000109f28 pc=0x7a5a14
runtime.main()
        /usr/lib/go/src/runtime/proc.go:255 +0x227 fp=0xc000109fe0 sp=0xc000109f80 pc=0x57f8a7
runtime.goexit()
        /usr/lib/go/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc000109fe8 sp=0xc000109fe0 pc=0x5aafe1

...
exit status 2

Can you try adding

func init() { runtime.LockOSThread() }

into the main.go file?

Does not seem to work, I receive an identical error:

[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
simple: xcb_io.c:269: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
SIGABRT: abort
PC=0x7f629dae034c m=0 sigcode=18446744073709551610
signal arrived during cgo execution
...

EDIT: I ran the example with the LIBGL_DRI3_DISABLE environment variable as true and it seemed to work for once, it is throwing the exact same error again.

and it seemed to work for once, it is throwing the exact same error again.

Do you mean it works without crashing or it doesn't work? I'm getting mixed signals here.

Also, does something like gtk4-demo work?

Do you mean it works without crashing or it doesn't work? I'm getting mixed signals here.

It worked just fine without any errors. After restarting the program, the error appeared again.

Also, does something like gtk4-demo work?

I am receiving the same error while running gtk4-demo:

[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
gtk4-demo-application: xcb_io.c:269: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
Aborted (core dumped)

You should open an issue on https://gitlab.gnome.org/GNOME/gtk then. I don't think I can help fix this.