Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime panic with last key input update for #517 #520

Closed
simonklee opened this issue Mar 21, 2018 · 7 comments
Closed

runtime panic with last key input update for #517 #520

simonklee opened this issue Mar 21, 2018 · 7 comments

Comments

@simonklee
Copy link

6111cef update with gl input keys update causes panic (while
5ce0dd5 works fine).

> pwd
/home/simon/src/engo.io/engo/demos/hud

> go run -tags demo hud.go
2018/03/21 07:06:55 Using standard inputs
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x678 pc=0x7fa08d7da729]

runtime stack:
runtime.throw(0x6a9f48, 0x2a)
	/usr/local/go/src/runtime/panic.go:619 +0x81
runtime.sigpanic()
	/usr/local/go/src/runtime/signal_unix.go:372 +0x28e
runtime.asmcgocall(0x11, 0xc420059b98)
	/usr/local/go/src/runtime/asm_amd64.s:692 +0x70

goroutine 1 [syscall]:
runtime.cgocall(0x5c8880, 0xc420059b38, 0x100000000475533)
	/usr/local/go/src/runtime/cgocall.go:128 +0x64 fp=0xc420059af0 sp=0xc420059ab8 pc=0x43f0e4
github.com/go-gl/gl/v2.1/gl._Cfunc_glowClearColor(0x7fa08d7da720, 0x3f8000003f800000, 0x3f8000003f800000)
	_cgo_gotypes.go:7754 +0x45 fp=0xc420059b38 sp=0xc420059af0 pc=0x4f16c5
github.com/go-gl/gl/v2.1/gl.ClearColor(0x3f8000003f800000, 0x3f8000003f800000)
	/home/simon/src/github.com/go-gl/gl/v2.1/gl/package.go:18348 +0x5d fp=0xc420059b60 sp=0xc420059b38 pc=0x4f424d
engo.io/gl.(*Context).ClearColor(0xc4200fe000, 0x3f8000003f800000, 0x3f8000003f800000)
	/home/simon/src/engo.io/gl/gl_gl2.go:918 +0x51 fp=0xc420059b80 sp=0xc420059b60 pc=0x536591
engo.io/engo/common.SetBackground(0x6c3ee0, 0xc4200a60f8)
	/home/simon/src/engo.io/engo/common/render.go:289 +0xba fp=0xc420059ba8 sp=0xc420059b80 pc=0x5ac0aa
main.(*DefaultScene).Setup(0x9d3c20, 0x6c39c0, 0xc42009e100)
	/home/simon/src/engo.io/engo/demos/hud/hud.go:30 +0x7d fp=0xc420059c30 sp=0xc420059ba8 pc=0x5bb4bd
engo.io/engo.SetScene(0x6c4ca0, 0x9d3c20, 0x542f00)
	/home/simon/src/engo.io/engo/scene.go:106 +0x289 fp=0xc420059c78 sp=0xc420059c30 pc=0x543b89
engo.io/engo.RunPreparation(0x6c4ca0, 0x9d3c20)
	/home/simon/src/engo.io/engo/engo_glfw.go:244 +0x54 fp=0xc420059ca0 sp=0xc420059c78 pc=0x542e64
engo.io/engo.runLoop(0x6c4ca0, 0x9d3c20, 0x300)
	/home/simon/src/engo.io/engo/engo_glfw.go:256 +0x121 fp=0xc420059d88 sp=0xc420059ca0 pc=0x542fb1
engo.io/engo.Run(0x0, 0x6959d2, 0x8, 0x0, 0x320, 0x320, 0x0, 0x3c, 0x100, 0x1, ...)
	/home/simon/src/engo.io/engo/engo.go:206 +0x3e6 fp=0xc420059e68 sp=0xc420059d88 pc=0x541d86
main.main()
	/home/simon/src/engo.io/engo/demos/hud/hud.go:62 +0xe0 fp=0xc420059f88 sp=0xc420059e68 pc=0x5bb860
runtime.main()
	/usr/local/go/src/runtime/proc.go:198 +0x212 fp=0xc420059fe0 sp=0xc420059f88 pc=0x4677f2
runtime.goexit()
	/usr/local/go/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc420059fe8 sp=0xc420059fe0 pc=0x491df1

goroutine 35 [syscall]:
os/signal.signal_recv(0x0)
	/usr/local/go/src/runtime/sigqueue.go:139 +0xa6
os/signal.loop()
	/usr/local/go/src/os/signal/signal_unix.go:22 +0x22
created by os/signal.init.0
	/usr/local/go/src/os/signal/signal_unix.go:28 +0x41

goroutine 36 [select, locked to thread]:
runtime.gopark(0x6acd10, 0x0, 0x69557e, 0x6, 0x18, 0x1)
	/usr/local/go/src/runtime/proc.go:291 +0x11a
runtime.selectgo(0xc4200af750, 0xc4200800c0)
	/usr/local/go/src/runtime/select.go:392 +0xe50
runtime.ensureSigM.func1()
	/usr/local/go/src/runtime/signal_unix.go:549 +0x1f4
runtime.goexit()
	/usr/local/go/src/runtime/asm_amd64.s:2361 +0x1

goroutine 37 [runnable]:
engo.io/engo.runLoop.func1(0xc4200b4120)
	/home/simon/src/engo.io/engo/engo_glfw.go:251
created by engo.io/engo.runLoop
	/home/simon/src/engo.io/engo/engo_glfw.go:251 +0x103```
@Noofbiz
Copy link
Member

Noofbiz commented Mar 21, 2018

Did you press a key before this happened? It looks like it's panicking at gl.ClearColor. I believe go-gl has been having some trouble with the bindings lately, but I thought they were doing it with ogl 4. I'll look into it. Thanks for the report!

@simonklee
Copy link
Author

Not that I'm aware of. It panics in less than a second.

@Noofbiz
Copy link
Member

Noofbiz commented Mar 21, 2018

Looks like it could be related to go-gl/gl#93, there are a lot of changes to 2.1 in here for some reason. I'll submit an issue there and see. For now, try using go-gl/gl go-gl/gl@eafa86a, it's working for me.

@simonklee
Copy link
Author

Thanks for the information. I'll follow your suggestion for now.

@dmitshur
Copy link

The original issue report stated:

6111cef update with gl input keys update causes panic (while 5ce0dd5 works fine).

I can reproduce and confirm that. The issue is within this repository, and it's not related to the recent go-gl/gl change.

@dmitshur
Copy link

If I add:

func init() {
	runtime.LockOSThread()
}

To engo_glfw.go, the issue seems to be resolved.

dmitshur referenced this issue Mar 21, 2018
changed keys to have Key prefix and be const
@Noofbiz
Copy link
Member

Noofbiz commented Mar 21, 2018

Yes, that is exactly right. Right now I've got some weird setup where all my testing is done with gopherjs via Cloud9 so I didn't really look at glfw. Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants