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

"Extension string retrieval is broken" when trying to run generated project with JDK 21 on linux #7308

Open
1 of 6 tasks
krzyk opened this issue Dec 27, 2023 · 6 comments
Open
1 of 6 tasks
Labels
bug LWJGL3 need more info needs more info. Likely to be closed when no reaction given.

Comments

@krzyk
Copy link

krzyk commented Dec 27, 2023

Please ensure you have given all the following requested information in your report.

Issue details

I generated project from https://libgdx.com/wiki/start/project-generation, selected only desktop and no extensions.
After project was generated it didn't build at first (because core has source set to 1.7, which is not supported by JDK 21) - I set both core and desktop modules to 21 source level.

After that I did ./gradlew desktop:run and got following errors:

[LWJGL] GLFW_PLATFORM_ERROR error
        Description : Extension string retrieval is broken
        Stacktrace  :
                org.lwjgl.glfw.GLFW.nglfwCreateWindow(GLFW.java:2058)
                org.lwjgl.glfw.GLFW.glfwCreateWindow(GLFW.java:2229)
                com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.createGlfwWindow(Lwjgl3Application.java:527)
                com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.createWindow(Lwjgl3Application.java:463)
                com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.createWindow(Lwjgl3Application.java:449)
                com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:163)
                com.mygdx.game.DesktopLauncher.main(DesktopLauncher.java:13)
[LWJGL] GLFW_PLATFORM_ERROR error
        Description : Extension string retrieval is broken
        Stacktrace  :
                org.lwjgl.glfw.GLFW.nglfwCreateWindow(GLFW.java:2058)
                org.lwjgl.glfw.GLFW.glfwCreateWindow(GLFW.java:2229)
                com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.createGlfwWindow(Lwjgl3Application.java:527)
                com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.createWindow(Lwjgl3Application.java:463)
                com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.createWindow(Lwjgl3Application.java:449)
                com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:163)
                com.mygdx.game.DesktopLauncher.main(DesktopLauncher.java:13)
[LWJGL] GLFW_PLATFORM_ERROR error
        Description : Extension string retrieval is broken
        Stacktrace  :
                org.lwjgl.glfw.GLFW.nglfwCreateWindow(GLFW.java:2058)
                org.lwjgl.glfw.GLFW.glfwCreateWindow(GLFW.java:2229)
                com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.createGlfwWindow(Lwjgl3Application.java:527)
                com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.createWindow(Lwjgl3Application.java:463)
                com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.createWindow(Lwjgl3Application.java:449)
                com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:163)
                com.mygdx.game.DesktopLauncher.main(DesktopLauncher.java:13)
Exception in thread "main" java.lang.NullPointerException
        at org.lwjgl.system.Checks.check(Checks.java:188)
        at org.lwjgl.system.MemoryUtil.memLengthNT1(MemoryUtil.java:2406)
        at org.lwjgl.system.MemoryUtil.memASCII(MemoryUtil.java:2673)
        at org.lwjgl.opengl.GL.createCapabilities(GL.java:442)
        at org.lwjgl.opengl.GL.createCapabilities(GL.java:311)
        at org.lwjgl.opengl.GL.createCapabilities(GL.java:295)
        at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.createGlfwWindow(Lwjgl3Application.java:572)
        at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.createWindow(Lwjgl3Application.java:463)
        at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.createWindow(Lwjgl3Application.java:449)
        at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.createWindow(Lwjgl3Application.java:449)
        at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:163)
        at com.mygdx.game.DesktopLauncher.main(DesktopLauncher.java:13)

Reproduction steps/code

This is uploaded code (generated from the official web page with only desktop mode and changed build.gradle in core and desktop to have source code level set to 21) - https://github.com/krzyk/libgdx-test

Linux, with Xorg, iGPU with unused nvidia GPU (everything runs on intel one).
Maybe there is issue with selecting the correct GPU?
Other applications that use OpenGL/Vulcan are working fine (e.g steam games).

I also tried the maven setup, which after I migrated to lwjgl3 gave exactly the same error/stacktraces (with the default lwjgl2 it breaks in missing native link).

Version of libGDX and/or relevant dependencies

1.12.1

