~eliasnaur/gio

1

Segfault when trying to run example

Details
Message ID
<20210621181531.ru74q5uaf7demhnp@basedpad.localdomain>
DKIM signature
pass
Download raw message
Hello,

I was interested in trying this library, unfortunately I a problem came
up when I attempted to run this example here:
https://git.sr.ht/~eliasnaur/gio-example/tree/main/item/hello/hello.go

I am pretty confident that I have all the dependencies that I need, as
per the official documentation, although I might be wrong. My system is
Artix Linux, running Sway as window manager.

The full error when trying to run the build binary:

```
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x103 pc=0x7fd42ae43494]

runtime stack:
runtime.throw(0x5df116, 0x2a)
        /usr/lib/go/src/runtime/panic.go:1117 +0x72
runtime.sigpanic()
        /usr/lib/go/src/runtime/signal_unix.go:718 +0x2e5

goroutine 7 [syscall]:
runtime.cgocall(0x577d30, 0xc000046bb8, 0xc000001b01)
        /usr/lib/go/src/runtime/cgocall.go:154 +0x5b fp=0xc000046b88 sp=0xc000046b50 pc=0x40de9b
gioui.org/internal/egl._Cfunc_eglInitialize(0x7fd3ec033340, 0xc00008e168, 0xc00008e16c, 0xc000000000)
        _cgo_gotypes.go:205 +0x48 fp=0xc000046bb8 sp=0xc000046b88 pc=0x521ee8
gioui.org/internal/egl.eglInitialize.func1(...)
        /home/yaroslav/.local/share/go/pkg/mod/gioui.org@v0.0.0-20210616100142-f24232dac52e/internal/egl/egl_unix.go:69
gioui.org/internal/egl.eglInitialize(0x7fd3ec033340, 0xc000000000, 0x40e53b)
        /home/yaroslav/.local/share/go/pkg/mod/gioui.org@v0.0.0-20210616100142-f24232dac52e/internal/egl/egl_unix.go:69 +0x73 fp=0xc000046bf8 sp=0xc000046bb8 pc=0x5225f3
gioui.org/internal/egl.createContext(0x7fd3ec033340, 0x7fd3ec033340, 0xc0000b20a0, 0xc000001b00)
        /home/yaroslav/.local/share/go/pkg/mod/gioui.org@v0.0.0-20210616100142-f24232dac52e/internal/egl/egl.go:162 +0x45 fp=0xc000046ca8 sp=0xc000046bf8 pc=0x520e05
gioui.org/internal/egl.NewContext(0x7fd3ec003c50, 0x2, 0x410345, 0xc00006e120)
        /home/yaroslav/.local/share/go/pkg/mod/gioui.org@v0.0.0-20210616100142-f24232dac52e/internal/egl/egl.go:89 +0x68 fp=0xc000046d10 sp=0xc000046ca8 pc=0x5207a8
gioui.org/app/internal/wm.(*x11Window).NewContext(0xc0000a8000, 0x54e745, 0xc000046db8, 0xc000046d98, 0x0)
        /home/yaroslav/.local/share/go/pkg/mod/gioui.org@v0.0.0-20210616100142-f24232dac52e/app/internal/wm/egl_x11.go:20 +0x33 fp=0xc000046d48 sp=0xc000046d10 pc=0x52bb33
gioui.org/app.(*Window).validateAndProcess(0xc000014900, 0x63ce90, 0xc0000a8000, 0xc02c5371c787d76e, 0xa54d46, 0x90e140, 0x320, 0x258, 0x1, 0xc00006c280, ...)
        /home/yaroslav/.local/share/go/pkg/mod/gioui.org@v0.0.0-20210616100142-f24232dac52e/app/window.go:147 +0x282 fp=0xc000046de8 sp=0xc000046d48 pc=0x54cc62
gioui.org/app.(*Window).run(0xc000014900, 0xc00006c0a0)
        /home/yaroslav/.local/share/go/pkg/mod/gioui.org@v0.0.0-20210616100142-f24232dac52e/app/window.go:508 +0x70e fp=0xc000046fd0 sp=0xc000046de8 pc=0x54eece
runtime.goexit()
        /usr/lib/go/src/runtime/asm_amd64.s:1371 +0x1 fp=0xc000046fd8 sp=0xc000046fd0 pc=0x473761
created by gioui.org/app.NewWindow
        /home/yaroslav/.local/share/go/pkg/mod/gioui.org@v0.0.0-20210616100142-f24232dac52e/app/window.go:116 +0x31a

goroutine 1 [select (no cases)]:
gioui.org/app/internal/wm.Main()
        /home/yaroslav/.local/share/go/pkg/mod/gioui.org@v0.0.0-20210616100142-f24232dac52e/app/internal/wm/os_unix.go:14 +0x25
gioui.org/app.Main(...)
        /home/yaroslav/.local/share/go/pkg/mod/gioui.org@v0.0.0-20210616100142-f24232dac52e/app/app.go:53
main.main()
        /home/yaroslav/etc/tmp/gioex/gioex.go:30 +0x3a

goroutine 6 [chan receive]:
gioui.org/app.(*Window).update(...)
        /home/yaroslav/.local/share/go/pkg/mod/gioui.org@v0.0.0-20210616100142-f24232dac52e/app/window.go:131
main.loop(0xc000014900, 0x0, 0x0)
        /home/yaroslav/etc/tmp/gioex/gioex.go:48 +0x2f1
main.main.func1()
        /home/yaroslav/etc/tmp/gioex/gioex.go:25 +0x45
created by main.main
        /home/yaroslav/etc/tmp/gioex/gioex.go:23 +0x35

goroutine 18 [select]:
gioui.org/app.(*Window).runFuncs(0xc000014900, 0x63ce90, 0xc0000a8000)
        /home/yaroslav/.local/share/go/pkg/mod/gioui.org@v0.0.0-20210616100142-f24232dac52e/app/window.go:379 +0x1b0
gioui.org/app.(*callbacks).Event(0xc000014ce8, 0x6392e8, 0xc0000b6000)
        /home/yaroslav/.local/share/go/pkg/mod/gioui.org@v0.0.0-20210616100142-f24232dac52e/app/window.go:354 +0xea
gioui.org/app/internal/wm.(*x11Window).loop(0xc0000a8000)
        /home/yaroslav/.local/share/go/pkg/mod/gioui.org@v0.0.0-20210616100142-f24232dac52e/app/internal/wm/os_x11.go:329 +0x35b
gioui.org/app/internal/wm.newX11Window.func13(0xc0000a8000)
        /home/yaroslav/.local/share/go/pkg/mod/gioui.org@v0.0.0-20210616100142-f24232dac52e/app/internal/wm/os_x11.go:693 +0x5f
created by gioui.org/app/internal/wm.newX11Window
        /home/yaroslav/.local/share/go/pkg/mod/gioui.org@v0.0.0-20210616100142-f24232dac52e/app/internal/wm/os_x11.go:690 +0x87f
```

I wasn't sure if I should post it here or in the issue tracker, since it
probably is just a problem from my side. Thanks in advance!
Details
Message ID
<CAFcc3FRz3Ku9TBH+CTOEQuOZEXj+cB=V+JRTJ8C_FEUUfFLDqQ@mail.gmail.com>
In-Reply-To
<20210621181531.ru74q5uaf7demhnp@basedpad.localdomain> (view parent)
DKIM signature
pass
Download raw message
Hi Yaroslav,

I've never seen this error before in Gio. My suspicion is that it's
originating from the Artix Linux GL libraries that Gio is calling
into. I run a lot of Gio applications on Arch, and I can confirm that
this doesn't happen there.

You could try booting a live distribution for a different distro and
running it there as a sanity check. If you're looking to go deep and
debug this problem, I recommend attaching gdb to the built Gio program
and issuing `backtrace` after the segfault to try to find where in the
C library you're hitting the problem.

The ML is a good place for this until we better understand the
problem. If we confirm that it's a Gio bug, we can open a ticket for
it.

Cheers,
Chris
Reply to thread Export thread (mbox)