Fix crash in direct callbacks on mac OS aarch64#1419
Conversation
libffi requires the number of fixed arguments to an ffi call to be correctly provided. For the callback case the conversion routine supplied the wrong number of arguments for the dispatch into java. The JNI callbacks have the signature: NativeType Call<type>Method(JNIEnv *env, jobject obj, jmethodID methodID, ...); so the first three arguments are fixed and the rest is passed as varargs.
|
@dkocher could you please have a look at this? After this this I still see a testfailure in the jna-platform, but I suspect, that that is problem with false assumptions. @dbwiddis could you please have a look at this: I'm on a remote machine, where I'm just a user, so I might lack the permissions to get that information. Maybe you have an idea how I could pin point that. |
As the author of that test, I concur with the "false assumptions" conclusion. The failure is that the USB Controller IO registry entry has a different name on M1 than on other Macs. IOIterator iter = IOKitUtil.getMatchingServices("IOUSBController");
assertNotNull(iter);I fixed this on my own project: Issue: oshi/oshi#1483 Fix: oshi/oshi#1488 I'll update the JNA test. |
eb32223 to
988cd08
Compare
libffi requires the number of fixed arguments to an ffi call to be
correctly provided. For the callback case the conversion routine
supplied the wrong number of arguments for the dispatch into java.
The JNI callbacks have the signature:
NativeType CallMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...);
so the first three arguments are fixed and the rest is passed as
varargs.
Closes: #1323