Stacktrace

                org.lwjgl.glfw.GLFW.nglfwCreateWindow(GLFW.java:2058)
                org.lwjgl.glfw.GLFW.glfwCreateWindow(GLFW.java:2229)
                com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.createGlfwWindow(Lwjgl3Application.java:527)
                com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.createWindow(Lwjgl3Application.java:463)
                com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.createWindow(Lwjgl3Application.java:449)
                com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:163)
                com.mygdx.game.DesktopLauncher.main(DesktopLauncher.java:13)
Exception in thread "main" java.lang.NullPointerException
        at org.lwjgl.system.Checks.check(Checks.java:188)
        at org.lwjgl.system.MemoryUtil.memLengthNT1(MemoryUtil.java:2406)
        at org.lwjgl.system.MemoryUtil.memASCII(MemoryUtil.java:2673)
        at org.lwjgl.opengl.GL.createCapabilities(GL.java:442)
        at org.lwjgl.opengl.GL.createCapabilities(GL.java:311)
        at org.lwjgl.opengl.GL.createCapabilities(GL.java:295)
        at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.createGlfwWindow(Lwjgl3Application.java:572)
        at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.createWindow(Lwjgl3Application.java:463)
        at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.createWindow(Lwjgl3Application.java:449)
        at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.createWindow(Lwjgl3Application.java:449)
        at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:163)
        at com.mygdx.game.DesktopLauncher.main(DesktopLauncher.java:13)

Please select the affected platforms

  • Android
  • iOS
  • HTML/GWT
  • Windows
  • Linux
  • macOS
@tommyettinger
Copy link
Member

This looks to me like an Intel driver issue. This is more common on older Windows installations, but can happen on if your integrated graphics are either too old hardware-wise to support some common OpenGL feature, or they use newer hardware that hasn't had the drivers updated and so is using some barebones driver meant to work even on extremely old devices. I'm guessing other graphical applications are using the Nvidia GPU, and I'm not sure if Java has any way of suggesting to a Linux OS that it should run on the discrete GPU, if one is available. I don't know what distro/version you're using, nor your CPU/GPU versions. This is probably going to take some googling for your specific hardware situation -- but if you use Linux, you're probably used to that by now. My only Linux machine just had its battery nearly explode, so I can't do anything to reproduce right now.

@krzyk
Copy link
Author

krzyk commented Dec 28, 2023

No, other apps don't use nvidia (I don't have drivers for it installed at all) - I'm using purely Intel.
Quite new kernel (6.6.8) and mesa+intel drivers compiled from sources a week or two ago.

Intel CPU is not that old (11th Gen Intel(R) Core(TM) i7-11850H).

As for distro: Ubuntu 20.04, but as I mentioned I keep kernel and graphics drivers up to date on my own.

I didn't notice such issues in any other apps, so I was quite surprised.

Googling unfortunately doesn't bring any useful data (almost nothing is there) :(

I tried OpenJDK build from both Oracle and Temurin, both give the same results.

vainfo output:

libva info: VA-API version 1.21.0
libva info: User environment variable requested driver 'iHD'
libva info: Trying to open /usr/local/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_21
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.21 (libva 2.6.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 23.4.3 (32841e3dc)

@krzyk
Copy link
Author

krzyk commented Dec 28, 2023

I did some tests and the app works on libgdx 1.11.0 and is broken on 1.12.0 and 1.12.1 (with the error above).

I'll try to bisect to find the commit that broke it (hopefully I'll be able to build libgdx).

@crykn crykn added bug need more info needs more info. Likely to be closed when no reaction given. LWJGL3 labels Dec 28, 2023
@crykn
Copy link
Member

crykn commented Dec 28, 2023

IMO the most likely culprits are the LWJGL 3 updates in 1.12.0 and 1.12.1. Instructions for building libGDX locally can be found here.

@krzyk
Copy link
Author

krzyk commented Dec 28, 2023

I'm curious, is there a way to build just the desktop part of libgdx?
Version 1.11.x allowed to build without the Android SDK, but in 1.12 it is required to provide the SDK location
It is a PITA to download that SDK (considering that now it is a bit hard to download just that, AFAIR one has to download Android Studio) if I do just the desktop part.

@krzyk
Copy link
Author

krzyk commented Dec 28, 2023

Nevermind, went with Android Studio.

So the commit that broke the example app is b23419c

Which is just a library update, I probably should take it to lwjgl3, but I have zero knowledge how it is used, so I'm not sure I can give a good bug report there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug LWJGL3 need more info needs more info. Likely to be closed when no reaction given.
Projects
None yet
Development

No branches or pull requests

3 participants