pixel: Minimizing Windowed/Fullscreen App Causes Panic

OS: Win 10 Go: 1.9

EDIT: This panic is more general than we had imagined, it will occur if you minimize the application in any way (clicking on the minimize icon, Alt+TAB’ing, clicking on the icon on the taskbar), regardless of the windowed/fullscreen state. Comments up until the issue name change imply this is a fullscreen-only issue, which it is not.

If you (for example) make the Platformer example fullscreen then Alt+TAB, it will panic with the following:

panic: reflect: slice index out of range

goroutine 1 [running, locked to thread]:
reflect.Value.Index(0x539120, 0xc0423ecd20, 0x97, 0x0, 0x539120, 0x2, 0xc042c09cf8)
        C:/tools/go/src/reflect/value.go:871 +0x1eb
PixelBugTest/vendor/github.com/go-gl/gl/v3.3-core/gl.Ptr(0x539120, 0xc0423ecd20, 0x539120)
        C:/Users/username/go/src/PixelBugTest/vendor/github.com/go-gl/gl/v3.3-core/gl/conversions.go:44 +0xe4
PixelBugTest/vendor/github.com/faiface/glhf.NewTexture(0x0, 0x0, 0x0, 0x691f98, 0x0, 0x0, 0x0)
        C:/Users/username/go/src/PixelBugTest/vendor/github.com/faiface/glhf/texture.go:47 +0x125
PixelBugTest/vendor/github.com/faiface/glhf.NewFrame(0x0, 0x0, 0x0, 0x0)
        C:/Users/username/go/src/PixelBugTest/vendor/github.com/faiface/glhf/frame.go:37 +0x75
PixelBugTest/vendor/github.com/faiface/pixel/pixelgl.(*GLFrame).SetBounds.func1()
        C:/Users/username/go/src/PixelBugTest/vendor/github.com/faiface/pixel/pixelgl/glframe.go:35 +0x8b
PixelBugTest/vendor/github.com/faiface/mainthread.Call.func1()
        C:/Users/username/go/src/PixelBugTest/vendor/github.com/faiface/mainthread/mainthread.go:64 +0x2d
PixelBugTest/vendor/github.com/faiface/mainthread.Run(0x58dbd0)
        C:/Users/username/go/src/PixelBugTest/vendor/github.com/faiface/mainthread/mainthread.go:46 +0xf8
PixelBugTest/vendor/github.com/faiface/pixel/pixelgl.Run(0x58dbd0)
        C:/Users/username/go/src/PixelBugTest/vendor/github.com/faiface/pixel/pixelgl/run.go:32 +0x60
main.main()
        C:/Users/username/go/src/PixelBugTest/vendor/github.com/faiface/pixel/examples/platformer/main.go:394 +0x34
exit status 2

The error is possibly occurring in the glhf library, and I can confirm that it also happens in my personal project.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 21 (8 by maintainers)

Most upvoted comments

@faiface Fixed on my end for both fullscreen and windowed applications, thanks!

I submitted a quick fix to the master (because the fix is harmless for other purposes). The fix simply avoids allocating a 0x0 frame.

I’d love you guys to test it out, because I suspect that this problem has deeper roots and quick-fixing it this way will reveal another side-problem with the thing. But if not, I’m happy.

Yeah, I tried Alt+TABing and it worked fine. But I only have one monitor ATM, will try with multiple monitors later.