Skip to content

Null pointer with FFIClosure, using hashmap-based ClosureRegistry. #720

@theorzr

Description

@theorzr

Version

3.3.0 (nightly)

Platform

Linux arm32

JDK

OpenJDK 17.0.1 2021-10-19 LTS

Module

Core, GLFW

Bug description

This issue is related to Minecraft, I'm trying to run it on my RPi 400, which run on Debian, ARMv7 (32 bits). I got the correct shared objects in the directory specified by java.library.path (note that natives artifacts are not added to the classpath, it would be redundant), here is a screenshot of this directory:
bin_content

When starting the game, it crashes because of a NullPointerException (full crash report à the end of the issue):

java.lang.NullPointerException: Cannot invoke "org.lwjgl.system.libffi.FFIClosure.user_data()" because the return value of "org.lwjgl.system.Callback$ClosureRegistry.get(long)" is null
	at org.lwjgl.system.Callback.get(Callback.java:190)
	at org.lwjgl.glfw.GLFWErrorCallback.create(GLFWErrorCallback.java:40)
	at org.lwjgl.glfw.GLFWErrorCallback.createSafe(GLFWErrorCallback.java:49)
	at org.lwjgl.glfw.GLFW.glfwSetErrorCallback(GLFW.java:1288)
	at com.mojang.blaze3d.platform.GLX._setGlfwErrorCallback(SourceFile:83)
	at com.mojang.blaze3d.systems.RenderSystem.setErrorCallback(SourceFile:815)
	at com.mojang.blaze3d.platform.GLX._initGlfw(SourceFile:77)
	at com.mojang.blaze3d.systems.RenderSystem.initBackendSystem(SourceFile:804)
	at dxo.<init>(SourceFile:473)
	at net.minecraft.client.main.Main.main(SourceFile:199)

I've tested with LWJGL 3.2.3, which is the first version to come with pre-compiled ARM32 shared objects, and it works, so I supposed that it doesn't come from Minecraft, but rather from LWJGL.

If you are interested, I also captured the output with -Dorg.lwjgl.util.Debug=true and -Dorg.lwjgl.util.DebugAllocator=true (I stripped useless Minecraft outputs): lwjgl_with_debug.txt

Stacktrace or crash log output

---- Minecraft Crash Report ----
// I bet Cylons wouldn't have this problem.

Time: 22/01/2022 14:24
Description: Initializing game

java.lang.NullPointerException: Cannot invoke "org.lwjgl.system.libffi.FFIClosure.user_data()" because the return value of "org.lwjgl.system.Callback$ClosureRegistry.get(long)" is null
	at org.lwjgl.system.Callback.get(Callback.java:190)
	at org.lwjgl.glfw.GLFWErrorCallback.create(GLFWErrorCallback.java:40)
	at org.lwjgl.glfw.GLFWErrorCallback.createSafe(GLFWErrorCallback.java:49)
	at org.lwjgl.glfw.GLFW.glfwSetErrorCallback(GLFW.java:1288)
	at com.mojang.blaze3d.platform.GLX._setGlfwErrorCallback(SourceFile:83)
	at com.mojang.blaze3d.systems.RenderSystem.setErrorCallback(SourceFile:815)
	at com.mojang.blaze3d.platform.GLX._initGlfw(SourceFile:77)
	at com.mojang.blaze3d.systems.RenderSystem.initBackendSystem(SourceFile:804)
	at dxo.<init>(SourceFile:473)
	at net.minecraft.client.main.Main.main(SourceFile:199)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Render thread
Stacktrace:
	at org.lwjgl.system.Callback.get(Callback.java:190)
	at org.lwjgl.glfw.GLFWErrorCallback.create(GLFWErrorCallback.java:40)
	at org.lwjgl.glfw.GLFWErrorCallback.createSafe(GLFWErrorCallback.java:49)
	at org.lwjgl.glfw.GLFW.glfwSetErrorCallback(GLFW.java:1288)
	at com.mojang.blaze3d.platform.GLX._setGlfwErrorCallback(SourceFile:83)
	at com.mojang.blaze3d.systems.RenderSystem.setErrorCallback(SourceFile:815)
	at com.mojang.blaze3d.platform.GLX._initGlfw(SourceFile:77)
	at com.mojang.blaze3d.systems.RenderSystem.initBackendSystem(SourceFile:804)
	at dxo.<init>(SourceFile:473)

-- Initialization --
Details:
	Modules: 
Stacktrace:
	at net.minecraft.client.main.Main.main(SourceFile:199)

-- System Details --
Details:
	Minecraft Version: 1.18.1
	Minecraft Version ID: 1.18.1
	Operating System: Linux (arm) version 5.10.63-v7l+
	Java Version: 17.0.1, BellSoft
	Java VM Version: OpenJDK Server VM (mixed mode), BellSoft
	Memory: 273853400 bytes (261 MiB) / 536870912 bytes (512 MiB) up to 2147483648 bytes (2048 MiB)
	CPUs: 4
	Processor Vendor: armv7l
	Processor Name: ARMv7 Processor rev 3 (v7l)
	Identifier: armv7l Family 7 Model 0xd08 Stepping r0x0p3
	Microarchitecture: unknown
	Frequency (GHz): -0,00
	Number of physical packages: 1
	Number of physical CPUs: 1
	Number of logical CPUs: 4
	Graphics card #0 name: unknown
	Graphics card #0 vendor: unknown
	Graphics card #0 VRAM (MB): 0,00
	Graphics card #0 deviceId: unknown
	Graphics card #0 versionInfo: unknown
	Virtual memory max (MB): 2019,36
	Virtual memory used (MB): 1219,34
	Swap memory total (MB): 100,00
	Swap memory used (MB): 0,00
	JVM Flags: 7 total; -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
	Launched Version: 1.18.1
	Backend library: LWJGL version 3.3.0 build 21
	Backend API: Unknown
	Window size: <not initialized>
	GL Caps: Using framebuffer using OpenGL 3.2
	GL debug messages: <disabled>
	Using VBOs: Yes
	Is Modded: Probably not. Client jar signature and brand is untouched
	Type: Client (map_client.txt)
	CPU: <unknown>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions