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

LWJGL 3.3.4+7 HelloWorld crash on exit, Linux x64 Wayland client, Ubuntu 22.04. #1011

Open
SorenPoulsen opened this issue Oct 19, 2024 · 1 comment

Comments

@SorenPoulsen
Copy link

SorenPoulsen commented Oct 19, 2024

Version

3.3.4

Platform

Linux x64

JDK

OpenJDK Temurin-17.0.5+8 (17.0.5+8)

Module

LWJGL core

Bug description

HelloWorld sample from https://www.lwjgl.org/guide

Sample works fine except the JVM core dumps after the app exits.

This error is found in the JVM exception trace:
java/lang/NoSuchMethodError

Inspected all the free* destroy* terminate* calls, they return fine. The crash happens after control is returned from the app to the JVM.
The HelloWorld was created with the customize function to only include a minimal set of libs:

<properties>
    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <lwjgl.version>3.3.4</lwjgl.version>
    <lwjgl.natives>natives-linux</lwjgl.natives>
</properties>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.lwjgl</groupId>
            <artifactId>lwjgl-bom</artifactId>
            <version>${lwjgl.version}</version>
            <scope>import</scope>
            <type>pom</type>
        </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>
    <dependency>
        <groupId>org.lwjgl</groupId>
        <artifactId>lwjgl</artifactId>
    </dependency>
    <dependency>
        <groupId>org.lwjgl</groupId>
        <artifactId>lwjgl-egl</artifactId>
    </dependency>
    <dependency>
        <groupId>org.lwjgl</groupId>
        <artifactId>lwjgl-glfw</artifactId>
    </dependency>
    <dependency>
        <groupId>org.lwjgl</groupId>
        <artifactId>lwjgl-opengl</artifactId>
    </dependency>
    <dependency>
        <groupId>org.lwjgl</groupId>
        <artifactId>lwjgl</artifactId>
        <classifier>${lwjgl.natives}</classifier>
    </dependency>
    <dependency>
        <groupId>org.lwjgl</groupId>
        <artifactId>lwjgl-glfw</artifactId>
        <classifier>${lwjgl.natives}</classifier>
    </dependency>
    <dependency>
        <groupId>org.lwjgl</groupId>
        <artifactId>lwjgl-opengl</artifactId>
        <classifier>${lwjgl.natives}</classifier>
    </dependency>
</dependencies>

Stacktrace or crash log output

LWJGL DEBUG log followed by JVM SIGSEGV log

[LWJGL] Version: 3.3.4+7
	 OS: Linux v6.8.0-47-generic
	JRE: Linux amd64 17.0.5
	JVM: OpenJDK 64-Bit Server VM v17.0.5+8 by Eclipse Adoptium
[LWJGL] Loading JNI library: lwjgl
	Module: org.lwjgl
	Loaded from org.lwjgl.librarypath: /tmp/lwjgl_stp/3.3.4+7/x64/liblwjgl.so
[LWJGL] Java 9 check intrinsics enabled
[LWJGL] Closure Registry: ConcurrentHashMap
[LWJGL] Warning: Failed to instantiate memory allocator: org.lwjgl.system.jemalloc.JEmallocAllocator. Using the system default.
[LWJGL] MemoryUtil allocator: StdlibAllocator
[LWJGL] Loading library: glfw
	Module: org.lwjgl.glfw
	Loaded from org.lwjgl.librarypath: /tmp/lwjgl_stp/3.3.4+7/x64/libglfw.so
[LWJGL] Loading JNI library: lwjgl_opengl
	Module: org.lwjgl.opengl
	Loaded from org.lwjgl.librarypath: /tmp/lwjgl_stp/3.3.4+7/x64/liblwjgl_opengl.so
[LWJGL] Loading library: libGLX.so.0
	Module: org.lwjgl.opengl
	libGLX.so.0 not found in org.lwjgl.librarypath=/tmp/lwjgl_stp/3.3.4+7/x64
[LWJGL] Java 9 text decoding enabled
	Loaded from system paths: /lib/x86_64-linux-gnu/libGLX.so.0
[LWJGL] Java 10 multiplyHigh enabled
[LWJGL] [GL] Using OpenGL 4.3 for error logging.




#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007e2c20223d30, pid=8126, tid=8127
#
# JRE version: OpenJDK Runtime Environment Temurin-17.0.5+8 (17.0.5+8) (build 17.0.5+8)
# Java VM: OpenJDK 64-Bit Server VM Temurin-17.0.5+8 (17.0.5+8, mixed mode, sharing, tiered, compressed oops, compressed class ptrs
, g1 gc, linux-amd64)
# Problematic frame:
# C  0x00007e2c20223d30
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P 
-u%u -g%g -- %E" (or dumping to /home/xyz/lwjgl-test/core.8126)
#
# If you would like to submit a bug report, please visit:
#   https://github.com/adoptium/adoptium-support/issues
#

---------------  S U M M A R Y ------------

