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/graphicsdriver/opengl/gl: Wayland + EGL causes crash #3152

Closed
1 of 11 tasks
MonstraG opened this issue Nov 3, 2024 · 26 comments
Closed
1 of 11 tasks

internal/graphicsdriver/opengl/gl: Wayland + EGL causes crash #3152

MonstraG opened this issue Nov 3, 2024 · 26 comments

Comments

@MonstraG
Copy link

MonstraG commented Nov 3, 2024

Ebitengine Version

tried
2.8.3
and
v2.9.0-alpha.3.0.20241103104718-1014e4536557

Operating System

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

Go Version (go version)

go version go1.23.2 linux/amd64

What steps will reproduce the problem?

go run github.com/hajimehoshi/ebiten/v2/examples/rotate@latest

What is the expected result?

runs

What happens instead?

SIGSEGV: segmentation violation
PC=0x7ff2ac312ba4 m=0 sigcode=1 addr=0x143
signal arrived during cgo execution

goroutine 1 gp=0xc0000061c0 m=0 mp=0xa684e0 [syscall, locked to thread]:
runtime.cgocall(0x6ddaf0, 0xc000143b50)
        /home/arseny/sdk/go1.23.2/src/runtime/cgocall.go:167 +0x4b fp=0xc000143b28 sp=0xc000143af0 pc=0x46d46b
github.com/hajimehoshi/ebiten/v2/internal/glfw._Cfunc_glfwCreateWindow(0x280, 0x1e0, 0x147050d0, 0x0, 0x0)
        _cgo_gotypes.go:324 +0x4c fp=0xc000143b50 sp=0xc000143b28 pc=0x62b86c
github.com/hajimehoshi/ebiten/v2/internal/glfw.CreateWindow.func2(0x280, 0x1e0, 0x147050d0, 0x0, 0x0)
        /home/arseny/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/glfw/window_unix.go:286 +0x99 fp=0xc000143b98 sp=0xc000143b50 pc=0x634eb9
github.com/hajimehoshi/ebiten/v2/internal/glfw.CreateWindow(0x280, 0x1e0, {0x0?, 0xa684e0?}, 0x0, 0x0)
        /home/arseny/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/glfw/window_unix.go:286 +0xcd fp=0xc000143c18 sp=0xc000143b98 pc=0x634ccd
github.com/hajimehoshi/ebiten/v2/internal/ui.(*UserInterface).createWindow(0xc0004dc608)
        /home/arseny/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/ui/ui_glfw.go:840 +0x85 fp=0xc000143c88 sp=0xc000143c18 pc=0x6cab85
github.com/hajimehoshi/ebiten/v2/internal/ui.(*UserInterface).initOnMainThread(0xc0004dc608, 0xc00021a140)
        /home/arseny/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/ui/ui_glfw.go:1148 +0x225 fp=0xc000143cc8 sp=0xc000143c88 pc=0x6cba85
github.com/hajimehoshi/ebiten/v2/internal/ui.(*UserInterface).runMultiThread.func2.1()
        /home/arseny/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/ui/run.go:60 +0x25 fp=0xc000143cf0 sp=0xc000143cc8 pc=0x6c5725
github.com/hajimehoshi/ebiten/v2/internal/thread.(*OSThread).Loop.func1({0xc00007b500?, 0x58?}, 0x20?)
        /home/arseny/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/thread/thread.go:67 +0x4f fp=0xc000143d20 sp=0xc000143cf0 pc=0x5e29af
github.com/hajimehoshi/ebiten/v2/internal/thread.(*OSThread).Loop(0xc0000251d0, {0x8016e0, 0xc000286370})
        /home/arseny/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/thread/thread.go:68 +0x79 fp=0xc000143dc0 sp=0xc000143d20 pc=0x5e2839
github.com/hajimehoshi/ebiten/v2/internal/ui.(*UserInterface).runMultiThread(0xc0004dc608, {0x8034f0, 0xc0000be1c0}, 0xc00021a140)
        /home/arseny/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/ui/run.go:75 +0x322 fp=0xc000143e40 sp=0xc000143dc0 pc=0x6c54a2
github.com/hajimehoshi/ebiten/v2/internal/ui.(*UserInterface).Run(0x7fffc8?, {0x8034f0?, 0xc0000be1c0?}, 0x4dc8b0?)
        /home/arseny/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/ui/run.go:33 +0x30 fp=0xc000143e70 sp=0xc000143e40 pc=0x6c5130
github.com/hajimehoshi/ebiten/v2.RunGameWithOptions({0x7fffc8, 0xc0000141d0}, 0x0)
        /home/arseny/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/run.go:345 +0x208 fp=0xc000143ef0 sp=0xc000143e70 pc=0x6db9c8
github.com/hajimehoshi/ebiten/v2.RunGame(...)
        /home/arseny/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/run.go:236
main.main()
        /home/arseny/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/examples/rotate/main.go:79 +0x145 fp=0xc000143f50 sp=0xc000143ef0 pc=0x6dca25
