chirontt / lwjgl3-helloworld-native Goto Github PK
View Code? Open in Web Editor NEWHelloWorld demo for LWJGL 3, compiled to native executable by GraalVM native-image utility.
License: BSD 3-Clause "New" or "Revised" License
HelloWorld demo for LWJGL 3, compiled to native executable by GraalVM native-image utility.
License: BSD 3-Clause "New" or "Revised" License
running the native application on windows (both compiled with GraalVM for Java 11 or Java 19) crashes with a segfault on the first invocation of lwjgl at GLFWErrorCallback.createPrint(System.err).set();
(or in glfwInit()
if you remove the GLFWErrorCallback
call)
Hello LWJGL 3.3.1 build 7!
[LWJGL] Version: 3.3.1 build 7
[LWJGL] OS: Windows 10 v10.0
[LWJGL] JRE: Windows amd64 11.0.18
[LWJGL] JVM: Substrate VM vGraalVM 22.3.1 Java 11 CE by Oracle Corporation
[LWJGL] Loading JNI library: lwjgl
[LWJGL] Module: org.lwjgl
[LWJGL] Loaded from org.lwjgl.librarypath: <redacted>
[LWJGL] Loading library: glfw
[LWJGL] Module: org.lwjgl.glfw
[ [ SubstrateSegfaultHandler caught a segfault in thread 0x000002014c05ec40 ] ]
...
Stacktrace for the failing thread 0x00000182a7f8b380:
SP 0x0000006b98f3eed0 IP 0x00007ff860570549 IP is not within Java code. Trying frame anchor of last Java frame instead.
SP 0x0000006b98f3ef00 IP 0x00007ff77a1de5e8 [image code] org.lwjgl.system.windows.WinBase.nGetModuleHandle(WinBase.java)
SP 0x0000006b98f3ef60 IP 0x00007ff77a1ddae0 [image code] org.lwjgl.system.windows.WinBase.GetModuleHandle(WinBase.java:76)
SP 0x0000006b98f3ef80 IP 0x00007ff77a1deb36 [image code] org.lwjgl.system.windows.WindowsLibrary.<clinit>(WindowsLibrary.java:25)
SP 0x0000006b98f3efb0 IP 0x00007ff779bbac9b [image code] com.oracle.svm.core.classinitialization.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:361)
SP 0x0000006b98f3efc0 IP 0x00007ff779bb9c08 [image code] com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:277)
SP 0x0000006b98f3f170 IP 0x00007ff77a18edb0 [image code] org.lwjgl.system.APIUtil.apiCreateLibrary(APIUtil.java:109)
SP 0x0000006b98f3f190 IP 0x00007ff77a1a19ae [image code] org.lwjgl.system.Library.loadNative(Library.java:363)
SP 0x0000006b98f3f1e0 IP 0x00007ff77a1a1e5e [image code] org.lwjgl.system.Library.loadNativeFromLibraryPath(Library.java:352)
SP 0x0000006b98f3f1f0 IP 0x00007ff77a1a03f9 [image code] org.lwjgl.system.Library.loadNative(Library.java:266)
SP 0x0000006b98f3f280 IP 0x00007ff77a108334 [image code] org.lwjgl.system.Library.loadNative(Library.java:224)
SP 0x0000006b98f3f280 IP 0x00007ff77a108334 [image code] org.lwjgl.glfw.GLFW.<clinit>(GLFW.java:30)
SP 0x0000006b98f3f2c0 IP 0x00007ff779bbac9b [image code] com.oracle.svm.core.classinitialization.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:361)
SP 0x0000006b98f3f2d0 IP 0x00007ff779bb9c08 [image code] com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:277)
SP 0x0000006b98f3f480 IP 0x00007ff77a0db27e [image code] java.lang.Class.ensureInitialized(DynamicHub.java:528)
SP 0x0000006b98f3f480 IP 0x00007ff77a0db27e [image code] jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:134)
SP 0x0000006b98f3f480 IP 0x00007ff77a0db27e [image code] jdk.internal.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:42)
SP 0x0000006b98f3f4c0 IP 0x00007ff77a0d885d [image code] jdk.internal.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:147)
SP 0x0000006b98f3f4d0 IP 0x00007ff779e0c862 [image code] java.lang.reflect.Field.acquireFieldAccessor(Field.java:1169)
SP 0x0000006b98f3f4f0 IP 0x00007ff779e0d171 [image code] java.lang.reflect.Field.getFieldAccessor(Field.java:138)
SP 0x0000006b98f3f520 IP 0x00007ff77a18de6e [image code] java.lang.reflect.Field.getInt(Field.java:612)
SP 0x0000006b98f3f520 IP 0x00007ff77a18de6e [image code] org.lwjgl.system.APIUtil.apiClassTokens(APIUtil.java:350)
SP 0x0000006b98f3f5a0 IP 0x00007ff77a10a423 [image code] org.lwjgl.glfw.GLFWErrorCallback$1.<init>(GLFWErrorCallback.java:98)
SP 0x0000006b98f3f5c0 IP 0x00007ff779ba1217 [image code] org.lwjgl.glfw.GLFWErrorCallback.createPrint(GLFWErrorCallback.java:97)
SP 0x0000006b98f3f5c0 IP 0x00007ff779ba1217 [image code] com.github.chirontt.lwjgl.demo.HelloWorld.init(HelloWorld.java:46)
SP 0x0000006b98f3f630 IP 0x00007ff779ba2bda [image code] com.github.chirontt.lwjgl.demo.HelloWorld.run(HelloWorld.java:28)
SP 0x0000006b98f3f670 IP 0x00007ff779baeb81 [image code] com.github.chirontt.lwjgl.demo.HelloWorld.main(HelloWorld.java:125)
SP 0x0000006b98f3f670 IP 0x00007ff779baeb81 [image code] com.oracle.svm.core.JavaMainWrapper.runCore0(JavaMainWrapper.java:175)
SP 0x0000006b98f3f6a0 IP 0x00007ff779bae7f3 [image code] com.oracle.svm.core.JavaMainWrapper.runCore(JavaMainWrapper.java:135)
SP 0x0000006b98f3f6a0 IP 0x00007ff779bae7f3 [image code] com.oracle.svm.core.JavaMainWrapper.doRun(JavaMainWrapper.java:232)
SP 0x0000006b98f3f6e0 IP 0x00007ff779be84c6 [image code] com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:218)
SP 0x0000006b98f3f6e0 IP 0x00007ff779be84c6 [image code] com.oracle.svm.core.code.IsolateEnterStub.JavaMainWrapper_run_3148eece06270530b6e0d4d60311411342c82698(IsolateEnterStub.java:0)
...
Any ideas how to fix this? Or is this expected? I found oracle/graal#5815 which suggests that it is expected to not work?
The executable is now in build/native/nativeCompile/lwjgl3-helloworld
on Linux.
And maybe you should add ./
before every gradlew so that command line work on default Debian/Ubuntu terminal.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.