LWJGL / lwjgl3

LWJGL is a Java library that enables cross-platform access to popular native APIs useful in the development of graphics (OpenGL, Vulkan, bgfx), audio (OpenAL, Opus), parallel computing (OpenCL, CUDA) and XR (OpenVR, LibOVR, OpenXR) applications.
https://www.lwjgl.org
BSD 3-Clause "New" or "Revised" License
4.67k stars 628 forks source link

"Invalid value for parameter" error in the latest snapshot build #837

Closed Ali-RS closed 1 year ago

Ali-RS commented 1 year ago

Version

3.3.2 (nightly)

Platform

Linux x64

JDK

Adoptium OpenJDK 19

Module

LWJGL Core, GLFW

Bug description

Hi,

After upgrading to LWJGL 3.3.2-snapshot+8 I am getting this error when running my project. I am using jMonkeyEngine.

It works fine in the LWJGL 3.3.2-snapshot+7 and older versions.

Stacktrace or crash log output

18:02:50,890 ERROR [LegacyApplication] Invalid value for parameter
java.lang.Exception: Invalid value for parameter
    at com.jme3.system.lwjgl.LwjglWindow$1.invoke(LwjglWindow.java:229) [jme3-lwjgl3-3.6.0-SNAPSHOT.jar:3.6.0-SNAPSHOT]
    at org.lwjgl.glfw.GLFWErrorCallbackI.callback(GLFWErrorCallbackI.java:43) [lwjgl-glfw-3.3.2-SNAPSHOT.jar:build 8]
    at org.lwjgl.system.JNI.invokeI(Native Method) ~[lwjgl-3.3.2-SNAPSHOT.jar:build 8]
    at org.lwjgl.glfw.GLFW.glfwInit(GLFW.java:1071) [lwjgl-glfw-3.3.2-SNAPSHOT.jar:build 8]
    at com.jme3.system.lwjgl.LwjglWindow.createContext(LwjglWindow.java:233) [jme3-lwjgl3-3.6.0-SNAPSHOT.jar:3.6.0-SNAPSHOT]
    at com.jme3.system.lwjgl.LwjglWindow.initInThread(LwjglWindow.java:582) [jme3-lwjgl3-3.6.0-SNAPSHOT.jar:3.6.0-SNAPSHOT]
    at com.jme3.system.lwjgl.LwjglWindow.run(LwjglWindow.java:704) [jme3-lwjgl3-3.6.0-SNAPSHOT.jar:3.6.0-SNAPSHOT]
    at java.lang.Thread.run(Thread.java:1589) [?:?]
18:02:52,590 INFO  [LwjglContext] LWJGL 3.3.2-snapshot+8 context running on thread jME3 Main
 * Graphics Adapter: GLFW 3.4.0 Wayland X11 GLX Null EGL OSMesa monotonic shared
18:02:53,022 INFO  [GLRenderer] OpenGL Renderer Information
 * Vendor: X.Org
 * Renderer: AMD CEDAR (DRM 2.50.0 / 5.4.0-58-generic, LLVM 10.0.0)
 * OpenGL Version: 3.3 (Core Profile) Mesa 20.0.8
 * GLSL Version: 3.30
 * Profile: Core
Ali-RS commented 1 year ago

I switched JME implementation of GLFWErrorCallback with GLFWErrorCallback.createPrint() to see if I can get a more useful error log. Now the app does not stop and continues to run and here is the error log printed to the output:

[LWJGL] GLFW_INVALID_VALUE error
    Description : Invalid value for parameter
    Stacktrace  :
        org.lwjgl.glfw.GLFW.glfwInit(GLFW.java:1071)
        com.jme3.system.lwjgl.LwjglWindow.createContext(LwjglWindow.java:228)
        com.jme3.system.lwjgl.LwjglWindow.initInThread(LwjglWindow.java:577)
        com.jme3.system.lwjgl.LwjglWindow.run(LwjglWindow.java:699)
        java.base/java.lang.Thread.run(Thread.java:1589)

But what does it mean? which parameter does it refer to?

Spasi commented 1 year ago

Hey @Ali-RS,

This error is reporting a bad controller mapping entry. It is harmless, the entry is simply skipped and you can safely ignore the error.

This is supposed to never happen in GLFW, it was my mistake when I updated to the latest SDL_GameControllerDB version. It will go away in the next snapshot. If it can't wait, this fresh GLFW build is fixed.

Ali-RS commented 1 year ago

Ok, thanks @Spasi

Spasi commented 1 year ago

Hey @Ali-RS,

LWJGL 3.3.2-snapshot+9 is now available and this error should be gone. Also updated to latest SDL_GameControllerDB.

Ali-RS commented 1 year ago

Great, thank you so much @Spasi