runtime.main()
        /home/arseny/sdk/go1.23.2/src/runtime/proc.go:272 +0x28b fp=0xc000143fe0 sp=0xc000143f50 pc=0x43f7cb
runtime.goexit({})
        /home/arseny/sdk/go1.23.2/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc000143fe8 sp=0xc000143fe0 pc=0x47aac1

goroutine 2 gp=0xc000006c40 m=nil [force gc (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
        /home/arseny/sdk/go1.23.2/src/runtime/proc.go:424 +0xce fp=0xc00006cfa8 sp=0xc00006cf88 pc=0x4733ce
runtime.goparkunlock(...)
        /home/arseny/sdk/go1.23.2/src/runtime/proc.go:430
runtime.forcegchelper()
        /home/arseny/sdk/go1.23.2/src/runtime/proc.go:337 +0xb3 fp=0xc00006cfe0 sp=0xc00006cfa8 pc=0x43fb13
runtime.goexit({})
        /home/arseny/sdk/go1.23.2/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc00006cfe8 sp=0xc00006cfe0 pc=0x47aac1
created by runtime.init.7 in goroutine 1
        /home/arseny/sdk/go1.23.2/src/runtime/proc.go:325 +0x1a

goroutine 3 gp=0xc000007180 m=nil [GC sweep wait]:
runtime.gopark(0x1?, 0x0?, 0x0?, 0x0?, 0x0?)
        /home/arseny/sdk/go1.23.2/src/runtime/proc.go:424 +0xce fp=0xc00006d780 sp=0xc00006d760 pc=0x4733ce
runtime.goparkunlock(...)
        /home/arseny/sdk/go1.23.2/src/runtime/proc.go:430
runtime.bgsweep(0xc000032080)
        /home/arseny/sdk/go1.23.2/src/runtime/mgcsweep.go:317 +0xdf fp=0xc00006d7c8 sp=0xc00006d780 pc=0x42a73f
runtime.gcenable.gowrap1()
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:203 +0x25 fp=0xc00006d7e0 sp=0xc00006d7c8 pc=0x41ee25
runtime.goexit({})
        /home/arseny/sdk/go1.23.2/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc00006d7e8 sp=0xc00006d7e0 pc=0x47aac1
created by runtime.gcenable in goroutine 1
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:203 +0x66

goroutine 4 gp=0xc000007340 m=nil [GC scavenge wait]:
runtime.gopark(0x10000?, 0x7fa2b8?, 0x0?, 0x0?, 0x0?)
        /home/arseny/sdk/go1.23.2/src/runtime/proc.go:424 +0xce fp=0xc00006df78 sp=0xc00006df58 pc=0x4733ce
runtime.goparkunlock(...)
        /home/arseny/sdk/go1.23.2/src/runtime/proc.go:430
runtime.(*scavengerState).park(0xa67440)
        /home/arseny/sdk/go1.23.2/src/runtime/mgcscavenge.go:425 +0x49 fp=0xc00006dfa8 sp=0xc00006df78 pc=0x428129
runtime.bgscavenge(0xc000032080)
        /home/arseny/sdk/go1.23.2/src/runtime/mgcscavenge.go:658 +0x59 fp=0xc00006dfc8 sp=0xc00006dfa8 pc=0x4286b9
runtime.gcenable.gowrap2()
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:204 +0x25 fp=0xc00006dfe0 sp=0xc00006dfc8 pc=0x41edc5
runtime.goexit({})
        /home/arseny/sdk/go1.23.2/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc00006dfe8 sp=0xc00006dfe0 pc=0x47aac1
created by runtime.gcenable in goroutine 1
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:204 +0xa5

goroutine 5 gp=0xc000007c00 m=nil [finalizer wait]:
runtime.gopark(0xc00006c648?, 0x415365?, 0xb0?, 0x1?, 0xc0000061c0?)
        /home/arseny/sdk/go1.23.2/src/runtime/proc.go:424 +0xce fp=0xc00006c620 sp=0xc00006c600 pc=0x4733ce
runtime.runfinq()
        /home/arseny/sdk/go1.23.2/src/runtime/mfinal.go:193 +0x107 fp=0xc00006c7e0 sp=0xc00006c620 pc=0x41dea7
runtime.goexit({})
        /home/arseny/sdk/go1.23.2/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc00006c7e8 sp=0xc00006c7e0 pc=0x47aac1
created by runtime.createfing in goroutine 1
        /home/arseny/sdk/go1.23.2/src/runtime/mfinal.go:163 +0x3d

goroutine 6 gp=0xc0001a1180 m=nil [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
        /home/arseny/sdk/go1.23.2/src/runtime/proc.go:424 +0xce fp=0xc00006e738 sp=0xc00006e718 pc=0x4733ce
runtime.gcBgMarkWorker(0xc00003c1c0)
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1363 +0xe9 fp=0xc00006e7c8 sp=0xc00006e738 pc=0x421149
runtime.gcBgMarkStartWorkers.gowrap1()
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1279 +0x25 fp=0xc00006e7e0 sp=0xc00006e7c8 pc=0x421025
runtime.goexit({})
        /home/arseny/sdk/go1.23.2/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc00006e7e8 sp=0xc00006e7e0 pc=0x47aac1
created by runtime.gcBgMarkStartWorkers in goroutine 1
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1279 +0x105

goroutine 7 gp=0xc0001a1340 m=nil [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
        /home/arseny/sdk/go1.23.2/src/runtime/proc.go:424 +0xce fp=0xc00006ef38 sp=0xc00006ef18 pc=0x4733ce
runtime.gcBgMarkWorker(0xc00003c1c0)
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1363 +0xe9 fp=0xc00006efc8 sp=0xc00006ef38 pc=0x421149
runtime.gcBgMarkStartWorkers.gowrap1()
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1279 +0x25 fp=0xc00006efe0 sp=0xc00006efc8 pc=0x421025
runtime.goexit({})
        /home/arseny/sdk/go1.23.2/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc00006efe8 sp=0xc00006efe0 pc=0x47aac1
created by runtime.gcBgMarkStartWorkers in goroutine 1
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1279 +0x105

goroutine 8 gp=0xc0001a1500 m=nil [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
        /home/arseny/sdk/go1.23.2/src/runtime/proc.go:424 +0xce fp=0xc00006f738 sp=0xc00006f718 pc=0x4733ce
runtime.gcBgMarkWorker(0xc00003c1c0)
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1363 +0xe9 fp=0xc00006f7c8 sp=0xc00006f738 pc=0x421149
runtime.gcBgMarkStartWorkers.gowrap1()
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1279 +0x25 fp=0xc00006f7e0 sp=0xc00006f7c8 pc=0x421025
runtime.goexit({})
        /home/arseny/sdk/go1.23.2/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc00006f7e8 sp=0xc00006f7e0 pc=0x47aac1
created by runtime.gcBgMarkStartWorkers in goroutine 1
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1279 +0x105

goroutine 18 gp=0xc000104380 m=nil [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
        /home/arseny/sdk/go1.23.2/src/runtime/proc.go:424 +0xce fp=0xc000068738 sp=0xc000068718 pc=0x4733ce
runtime.gcBgMarkWorker(0xc00003c1c0)
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1363 +0xe9 fp=0xc0000687c8 sp=0xc000068738 pc=0x421149
runtime.gcBgMarkStartWorkers.gowrap1()
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1279 +0x25 fp=0xc0000687e0 sp=0xc0000687c8 pc=0x421025
runtime.goexit({})
        /home/arseny/sdk/go1.23.2/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc0000687e8 sp=0xc0000687e0 pc=0x47aac1
created by runtime.gcBgMarkStartWorkers in goroutine 1
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1279 +0x105

goroutine 19 gp=0xc000104540 m=nil [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
        /home/arseny/sdk/go1.23.2/src/runtime/proc.go:424 +0xce fp=0xc000068f38 sp=0xc000068f18 pc=0x4733ce
runtime.gcBgMarkWorker(0xc00003c1c0)
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1363 +0xe9 fp=0xc000068fc8 sp=0xc000068f38 pc=0x421149
runtime.gcBgMarkStartWorkers.gowrap1()
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1279 +0x25 fp=0xc000068fe0 sp=0xc000068fc8 pc=0x421025
runtime.goexit({})
        /home/arseny/sdk/go1.23.2/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc000068fe8 sp=0xc000068fe0 pc=0x47aac1
created by runtime.gcBgMarkStartWorkers in goroutine 1
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1279 +0x105

goroutine 20 gp=0xc000104700 m=nil [GC worker (idle)]:
runtime.gopark(0x1180a3fd20a9?, 0x0?, 0x0?, 0x0?, 0x0?)
        /home/arseny/sdk/go1.23.2/src/runtime/proc.go:424 +0xce fp=0xc000069738 sp=0xc000069718 pc=0x4733ce
runtime.gcBgMarkWorker(0xc00003c1c0)
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1363 +0xe9 fp=0xc0000697c8 sp=0xc000069738 pc=0x421149
runtime.gcBgMarkStartWorkers.gowrap1()
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1279 +0x25 fp=0xc0000697e0 sp=0xc0000697c8 pc=0x421025
runtime.goexit({})
        /home/arseny/sdk/go1.23.2/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc0000697e8 sp=0xc0000697e0 pc=0x47aac1
created by runtime.gcBgMarkStartWorkers in goroutine 1
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1279 +0x105

goroutine 21 gp=0xc0001048c0 m=nil [GC worker (idle)]:
runtime.gopark(0x1180a3fd2081?, 0x0?, 0x0?, 0x0?, 0x0?)
        /home/arseny/sdk/go1.23.2/src/runtime/proc.go:424 +0xce fp=0xc000069f38 sp=0xc000069f18 pc=0x4733ce
runtime.gcBgMarkWorker(0xc00003c1c0)
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1363 +0xe9 fp=0xc000069fc8 sp=0xc000069f38 pc=0x421149
runtime.gcBgMarkStartWorkers.gowrap1()
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1279 +0x25 fp=0xc000069fe0 sp=0xc000069fc8 pc=0x421025
runtime.goexit({})
        /home/arseny/sdk/go1.23.2/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc000069fe8 sp=0xc000069fe0 pc=0x47aac1
created by runtime.gcBgMarkStartWorkers in goroutine 1
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1279 +0x105

goroutine 22 gp=0xc000104a80 m=nil [GC worker (idle)]:
runtime.gopark(0xa95fa0?, 0x1?, 0x3d?, 0xf0?, 0x0?)
        /home/arseny/sdk/go1.23.2/src/runtime/proc.go:424 +0xce fp=0xc00006a738 sp=0xc00006a718 pc=0x4733ce
runtime.gcBgMarkWorker(0xc00003c1c0)
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1363 +0xe9 fp=0xc00006a7c8 sp=0xc00006a738 pc=0x421149
runtime.gcBgMarkStartWorkers.gowrap1()
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1279 +0x25 fp=0xc00006a7e0 sp=0xc00006a7c8 pc=0x421025
runtime.goexit({})
        /home/arseny/sdk/go1.23.2/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc00006a7e8 sp=0xc00006a7e0 pc=0x47aac1
created by runtime.gcBgMarkStartWorkers in goroutine 1
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1279 +0x105

goroutine 23 gp=0xc000104c40 m=nil [GC worker (idle)]:
runtime.gopark(0x1180a3fd229e?, 0x1?, 0x16?, 0x79?, 0x0?)
        /home/arseny/sdk/go1.23.2/src/runtime/proc.go:424 +0xce fp=0xc00006af38 sp=0xc00006af18 pc=0x4733ce
runtime.gcBgMarkWorker(0xc00003c1c0)
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1363 +0xe9 fp=0xc00006afc8 sp=0xc00006af38 pc=0x421149
runtime.gcBgMarkStartWorkers.gowrap1()
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1279 +0x25 fp=0xc00006afe0 sp=0xc00006afc8 pc=0x421025
runtime.goexit({})
        /home/arseny/sdk/go1.23.2/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc00006afe8 sp=0xc00006afe0 pc=0x47aac1
created by runtime.gcBgMarkStartWorkers in goroutine 1
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1279 +0x105

goroutine 24 gp=0xc000104e00 m=nil [GC worker (idle)]:
runtime.gopark(0x1180a3fd2167?, 0x3?, 0x2b?, 0x94?, 0x0?)
        /home/arseny/sdk/go1.23.2/src/runtime/proc.go:424 +0xce fp=0xc00006b738 sp=0xc00006b718 pc=0x4733ce
runtime.gcBgMarkWorker(0xc00003c1c0)
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1363 +0xe9 fp=0xc00006b7c8 sp=0xc00006b738 pc=0x421149
runtime.gcBgMarkStartWorkers.gowrap1()
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1279 +0x25 fp=0xc00006b7e0 sp=0xc00006b7c8 pc=0x421025
runtime.goexit({})
        /home/arseny/sdk/go1.23.2/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc00006b7e8 sp=0xc00006b7e0 pc=0x47aac1
created by runtime.gcBgMarkStartWorkers in goroutine 1
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1279 +0x105

goroutine 25 gp=0xc000104fc0 m=nil [GC worker (idle)]:
runtime.gopark(0x1180a3fbc97b?, 0x3?, 0x35?, 0x2b?, 0x0?)
        /home/arseny/sdk/go1.23.2/src/runtime/proc.go:424 +0xce fp=0xc00006bf38 sp=0xc00006bf18 pc=0x4733ce
runtime.gcBgMarkWorker(0xc00003c1c0)
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1363 +0xe9 fp=0xc00006bfc8 sp=0xc00006bf38 pc=0x421149
runtime.gcBgMarkStartWorkers.gowrap1()
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1279 +0x25 fp=0xc00006bfe0 sp=0xc00006bfc8 pc=0x421025
runtime.goexit({})
        /home/arseny/sdk/go1.23.2/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc00006bfe8 sp=0xc00006bfe0 pc=0x47aac1
created by runtime.gcBgMarkStartWorkers in goroutine 1
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1279 +0x105

goroutine 34 gp=0xc000504000 m=nil [GC worker (idle)]:
runtime.gopark(0x1180a3fbc97b?, 0x3?, 0x99?, 0x20?, 0x0?)
        /home/arseny/sdk/go1.23.2/src/runtime/proc.go:424 +0xce fp=0xc00050a738 sp=0xc00050a718 pc=0x4733ce
runtime.gcBgMarkWorker(0xc00003c1c0)
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1363 +0xe9 fp=0xc00050a7c8 sp=0xc00050a738 pc=0x421149
runtime.gcBgMarkStartWorkers.gowrap1()
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1279 +0x25 fp=0xc00050a7e0 sp=0xc00050a7c8 pc=0x421025
runtime.goexit({})
        /home/arseny/sdk/go1.23.2/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc00050a7e8 sp=0xc00050a7e0 pc=0x47aac1
created by runtime.gcBgMarkStartWorkers in goroutine 1
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1279 +0x105

goroutine 50 gp=0xc000504380 m=nil [chan receive]:
runtime.gopark(0xc000083f60?, 0x643805?, 0xd0?, 0x31?, 0x806d80?)
        /home/arseny/sdk/go1.23.2/src/runtime/proc.go:424 +0xce fp=0xc000083f18 sp=0xc000083ef8 pc=0x4733ce
runtime.chanrecv(0xc00003c690, 0x0, 0x1)
        /home/arseny/sdk/go1.23.2/src/runtime/chan.go:639 +0x41c fp=0xc000083f90 sp=0xc000083f18 pc=0x40ea7c
runtime.chanrecv1(0x0?, 0x0?)
        /home/arseny/sdk/go1.23.2/src/runtime/chan.go:489 +0x12 fp=0xc000083fb8 sp=0xc000083f90 pc=0x40e632
runtime.unique_runtime_registerUniqueMapCleanup.func1(...)
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1732
runtime.unique_runtime_registerUniqueMapCleanup.gowrap1()
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1735 +0x2f fp=0xc000083fe0 sp=0xc000083fb8 pc=0x421e2f
runtime.goexit({})
        /home/arseny/sdk/go1.23.2/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc000083fe8 sp=0xc000083fe0 pc=0x47aac1
created by unique.runtime_registerUniqueMapCleanup in goroutine 1
        /home/arseny/sdk/go1.23.2/src/runtime/mgc.go:1730 +0x96

goroutine 30 gp=0xc000504540 m=nil [select, locked to thread]:
runtime.gopark(0xc0005086e0?, 0x2?, 0x0?, 0x0?, 0xc0005086cc?)
        /home/arseny/sdk/go1.23.2/src/runtime/proc.go:424 +0xce fp=0xc000508568 sp=0xc000508548 pc=0x4733ce
runtime.selectgo(0xc0005086e0, 0xc0005086c8, 0x0?, 0x0, 0x0?, 0x1)
        /home/arseny/sdk/go1.23.2/src/runtime/select.go:335 +0x7a5 fp=0xc000508690 sp=0xc000508568 pc=0x4516a5
github.com/hajimehoshi/ebiten/v2/internal/thread.(*OSThread).Loop(0xc0000251e0, {0x8016e0, 0xc000286370})
        /home/arseny/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/thread/thread.go:59 +0xf6 fp=0xc000508730 sp=0xc000508690 pc=0x5e28b6
github.com/hajimehoshi/ebiten/v2/internal/graphicscommand.LoopRenderThread(...)
        /home/arseny/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/graphicscommand/thread.go:31
github.com/hajimehoshi/ebiten/v2/internal/ui.(*UserInterface).runMultiThread.func1()
        /home/arseny/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/ui/run.go:50 +0x4f fp=0xc000508778 sp=0xc000508730 pc=0x6c57cf
golang.org/x/sync/errgroup.(*Group).Go.func1()
        /home/arseny/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:78 +0x50 fp=0xc0005087e0 sp=0xc000508778 pc=0x5e9d70
runtime.goexit({})
        /home/arseny/sdk/go1.23.2/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc0005087e8 sp=0xc0005087e0 pc=0x47aac1
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 1
        /home/arseny/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:75 +0x96

goroutine 31 gp=0xc000504fc0 m=nil [chan receive]:
runtime.gopark(0x46e53d?, 0xc000221740?, 0x0?, 0x0?, 0xc000508e88?)
        /home/arseny/sdk/go1.23.2/src/runtime/proc.go:424 +0xce fp=0xc000508e38 sp=0xc000508e18 pc=0x4733ce
runtime.chanrecv(0xc00003d340, 0x0, 0x1)
        /home/arseny/sdk/go1.23.2/src/runtime/chan.go:639 +0x41c fp=0xc000508eb0 sp=0xc000508e38 pc=0x40ea7c
runtime.chanrecv1(0x415365?, 0x20?)
        /home/arseny/sdk/go1.23.2/src/runtime/chan.go:489 +0x12 fp=0xc000508ed8 sp=0xc000508eb0 pc=0x40e632
github.com/hajimehoshi/ebiten/v2/internal/thread.(*OSThread).Call(0xc0000251d0, 0x0?)
        /home/arseny/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/thread/thread.go:82 +0x3d fp=0xc000508f08 sp=0xc000508ed8 pc=0x5e2a9d
github.com/hajimehoshi/ebiten/v2/internal/ui.(*UserInterface).runMultiThread.func2()
        /home/arseny/go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/ui/run.go:59 +0xc8 fp=0xc000508f78 sp=0xc000508f08 pc=0x6c55e8
golang.org/x/sync/errgroup.(*Group).Go.func1()
        /home/arseny/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:78 +0x50 fp=0xc000508fe0 sp=0xc000508f78 pc=0x5e9d70
runtime.goexit({})
        /home/arseny/sdk/go1.23.2/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc000508fe8 sp=0xc000508fe0 pc=0x47aac1
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 1
        /home/arseny/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:75 +0x96

rax    0xb
rbx    0x148a3550
rcx    0x70
rdx    0x68
rdi    0x133
rsi    0x0
rbp    0x7ffd8244a080
rsp    0x7ffd8244a068
r8     0x70
r9     0x1
r10    0x4
r11    0x246
r12    0x146e5170
r13    0x148a3510
r14    0x146e5170
r15    0x148a33b0
rip    0x7ff2ac312ba4
rflags 0x10206
cs     0x33
fs     0x0
gs     0x0
exit status 2

Anything else you feel useful to add?

I probably need to give some more details about my environment, but I'm not sure which.

All dependencies are installed via

sudo dnf install mesa-libGL-devel mesa-libGLES-devel libXrandr-devel libXcursor-devel libXinerama-devel libXi-devel libXxf86vm-devel alsa-lib-devel pkg-config

gcc was installed already.

Operating System: Nobara Linux 40
KDE Plasma Version: 6.2.2
KDE Frameworks Version: 6.7.0
Qt Version: 6.7.2
Kernel Version: 6.11.6-200.fsync.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 7600 6-Core Processor
Memory: 30,5 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 4070/PCIe/SSE2
Manufacturer: ASUS
@MonstraG MonstraG added the bug label Nov 3, 2024
@hajimehoshi hajimehoshi added this to the v2.9.0 milestone Nov 3, 2024
@hajimehoshi
Copy link
Owner

hajimehoshi commented Nov 3, 2024

Does a regular GLFW application work?

git clone https://github.com/go-gl/example.git
cd example
go run ./gl21-cube

@MonstraG
Copy link
Author

MonstraG commented Nov 3, 2024

Yes, floating cube does appear, eventually, both gl21 and gl41

OpenGL version 4.1.0 NVIDIA 565.57.01

@MonstraG
Copy link
Author

MonstraG commented Nov 3, 2024

Just checked v2.7.10 - it worked.

A bit of manual bisecting later:

8b0863d32e56 2.8.0  Sep 25 X
eabc6970223e        Sep 21 X
2270359cd490        Sep 17 X
6db3b11b36c7        Aug 25 X
48f79af884f9        Aug 18 X
cdb430b2a51d        Aug 09 X
a5235eea8601        Aug 09 X - broke it for me   
1a0f50503d21        Aug 09 O
9c80367f2f0c        Aug 08 O
13353dc46583        Aug 06 O
6555375b0631        Aug 04 O
faa017252169        Jul 20 O 
a3fa7df1f37a 2.7.10 Sep 14 O

X - crash (same one each time)
O - works

a5235eea8601

Given the contents of the commit, tried switching back to 2.7.10, and running EBITENGINE_OPENGL=es go run . on an example from installation page, that crashed


I know absolutely nothing about this, but I tried to locate libGLESv2 the libs, found that I have them:

...
/usr/lib/libGLESv2.so.2
/usr/lib/libGLESv2.so.2.1.0
/usr/lib/libGLESv2_nvidia.so.2
/usr/lib/libGLESv2_nvidia.so.565.57.01
...

then tried inserting libGLESv2_nvidia.so.2 as the first option:

// Try OpenGL ES first. Some machines like Android and Raspberry Pi might work only with OpenGL ES.
for _, name := range []string{"libGLESv2_nvidia.so.2", "libGLESv2.so", ...

but it crashed anyway.

@hajimehoshi hajimehoshi modified the milestones: v2.9.0, v2.8.4 Nov 4, 2024
@hajimehoshi
Copy link
Owner

Oh I see, so there is an issue somewhere when you use OpenGL ES instead of OpenGL...

@hajimehoshi
Copy link
Owner

Ebitengine requires OpenGL ES 3.0 and above. What is your OpenGL ES version? You can check this by

glxinfo | grep "OpenGL ES"

@MonstraG
Copy link
Author

MonstraG commented Nov 4, 2024

output of glxinfo | grep "OpenGL ES":

OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 565.57.01
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

I also tried v2.9.0-alpha.3.0.20241104053410-c287e7bee6a9 version just now (the one you've commited 11 hrs ago), and that also crashed.

@hajimehoshi
Copy link
Owner

Hmm, let me think more...

@hajimehoshi
Copy link
Owner

Would it be possible to use a debugger and see where the crash happens?

@MonstraG
Copy link
Author

MonstraG commented Nov 4, 2024

Go's debugger or C's? If C - I don't know how (never used C)

I just went back in time to november 2022 (f6f7ed3), the first time EBITENGINE_OPENGL=es was introduced, and that version crashes for me also, so I'm like 99% sure something is wrong with my libs, though what - I have no clue.

@hajimehoshi
Copy link
Owner

Go's debugger or C's? If C - I don't know how (never used C)

I guess gdb should work.

I just went back in time to november 2022 (f6f7ed3), the first time EBITENGINE_OPENGL=es was introduced, and that version crashes for me also, so I'm like 99% sure something is wrong with my libs, though what - I have no clue.

You mean it crashed with EBITENGINE_OPENGL=es, or even without?

@MonstraG
Copy link
Author

MonstraG commented Nov 4, 2024

You mean it crashed with EBITENGINE_OPENGL=es, or even without?

With, running EBITENGINE_OPENGL=es go run .

If I manually edit master version to avoid using ES, then main also works.

Only ES crashes.

@hajimehoshi
Copy link
Owner

hajimehoshi commented Nov 4, 2024

Go's debugger or C's? If C - I don't know how (never used C)

If you are not familiar with debuggers, don't worry. I'll try to think another way

@hajimehoshi
Copy link
Owner

Only ES crashes

Sure, thanks. I might add an option to force non-es gl later.

@MonstraG
Copy link
Author

MonstraG commented Nov 4, 2024

Go's debugger or C's? If C - I don't know how (never used C)

If you are not familiar with debuggers, don't worry.

I'm unfamiliar with debuggers beyond pressing a single button in my IDE)

I wanna try gdb though

@MonstraG
Copy link
Author

MonstraG commented Nov 4, 2024

So I've installed gdb, loaded built project with GOTRACEBACK=crash (i think)
And did

gdb
(gdb) file projectname
(gdb) break _Unwind_RaiseException - because https://stackoverflow.com/a/63081908/11593686 told me so
(gdb) r

and eventually

Thread 1 "awesomeProject" received signal SIGSEGV, Segmentation fault.
Downloading 20.13 K source file /usr/src/debug/glibc-2.39-22.fc40.x86_64/nptl/pthread_mutex_lock.c
___pthread_mutex_lock (mutex=0x133) at pthread_mutex_lock.c:80                                                                   
80        unsigned int type = PTHREAD_MUTEX_TYPE_ELISION (mutex);
Missing debuginfo, try: dnf debuginfo-install nvidia-driver-libs-565.57.01-1.fc40.x86_64
Missing debuginfo, try: dnf debuginfo-install mesa-libgbm-24.2.6-1.fc40.x86_64
Missing debuginfo, try: dnf debuginfo-install mesa-dri-drivers-24.2.6-1.fc40.x86_64
Missing debuginfo, try: dnf debuginfo-install mesa-libglapi-24.2.6-1.fc40.x86_64
Missing debuginfo, try: dnf debuginfo-install mesa-libEGL-24.2.6-1.fc40.x86_64

Though I think this is mostly useless.

@hajimehoshi
Copy link
Owner

Thank you for trying! What about the backtrace bt when crash happens? Probably we would not be able to get a good information though.

@MonstraG
Copy link
Author

MonstraG commented Nov 5, 2024

Now with backtrace:

Thread 1 "awesomeProject" received signal SIGSEGV, Segmentation fault.
___pthread_mutex_lock (mutex=0x133) at pthread_mutex_lock.c:80
80        unsigned int type = PTHREAD_MUTEX_TYPE_ELISION (mutex);
Missing debuginfo, try: dnf debuginfo-install nvidia-driver-libs-565.57.01-1.fc40.x86_64
Missing debuginfo, try: dnf debuginfo-install mesa-libgbm-24.2.6-1.fc40.x86_64
Missing debuginfo, try: dnf debuginfo-install mesa-dri-drivers-24.2.6-1.fc40.x86_64
Missing debuginfo, try: dnf debuginfo-install mesa-libglapi-24.2.6-1.fc40.x86_64
Missing debuginfo, try: dnf debuginfo-install mesa-libEGL-24.2.6-1.fc40.x86_64
(gdb) bt
#0  ___pthread_mutex_lock (mutex=0x133) at pthread_mutex_lock.c:80
#1  0x00007fffb03af726 in wl_proxy_create_wrapper (proxy=proxy@entry=0xcfe120) at ../src/wayland-client.c:2553
#2  0x00007fffb05645f5 in getServerProtocolsInfo (nativeDpy=0xcfe120, protocols=0x7fffffffcd00) at ../src/wayland-egldisplay.c:803
#3  wlEglGetPlatformDisplayExport (data=0xd282f0, platform=<optimized out>, nativeDpy=<optimized out>, attribs=<optimized out>) at ../src/wayland-egldisplay.c:1034
#4  0x00007fffa12afee0 in ?? () from /lib64/libEGL_nvidia.so.0
#5  0x00007fffa124d34c in ?? () from /lib64/libEGL_nvidia.so.0
#6  0x00007fffb0574f6d in GetPlatformDisplayCommon (platform=12760, native_display=0xcfe120, attrib_list=0x0, funcName=0x7fffb057b271 "eglGetDisplay") at /usr/src/debug/libglvnd-1.7.0-4.fc40.x86_64/src/EGL/libegl.c:324
#7  0x000000000090dea4 in _glfwInitEGL () at egl_context_unix.c:409
#8  0x000000000091b79d in _glfwPlatformCreateWindow (window=window@entry=0xd2eed0, wndconfig=wndconfig@entry=0x7fffffffd120, ctxconfig=ctxconfig@entry=0x7fffffffd090, fbconfig=fbconfig@entry=0x7fffffffd0d0) at x11_window_linbsd.c:2054
#9  0x0000000000913991 in glfwCreateWindow (width=640, height=480, title=<optimized out>, monitor=0x0, share=<optimized out>) at window_unix.c:197
#10 0x000000000090bf45 in _cgo_a285ce6978e6_Cfunc_glfwCreateWindow (v=0xc0004553d0) at /tmp/go-build/cgo-gcc-prolog:58
#11 0x0000000000483764 in runtime.asmcgocall () at /usr/local/go/src/runtime/asm_amd64.s:923
#12 0x000000c0000061c0 in ?? ()
#13 0x0000000000cc6aa0 in github.com/hajimehoshi/ebiten/v2/internal/builtinshader[shaders] ()
#14 0x000000000048761f in runtime.newproc (fn=0xc000158d00) at <autogenerated>:1
#15 0x0000000000cc6aa0 in github.com/hajimehoshi/ebiten/v2/internal/builtinshader[shaders] ()
#16 0x000000c000158d00 in ?? ()
#17 0x0000000000481a25 in runtime.mstart () at /usr/local/go/src/runtime/asm_amd64.s:395
--Type <RET> for more, q to quit, c to continue without paging--
#18 0x00000000004819af in runtime.rt0_go () at /usr/local/go/src/runtime/asm_amd64.s:358
#19 0x00007fff00000001 in ?? ()
#20 0x00007fffffffd658 in ?? ()
#21 0x0000000000000001 in ?? ()
#22 0x0000000000000001 in ?? ()
#23 0x00007fffffffd658 in ?? ()
#24 0x00007ffff7b61088 in __libc_start_call_main (main=0x47cd79 <runtime.exitsyscall+409>, argc=3, argv=0x0) at ../sysdeps/nptl/libc_start_call_main.h:58
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

It partially matches gnif/LookingGlass#112 (comment), which I found just by googling for wl_proxy_create_wrapper

@hajimehoshi
Copy link
Owner

hajimehoshi commented Nov 5, 2024

Thanks! There might be a hint around EGL.

See also: #292 (comment)

@hajimehoshi
Copy link
Owner

Graphics Platform: Wayland

Aha, Wayland is actually not tested well.

@hajimehoshi
Copy link
Owner

hajimehoshi commented Nov 5, 2024

glfw/glfw#2536 also seems a similar issue, but probably different.

@hajimehoshi
Copy link
Owner

hajimehoshi commented Nov 5, 2024

@MonstraG Could you try

glxinfo | grep GLX_EXT_create_context_es2_profile

? If this extension exists, we can use GLX instead of EGL and we can fix this by doing so.

@MonstraG
Copy link
Author

MonstraG commented Nov 5, 2024

glxinfo | grep GLX_EXT_create_context_es2_profile
    GLX_EXT_create_context_es2_profile, GLX_EXT_create_context_es_profile, 
    GLX_EXT_create_context_es2_profile, GLX_EXT_create_context_es_profile, 
    GLX_EXT_create_context_es2_profile, GLX_EXT_create_context_es_profile, 

@hajimehoshi
Copy link
Owner

Thanks. I'll try to fix this tomorrow.

hajimehoshi added a commit that referenced this issue Nov 6, 2024
Use GLX when possible. EGL with an X window might not work well on
Wayland unfortunately.

Updates #3152
@hajimehoshi
Copy link
Owner

hajimehoshi commented Nov 6, 2024

@MonstraG Could you try ce46f9f? Thanks,

hajimehoshi added a commit that referenced this issue Nov 6, 2024
Use GLX when possible. EGL with an X window might not work well on
Wayland unfortunately.

Updates #3152
@MonstraG
Copy link
Author

MonstraG commented Nov 6, 2024

Woohoo, "Hello, World!" was finally rendered on my screen!

Let's just hope it won't break in anyone else's environment.

@hajimehoshi
Copy link
Owner

Thank you for confirming!

Let's just hope it won't break in anyone else's environment.

I believe this is a relatively safe change. I'll cherry-pick to 0.8.

hajimehoshi added a commit that referenced this issue Nov 6, 2024
Use GLX when possible. EGL with an X window might not work well on
Wayland unfortunately.

Closes #3152
@hajimehoshi hajimehoshi changed the title segmentation violation in cgocall.go:167 internal/graphicsdriver/opengl/gl: Wayland + EGL causes crash Nov 9, 2024
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