gonutz / prototype

Simple 2D game prototyping framework.

Home Page:https://pkg.go.dev/github.com/gonutz/prototype/draw

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

some errors on linux arm

MatejMagat305 opened this issue · comments

hello, i am sorry(I am only begener) but I was trying this library on linux arm(andronix, you can see on Linux Distro on Android) and I found this:

  • build with sdl2:
./sdl2
shared memfd open() failed: Function not implemented
shared memfd open() failed: Function not implemented
  • build without tags:
./default
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x2 addr=0x7f7d92a000 pc=0x7f54028800]

runtime stack:
runtime.throw(0x5ccad6, 0x2a)
/usr/local/go/src/runtime/panic.go:1117 +0x54
runtime.sigpanic()
/usr/local/go/src/runtime/signal_unix.go:718 +0x29c

goroutine 1 [syscall, locked to thread]:
runtime.cgocall(0x580a40, 0x40000bfdb8, 0x4000070000)
/usr/local/go/src/runtime/cgocall.go:154 +0x50 fp=0x40000bfd80 sp=0x40000bfd40 pc=0x445ba0
github.com/gonutz/glfw/v3.3/glfw._Cfunc_glfwSwapBuffers(0x76ab60)
_cgo_gotypes.go:2403 +0x40 fp=0x40000bfdb0 sp=0x40000bfd80 pc=0x54ec10
github.com/gonutz/glfw/v3.3/glfw.(*Window).SwapBuffers.func1(0x40000d0000)
/root/go/pkg/mod/github.com/gonutz/glfw@v1.0.2/v3.3/glfw/context.go:41 +0x50 fp=0x40000bfdf0 sp=0x40000bfdb0 pc=0x551580
github.com/gonutz/glfw/v3.3/glfw.(*Window).SwapBuffers(0x40000d0000)
/root/go/pkg/mod/github.com/gonutz/glfw@v1.0.2/v3.3/glfw/context.go:41 +0x28 fp=0x40000bfe30 sp=0x40000bfdf0 pc=0x54ef28
github.com/gonutz/prototype/draw.RunWindow(0x5b7992, 0x5, 0x280, 0x1e0, 0x5ce898, 0x0, 0x0)
/root/go/pkg/mod/github.com/gonutz/prototype@v1.0.5/draw/window_glfw.go:125 +0x6a8 fp=0x40000bff20 sp=0x40000bfe30 pc=0x554c58
main.main()
/root/go/src/my/my.go:10 +0x50 fp=0x40000bff70 sp=0x40000bff20 pc=0x558fb0
runtime.main()
/usr/local/go/src/runtime/proc.go:225 +0x274 fp=0x40000bffd0 sp=0x40000bff70 pc=0x475bf4
runtime.goexit()
/usr/local/go/src/runtime/asm_arm64.s:1130 +0x4 fp=0x40000bffd0 sp=0x40000bffd0 pc=0x4a4bc4

So this seems to be a problem in the underlying GLFW and SDL2 libraries.

SDL2 just does not currently seem to support it. I am not sure why or what the problem really is. Maybe you could spend some time investigating this and post some reference information about it here?

The GLFW SwapBuffers call is the one where the drawn frame gets rendered to the monitor, so to speak. The segfault looks like the C code is having a problem. Go's error messages are often not very helpful when CGo code crashes. I am not sure why this happens either. Maybe you could try to debug this a little more and find the root of the problem.

Currently I am not well prepared to reproduce this issue. I have neither an Android phone to try this out on, nor do I have an Android emulator and honestly this seems like a lot of work to me. That is why I am asking you whether you can inspect these issues further, as you seem to have your device up and running already.

Generally some repos will tell you that bugs in their dependencies are not their problem but I disagree with that sentiment. If there is a thing that I have to implement in SDL2 or a bug to fix in GLFW I will try my best to do that. But as I said, in this case I do not feel prepared to even reproduce this issue.

I can try it in summer..........

Sure, I will close this issue then. Feel free to re-open it or open a new one when you are ready.