go-gl / glfw

Go bindings for GLFW 3
BSD 3-Clause "New" or "Revised" License
1.56k stars 182 forks source link

Uncaught error when connecting Bluetooth controllers #292

Open shavs opened 4 years ago

shavs commented 4 years ago

In Ludo, there's a breaking exception that's thrown from glfw when connecting a Bluetooth controller:

GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
GLFW: An uncaught error has occurred: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)
GLFW: Please report this bug in the Go package immediately.
panic: InvalidValue: Invalid button in gamepad mapping 050000005e040000fd02000003090000 (Xbox One Wireless Controller)

goroutine 1 [running, locked to thread]:
github.com/go-gl/glfw/v3.3/glfw.acceptError(0xc000107e60, 0x1, 0x1, 0x85ed00, 0x0)
    /home/travis/gopath/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20200222043503-6f7a984d4dc4/error.go:174 +0x216
github.com/go-gl/glfw/v3.3/glfw.Init(0xc0000ae6c0, 0xc0000901b0)
    /home/travis/gopath/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20200222043503-6f7a984d4dc4/glfw.go:37 +0x4e
main.main()
    /home/travis/gopath/src/github.com/libretro/ludo/main.go:85 +0x2f4

This is directly tied to libretro/ludo/issues/342

This has been confirmed with two 8BitDo controllers (the Lite and the SN30 Pro in X-Input mode) and an Xbox One Bluetooth controller.

Additionally, it seems to be specific to version 3.3, according to the original issue (342, linked above).

dmitshur commented 4 years ago

Thanks for reporting this.

According to GLFW's current documentation, glfwInit() shouldn't be returning GLFW_INVALID_VALUE type of error, yet it seems to be in this case, causing glfw to panic.

I've reported this at https://github.com/glfw/glfw/issues/1763 to better understand where the problem is. Once we know where the problem is, we'll know the next steps for fixing this.

pwaller commented 3 years ago

See also #274 which is a possible dupe. I note that glfw/glfw#1763 is being worked on upstream. I'm leaving this one open for now since there is some extra discourse here.