Humpheh/goboy

fatal error: unexpected signal during runtime execution

ws-zzy opened this issue · 3 comments

Since I can't access golang.org, I remove go.sum and go.mod. Then I manually download the dependencies from github. But now I am having problems running. I want to know what is wrong.

# github.com/go-gl/glfw/v3.2/glfw
In file included from ../../go/src/github.com/go-gl/glfw/v3.2/glfw/c_glfw_linbsd.go:24:0:
../../go/src/github.com/go-gl/glfw/v3.2/glfw/glfw/src/linux_joystick.c: In function ‘_glfwInitJoysticksLinux’:
../../go/src/github.com/go-gl/glfw/v3.2/glfw/glfw/src/linux_joystick.c:224:42: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 9 [-Wformat-truncation=]
             snprintf(path, sizeof(path), "%s/%s", dirname, entry->d_name);
                                          ^~~~~~~
In file included from /usr/include/stdio.h:862:0,
                 from /usr/include/X11/Xcursor/Xcursor.h:26,
                 from ../../go/src/github.com/go-gl/glfw/v3.2/glfw/glfw/src/x11_platform.h:39,
                 from ../../go/src/github.com/go-gl/glfw/v3.2/glfw/glfw/src/internal.h:169,
                 from ../../go/src/github.com/go-gl/glfw/v3.2/glfw/glfw/src/x11_init.c:28,
                 from ../../go/src/github.com/go-gl/glfw/v3.2/glfw/c_glfw_linbsd.go:19:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:64:10: note: ‘__builtin___snprintf_chk’ output between 12 and 267 bytes into a destination of size 20
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ws-zzy/code/goboy/go_build_main_go #gosetup
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x7fc12bdf0fa0]

runtime stack:
runtime.throw(0x71a5fa, 0x2a)
	/usr/local/go/src/runtime/panic.go:608 +0x72
runtime.sigpanic()
	/usr/local/go/src/runtime/signal_unix.go:374 +0x2f2

goroutine 1 [syscall, locked to thread]:
runtime.cgocall(0x6335e0, 0xc00009fb80, 0x25f50a0)
	/usr/local/go/src/runtime/cgocall.go:128 +0x5e fp=0xc00009fb50 sp=0xc00009fb18 pc=0x46653e
github.com/mattn/go-gtk/gtk._Cfunc_gtk_dialog_run(0x25f50a0, 0x0)
	_cgo_gotypes.go:7705 +0x49 fp=0xc00009fb80 sp=0xc00009fb50 pc=0x55e5a9
github.com/mattn/go-gtk/gtk.(*Dialog).Run.func1(0x25f50a0, 0x25f50a0)
	/home/ws-zzy/go/src/github.com/mattn/go-gtk/gtk/gtk.go:1236 +0x56 fp=0xc00009fbb8 sp=0xc00009fb80 pc=0x57a286
github.com/mattn/go-gtk/gtk.(*Dialog).Run(0xc0000100e0, 0xc00000e030)
	/home/ws-zzy/go/src/github.com/mattn/go-gtk/gtk/gtk.go:1236 +0x39 fp=0xc00009fbd8 sp=0xc00009fbb8 pc=0x56b729
github.com/Humpheh/goboy/dialog.chooseFile(0x70b346, 0x4, 0x0, 0xc00009fe30, 0x0, 0x0, 0x0, 0x0)
	/home/ws-zzy/go/src/github.com/Humpheh/goboy/dialog/dlgs_linux.go:68 +0x35e fp=0xc00009fd38 sp=0xc00009fbd8 pc=0x598c4e
github.com/Humpheh/goboy/dialog.(*FileBuilder).load(0xc00009fe30, 0x0, 0x6987a0, 0xc0000d0120, 0xc00005a100)
	/home/ws-zzy/go/src/github.com/Humpheh/goboy/dialog/dlgs_linux.go:40 +0x49 fp=0xc00009fd88 sp=0xc00009fd38 pc=0x598689
github.com/Humpheh/goboy/dialog.(*FileBuilder).Load(0xc00009fe30, 0x0, 0x0, 0x0, 0x1)
	/home/ws-zzy/go/src/github.com/Humpheh/goboy/dialog/dlgs.go:101 +0x2b fp=0xc00009fdc0 sp=0xc00009fd88 pc=0x59818b
main.getROM.func1()
	/home/ws-zzy/code/goboy/cmd/goboy/main.go:123 +0x1e8 fp=0xc00009fe78 sp=0xc00009fdc0 pc=0x62f6d8
github.com/faiface/mainthread.Call.func1()
	/home/ws-zzy/go/src/github.com/faiface/mainthread/mainthread.go:63 +0x2f fp=0xc00009fea0 sp=0xc00009fe78 pc=0x54312f
github.com/faiface/mainthread.Run(0x71ca48)
	/home/ws-zzy/go/src/github.com/faiface/mainthread/mainthread.go:44 +0xbd fp=0xc00009ff40 sp=0xc00009fea0 pc=0x542d2d
github.com/faiface/pixel/pixelgl.Run(0x71ca48)
	/home/ws-zzy/go/src/github.com/faiface/pixel/pixelgl/run.go:32 +0x57 fp=0xc00009ff80 sp=0xc00009ff40 pc=0x627df7
main.main()
	/home/ws-zzy/code/goboy/cmd/goboy/main.go:45 +0x32 fp=0xc00009ff98 sp=0xc00009ff80 pc=0x62eb32
runtime.main()
	/usr/local/go/src/runtime/proc.go:201 +0x207 fp=0xc00009ffe0 sp=0xc00009ff98 pc=0x48f507
runtime.goexit()
	/usr/local/go/src/runtime/asm_amd64.s:1333 +0x1 fp=0xc00009ffe8 sp=0xc00009ffe0 pc=0x4ba751

goroutine 19 [chan receive]:
github.com/faiface/mainthread.Call(0xc0000100d0)
	/home/ws-zzy/go/src/github.com/faiface/mainthread/mainthread.go:66 +0xc2
main.getROM(0x0, 0xc0000920e0)
	/home/ws-zzy/code/goboy/cmd/goboy/main.go:119 +0xbf
main.start()
	/home/ws-zzy/code/goboy/cmd/goboy/main.go:53 +0x5e
github.com/faiface/mainthread.Run.func1(0x71ca48, 0xc000068240)
	/home/ws-zzy/go/src/github.com/faiface/mainthread/mainthread.go:37 +0x27
created by github.com/faiface/mainthread.Run
	/home/ws-zzy/go/src/github.com/faiface/mainthread/mainthread.go:36 +0xb1

Since I can't access golang.org

What do you mean by this statement?

Are you doing go build -o goboy cmd/goboy/main.go ?

Since I can't access golang.org

What do you mean by this statement?

I am in China, so can not access golang.org

Are you doing go build -o goboy cmd/goboy/main.go ?

I use IDE to compile, as follow

GOROOT=/usr/local/go #gosetup
GOPATH=/home/ws-zzy/go #gosetup
/usr/local/go/bin/go build -o /home/ws-zzy/code/goboy/go_build_main_go /home/ws-zzy/code/goboy/cmd/goboy/main.go #gosetup

This looks like there is a problem with some of the C dependencies. How did you install the go dependencies for GoBoy? If it wasn't installed normally there may be some issues if the C dependencies aren't installed.