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

internal/glfw: rare crash at setting an icon on macOS #2474

Open
1 of 10 tasks
hajimehoshi opened this issue Nov 30, 2022 · 6 comments
Open
1 of 10 tasks

internal/glfw: rare crash at setting an icon on macOS #2474

hajimehoshi opened this issue Nov 30, 2022 · 6 comments

Comments

@hajimehoshi
Copy link
Owner

hajimehoshi commented Nov 30, 2022

Ebitengine Version

v2.5.0-alpha.7

Operating System

  • Windows
  • macOS
  • Linux
  • FreeBSD
  • OpenBSD
  • Android
  • iOS
  • Nintendo Switch
  • Xbox
  • Web Browsers

Go Version (go version)

go version go1.19.2 darwin/amd64

What steps will reproduce the problem?

Just launch an application.

What is the expected result?

panic: NotInitialized: The GLFW library is not initialized

goroutine 1 [running, locked to thread]:
github.com/go-gl/glfw/v3.3/glfw.acceptError({0x0, 0x0, 0xc00005ef00?})
	/Users/daigosato/go/pkg/mod/github.com/go-gl/glfw/v3.3/[email protected]/error.go:174 +0x1d9
github.com/go-gl/glfw/v3.3/glfw.panicError(...)
	/Users/daigosato/go/pkg/mod/github.com/go-gl/glfw/v3.3/[email protected]/error.go:185
github.com/go-gl/glfw/v3.3/glfw.(*Window).GetMonitor(0x1000067f1?)
	/Users/daigosato/go/pkg/mod/github.com/go-gl/glfw/v3.3/[email protected]/window.go:662 +0x2b
github.com/hajimehoshi/ebiten/v2/internal/glfw.(*Window).GetMonitor(...)
	/Users/daigosato/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/glfw/glfw_notwindows.go:128
github.com/hajimehoshi/ebiten/v2/internal/ui.(*userInterfaceImpl).isFullscreen(0x100d62540)
	/Users/daigosato/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/ui/ui_glfw.go:537 +0x33
github.com/hajimehoshi/ebiten/v2/internal/ui.(*userInterfaceImpl).loop.func3.1()
	/Users/daigosato/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/ui/ui_glfw.go:1156 +0x5c
github.com/hajimehoshi/ebiten/v2/internal/thread.(*OSThread).Loop.func1(0xc01b217e08?, 0xc01b217df8?)
	/Users/daigosato/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/thread/thread.go:54 +0x53
github.com/hajimehoshi/ebiten/v2/internal/thread.(*OSThread).Loop(0xc000123998)
	/Users/daigosato/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/thread/thread.go:55 +0x2e
github.com/hajimehoshi/ebiten/v2/internal/ui.(*userInterfaceImpl).Run(0x100d62540, {0x10082c668?, 0xc000240bd0})
	/Users/daigosato/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/ui/run_notsinglethread.go:52 +0x231
github.com/hajimehoshi/ebiten/v2.RunGame({0x1008293a8, 0xc000001680})
	/Users/daigosato/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/run.go:233 +0x9d
main.main()
	/Users/daigosato/Development/odencat/rpgsnack/rpgsnack-runtime/main.go:127 +0x1d9

What happens instead?

No crash

Anything else you feel useful to add?

The issue is very rare and there is no stable way to reproduce this.

@hajimehoshi hajimehoshi added this to the v2.4.14 milestone Nov 30, 2022
@TotallyGamerJet
Copy link
Contributor

Which go Version are u using? And the expected is no crash right?

@hajimehoshi
Copy link
Owner Author

hajimehoshi commented Nov 30, 2022

(EDITED: NVM, I was misunderstanding)

@hajimehoshi
Copy link
Owner Author

hajimehoshi commented Nov 30, 2022

Which go Version are u using?

1.19.2.

And the expected is no crash right?

Right.

@TotallyGamerJet
Copy link
Contributor

Yeah I wouldn't really expect gotip branch to work since it doesn't play nicely with goroutines. There must be a reason it thinks that we are in Cgo when we aren't yet. I need to look into this further.

Fortunately, ebitengine won't flat at break in Go 1.20. Only -race when CGO_ENABLED=0 so a temporary fix is to just have them enable Cgo when using race which is already required. Plus ebitengine uses Cgo for glfw so it's okay for now.

@hajimehoshi
Copy link
Owner Author

Hmm this is a very mysterious error and this should never happen in theory.

@hajimehoshi hajimehoshi removed this from the v2.4.14 milestone Nov 30, 2022
@hajimehoshi hajimehoshi changed the title internal/glfw: rare crash at initialization on macOS internal/glfw: rare crash at setting an icon on macOS Nov 30, 2022
@TotallyGamerJet
Copy link
Contributor

I came across this golang/go#57263 issue which may relate.

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

No branches or pull requests

2 participants