Command Line: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:60781,suspend=y,server=n -javaagent:/home/xyz/idea-IU-232.9921.4
7/plugins/java/lib/rt/debugger-agent.jar -Dkotlinx.coroutines.debug.enable.creation.stack.trace=false -Ddebugger.agent.enable.corou
tines=true -Dfile.encoding=UTF-8 org.example.Main

Host: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz, 8 cores, 15G, Ubuntu 22.04.5 LTS
Time: Sat Oct 19 20:33:51 2024 CEST elapsed time: 58.108037 seconds (0d 0h 0m 58s)

---------------  T H R E A D  ---------------

Current thread is native thread

Stack: [0x00007e2c4ec19000,0x00007e2c4ed19000],  sp=0x00007e2c4ed17e18,  free space=1019k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  0x00007e2c20223d30


<cut>

Compilation events (20 events):
Event: 0,371 Thread 0x00007e2c481982a0 nmethod 655 0x00007e2c31a8cd90 code [0x00007e2c31a8cf20, 0x00007e2c31a8d010]
Event: 0,371 Thread 0x00007e2c481982a0  666       3       org.lwjgl.system.MemoryUtil::memLengthASCII (31 bytes)
Event: 0,371 Thread 0x00007e2c481982a0 nmethod 666 0x00007e2c31a8d090 code [0x00007e2c31a8d260, 0x00007e2c31a8d590]
Event: 0,371 Thread 0x00007e2c481982a0  664       3       org.lwjgl.opengl.GL$1::getFunctionAddress (85 bytes)
Event: 0,371 Thread 0x00007e2c481982a0 nmethod 664 0x00007e2c31a8d710 code [0x00007e2c31a8d900, 0x00007e2c31a8de30]
Event: 0,371 Thread 0x00007e2c481982a0  662       3       org.lwjgl.PointerBuffer::put (24 bytes)
Event: 0,372 Thread 0x00007e2c481982a0 nmethod 662 0x00007e2c31a8e010 code [0x00007e2c31a8e200, 0x00007e2c31a8e650]
Event: 0,372 Thread 0x00007e2c481982a0  663       3       org.lwjgl.system.MemoryUtil::memGetAddress (31 bytes)
Event: 0,372 Thread 0x00007e2c481982a0 nmethod 663 0x00007e2c31a8e890 code [0x00007e2c31a8ea40, 0x00007e2c31a8ec30]
Event: 0,372 Thread 0x00007e2c481982a0  668       3       org.lwjgl.PointerBuffer::get (22 bytes)
Event: 0,372 Thread 0x00007e2c481982a0 nmethod 668 0x00007e2c31a8ed10 code [0x00007e2c31a8ef00, 0x00007e2c31a8f460]
Event: 0,373 Thread 0x00007e2bdc202a90  670       4       org.lwjgl.system.MemoryStack::pop (22 bytes)
Event: 0,373 Thread 0x00007e2c481982a0  671       3       org.lwjgl.system.Checks::checkFunctions (81 bytes)
Event: 0,374 Thread 0x00007e2bdc202a90 nmethod 670 0x00007e2c38efd990 code [0x00007e2c38efdb20, 0x00007e2c38efdbf8]
Event: 0,374 Thread 0x00007e2c481982a0 nmethod 671 0x00007e2c31a8f690 code [0x00007e2c31a8f880, 0x00007e2c31a8fd20]
Event: 0,374 Thread 0x00007e2c48196d70 nmethod 669 0x00007e2c38efdc90 code [0x00007e2c38efde20, 0x00007e2c38efe018]
Event: 0,380 Thread 0x00007e2c481982a0  672       1       org.lwjgl.system.CustomBuffer::limit (5 bytes)
Event: 0,380 Thread 0x00007e2c481982a0 nmethod 672 0x00007e2c38efe210 code [0x00007e2c38efe3a0, 0x00007e2c38efe470]
Event: 0,381 Thread 0x00007e2bdc202a90  673       4       org.lwjgl.PointerBuffer::get (22 bytes)
Event: 0,382 Thread 0x00007e2bdc202a90 nmethod 673 0x00007e2c38efe510 code [0x00007e2c38efe6a0, 0x00007e2c38efe778]


<cut>


