hajimehoshi / ebiten

Ebitengine - A dead simple 2D game engine for Go
https://ebitengine.org
Apache License 2.0
10.78k stars 649 forks source link

SIGSEGV after the screen turns off with a game running #3000

Open Discontinuum opened 3 months ago

Discontinuum commented 3 months ago

Ebitengine Version

v2.7.3

Operating System

Go Version (go version)

go version go1.20.5 linux/amd64

What steps will reproduce the problem?

My screen locks after 5 minutes of inactivity. I noticed that if I left my game running and go afk, when I return, awake my screen and enter my password I find my game crashed. I tried with hello-world, the same stacktrace.

What is the expected result?

The game's still running

What happens instead?

[signal SIGSEGV: segmentation violation code=0x1 addr=0x48 pc=0x6b00d6]

goroutine 1 [running, locked to thread]:
github.com/hajimehoshi/ebiten/v2/internal/ui.(*Monitor).DeviceScaleFactor(...)
    /home/user/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.7.3/internal/ui/monitor_glfw.go:45
github.com/hajimehoshi/ebiten/v2/internal/ui.(*UserInterface).outsideSize(0xc0000a8580)
    /home/user/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.7.3/internal/ui/ui_glfw.go:1215 +0x136
github.com/hajimehoshi/ebiten/v2/internal/ui.(*UserInterface).update(0xc0000a8580)
    /home/user/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.7.3/internal/ui/ui_glfw.go:1397 +0x2ff
github.com/hajimehoshi/ebiten/v2/internal/ui.(*UserInterface).updateGame.func1()
    /home/user/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.7.3/internal/ui/ui_glfw.go:1442 +0x4a
github.com/hajimehoshi/ebiten/v2/internal/thread.(*OSThread).Loop.func1({0xc00024dec0?, 0x28?}, 0xc000012060?)
    /home/user/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.7.3/internal/thread/thread.go:67 +0x64
github.com/hajimehoshi/ebiten/v2/internal/thread.(*OSThread).Loop(0xc0000bd640, {0x827500, 0xc00007c1e0})
    /home/user/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.7.3/internal/thread/thread.go:68 +0x8a
github.com/hajimehoshi/ebiten/v2/internal/ui.(*UserInterface).runMultiThread(0xc0000a8580, {0x828db0?, 0xc0000ba540}, 0xc0000a87b0?)
    /home/user/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.7.3/internal/ui/run.go:71 +0x3b7
github.com/hajimehoshi/ebiten/v2/internal/ui.(*UserInterface).Run(0x826e40?, {0x828db0?, 0xc0000ba540?}, 0xc00005a6b0?)
    /home/user/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.7.3/internal/ui/run.go:33 +0x38
github.com/hajimehoshi/ebiten/v2.RunGameWithOptions({0x826e40, 0xb03e90}, 0x0)
    /home/user/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.7.3/run.go:325 +0x270
github.com/hajimehoshi/ebiten/v2.RunGame(...)
    /home/user/go/pkg/mod/github.com/hajimehoshi/ebiten/v2@v2.7.3/run.go:229
main.main()
    /home/user/Документы/ebiten_helloworld/main.go:32 +0x4b
exit status 2

Anything else you feel useful to add?

My system is Ubuntu 20.04.6 LTS with default GNOME shell. Seems the crash happens when the screen actually turns off because if I just quickly lock the screen and enter my password back, without the screen going off, it doesn't crash

hajimehoshi commented 3 months ago

I failed to reproduce the issue with Mint Linux + Cinnamon. I'll try another machine later.

julesnana commented 2 months ago

Oops