Open TheLastRar opened 1 year ago
I do think I fixed this though.
Still broken unfortunately
This version of LWJGL uses JNI to the JVMTI pointer https://github.com/LWJGL/lwjgl3/blob/3.1.6/modules/lwjgl/core/src/main/c/common_tools.c#L187-L199
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
UNUSED_PARAM(reserved)
jvm = vm;
if ((*jvm)->GetEnv(jvm, (void **)&jvmti, JVMTI_VERSION_1_2) != JNI_OK) {
fprintf(stderr, "[LWJGL] Failed to retrieve the JVMTI interface pointer.");
fflush(stderr);
}
envTLSInit();
return JNI_VERSION_1_8;
}
Which on IKVM logs the error message about the JVMTI interface pointer.
The first stack trace is similar to https://github.com/ikvmnet/ikvm/issues/336, except unlike 3.2.2, 3.1.6 has a fallback and can continue.
The second stack trace is LWJGL trying to dereference the jvmti
pointer it failed to get in JNI_OnLoad
, and crashing with a System.AccessViolationException
as a result.
Man, when I first read this bug, I assumed it was just the JNI interface pointer. Now that I'm looking closer... JVMTI. I had focused on the stack trace that followed about the null field.
This is an area I believe is completely unimplemented. We don't have JVMTI stuff implemented. I'll take a quick look and see what the total level of difficulty is. But I suspect it's not going to be something I take up soon.
If maybe you could figure out what LWJGL needs from JVMTI, we could focus on those aspects?
Also because it's related #158
Yeah. This is going to go far beyond what I can do currently. This is deeper stuff that is probably going to require a bridge to the Core profiler API and debugger APIs.
The functions used by 3.1.6 are GetJNIFunctionTable()
and Deallocate()
, 3.2.x and newer don't need any JVMTI apis
@TheLastRar Does that mean >= 3.2.x works?
Since we don't support JVMTI, I'm going to leave this one open, but retitle it about JVMTI specifically. Might never get completed. But it is technically a missing feature.
@TheLastRar Does that mean >= 3.2.x works?
3.2.2 is busted due to https://github.com/ikvmnet/ikvm/issues/336 3.3.x seems to work fine last I checked
Neat.
IKVM version : IKVM-8.5.0-image-netcoreapp3.1-win7-x64
Only the client was tested.
Version of LWJGL used by default is dependent on the JVMTI interface pointer. LWJGL is open source library for using gl in java, It however uses native code to retrieve the JVMTI interface pointer.