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

Crash on glfwCreateWindow #958

Closed AceKiron closed 5 months ago

AceKiron commented 5 months ago

Version

3.3.3

Platform

Windows x64

JDK

I think it's Oracle's JDK 18.0.2.1, not 100% about the name though.

Module

GLFW

Bug description

Everything compiles normally, but when I run GLFW.glfwCreateWindow(size.getX(), size.getY(), title, MemoryUtil.NULL, MemoryUtil.NULL); it crashes. size.getX() and size.getY() both return ints and title is a String.

Stacktrace or crash log output

Uploaded it to https://hastebin.com/share/utapihasoy.yaml as pasting it here wouldn't let me submit the issue.
AceKiron commented 5 months ago

Figured out the JDK, it is indeed Oracle's JDK 18.0.2.1. As for reproduction, even the example provided in https://www.lwjgl.org/guide doesn't seem to work.

AceKiron commented 5 months ago

The same problem persists on other JDKs, such as Azul Zulu Community(TM) versions 21.0.2 and 11.0.20 or Oracle OpenJDK version 21.0.2.

octylFractal commented 5 months ago

Are you sure your title is non-null?

Otherwise, it looks like a graphics card driver bug, similar to e.g. https://forums.minecraftforge.net/topic/123610-119-forge-crashes-when-opened-with-exit-code-1/.

AceKiron commented 5 months ago

Are you sure your title is non-null?

Otherwise, it looks like a graphics card driver bug, similar to e.g. https://forums.minecraftforge.net/topic/123610-119-forge-crashes-when-opened-with-exit-code-1/.

I am sure, and my graphics drivers are up to date. However, it seems downgrading LWJGL to 3.1.1 fixed it for now.

TheMrMilchmann commented 5 months ago

The crash is inside AMDs graphics driver, similar to https://github.com/LWJGL/lwjgl3/issues/953. A faulty installation or a buggy driver usually causes this. However, I am a bit surprised to hear that this can be fixed by switching to an older LWJGL version. Since Minecraft uses 3.3.2 and the issue trackers have not been flooded with users facing the same issue, this might be a fix in GLFW triggering an odd driver bug.

Anyway, I suggest performing a clean install of your graphics driver to see if this changes anything. The go-to approach for this for AMD seems to be using the AMD Cleanup Utility tool. Unfortunately, I cannot assist you with that as I do not own relevant AMD hardware.