Internal exceptions (17 events):
Event: 0,082 Thread 0x00007e2c4802a9c0 Implicit null exception at 0x00007e2c38ed5cd5 to 0x00007e2c38ed5e38
Event: 0,126 Thread 0x00007e2c4802a9c0 Exception <a 'java/lang/NoSuchMethodError'{0x000000071961bf58}: 'java.lang.Object java.lang.
invoke.DirectMethodHandle$Holder.invokeStaticInit(java.lang.Object)'> (0x000000071961bf58) 
thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 758]
Event: 0,136 Thread 0x00007e2c4802a9c0 Exception <a 'java/lang/NoSuchMethodError'{0x0000000719689708}: 'void java.lang.invoke.Direc
tMethodHandle$Holder.invokeStatic(java.lang.Object, java.lang.Object)'> (0x0000000719689708) 
thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 758]
Event: 0,137 Thread 0x00007e2c4802a9c0 Exception <a 'java/lang/NoSuchMethodError'{0x0000000719696300}: 'void java.lang.invoke.Direc
tMethodHandle$Holder.invokeSpecial(java.lang.Object, java.lang.Object, java.lang.Object)'> (0x0000000719696300) 
thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 758]
Event: 0,139 Thread 0x00007e2c4802a9c0 Exception <a 'java/lang/NoSuchMethodError'{0x00000007196add30}: 'java.lang.Object java.lang.
invoke.DirectMethodHandle$Holder.invokeStatic(java.lang.Object, java.lang.Object, int)'> (0x00000007196add30) 
thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 758]
Event: 0,140 Thread 0x00007e2c4802a9c0 Exception <a 'java/lang/NoSuchMethodError'{0x00000007196b99e8}: 'void java.lang.invoke.Deleg
atingMethodHandle$Holder.delegate(java.lang.Object, java.lang.Object, int, java.lang.Object)'> (0x00000007196b99e8) 
thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 758]
Event: 0,140 Thread 0x00007e2c4802a9c0 Exception <a 'java/lang/NoSuchMethodError'{0x00000007196bd9a0}: 'int java.lang.invoke.Direct
MethodHandle$Holder.invokeSpecial(java.lang.Object, java.lang.Object, java.lang.Object)'> (0x00000007196bd9a0) 
thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 758]
Event: 0,162 Thread 0x00007e2c4802a9c0 Exception <a 'sun/nio/fs/UnixException'{0x00000007197891c0}> (0x00000007197891c0) 
thrown [src/hotspot/share/prims/jni.cpp, line 516]
Event: 0,201 Thread 0x00007e2c4802a9c0 Exception <a 'java/lang/NoSuchMethodError'{0x00000007194d59b8}: 'int java.lang.invoke.Direct
MethodHandle$Holder.invokeStaticInit(java.lang.Object, java.lang.Object, int, long)'> (0x00000007194d59b8) 
thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 758]
Event: 0,202 Thread 0x00007e2c4802a9c0 Exception <a 'java/lang/NoSuchMethodError'{0x00000007194db280}: 'java.lang.Object java.lang.
invoke.DirectMethodHandle$Holder.newInvokeSpecial(java.lang.Object, java.lang.Object, int)'> (0x00000007194db280) 
thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 758]
Event: 0,203 Thread 0x00007e2c4802a9c0 Exception <a 'java/lang/NoSuchMethodError'{0x00000007194eb600}: 'int java.lang.invoke.Direct
MethodHandle$Holder.invokeStaticInit(java.lang.Object, java.lang.Object, long, long)'> (0x00000007194eb600) 
thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 758]
Event: 0,204 Thread 0x00007e2c4802a9c0 Exception <a 'java/lang/NoSuchMethodError'{0x00000007194f15d0}: 'java.lang.Object java.lang.
invoke.DirectMethodHandle$Holder.newInvokeSpecial(java.lang.Object, java.lang.Object, long)'> (0x00000007194f15d0) 
thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 758]
Event: 0,204 Thread 0x00007e2c4802a9c0 Exception <a 'java/lang/NoSuchMethodError'{0x00000007194f4e98}: 'java.lang.Object java.lang.
invoke.Invokers$Holder.linkToTargetMethod(java.lang.Object, long, java.lang.Object)'> (0x00000007194f4e98) 
thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 758]
Event: 0,205 Thread 0x00007e2c4802a9c0 Exception <a 'java/lang/NoSuchMethodError'{0x00000007194fc368}: 'int java.lang.invoke.Direct
MethodHandle$Holder.invokeStaticInit(java.lang.Object, java.lang.Object, java.lang.Object, long)'> (0x00000007194fc368) 
thrown [src/hotspot/share/interpreter/linkResolver.cpp, line 758]
Event: 0,218 Thread 0x00007e2c4802a9c0 Exception <a 'sun/nio/fs/UnixException'{0x00000007195ce190}> (0x00000007195ce190) 
thrown [src/hotspot/share/prims/jni.cpp, line 516]
Event: 0,344 Thread 0x00007e2c4802a9c0 Exception <a 'sun/nio/fs/UnixException'{0x0000000719270d78}> (0x0000000719270d78) 
thrown [src/hotspot/share/prims/jni.cpp, line 516]
Event: 0,348 Thread 0x00007e2c4802a9c0 Exception <a 'sun/nio/fs/UnixException'{0x00000007192798e8}> (0x00000007192798e8) 
thrown [src/hotspot/share/prims/jni.cpp, line 516]
@Bixilon
Copy link

Bixilon commented Oct 30, 2024

Having exactly the same issue, not debugged it yet. Downgrading to lwjgl 3.3.3 works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants