-
Notifications
You must be signed in to change notification settings - Fork 1.7k
DirectMapping Calls Failing #507
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
Comments
The JNA code in question is the return statement below:
Because the NullPointerException is being thrown at that line and not in either the toNative() call or ToNativeContext() contructor, I would say cvt is null. Since this is "called from native code", that is where to start, I would guess. The RPi 2 is a quad core ARMv7 device and the Raspbian (Debian Linux derivative) is 3.18.11-v7+. I did clear the temp files from 4.1.0 before trying 4.2.0 and again before switching back to 4.1.0. |
Try adding |
The origin of the |
There is no system-installed JNA. As indicated, the only thing "unique" that I see in the library functions are the use of the NativeSize class which was originally generated by JNAerator for one of the applications and I used in the other application. I see your commit that references this issue. Is there something I should do with that or are you testing? As I say, all working with 4.1.0 with no changes, but 4.2.0 breaks. I am using 4.2.0 on a Windows machine but that API doesn't use the NativeSize class (doesn't use size_t). |
|
I looked inside the 4.2.0 jar vs. the 4.1.0 jar and the libjnidispatch.so for linux-arm (I am assuming that is what is being loaded) is timestamped 2014-11-06 in 4.2.0 and 2013-06-04 in 4.1.0 so there is definitely a difference in native libraries. |
Yes, linux-arm would be what’s loaded on a Raspberry Pi. It’s quite possible the linux-arm binary didn’t get updated in the release. So you’re seeing this on linux-arm and Windows (x86 or x86-64?)?
|
I am seeing this with linux-arm, NOT Windows but NativeSize_t is not used in the Windows APIs that I am using. To recap, 4.1.0 linux-arm works with no error, 4.2.0 linux-arm fails with above error. Focus is linux-arm in 4.2.0 (and possibly other implementations?) apparently not handling an IntegerType subclass as a parameter (parameter since it is toNative, not fromNative which would be for a return value). |
I've committed a clean build of libjnidispatch.so (within lib/native/linux-arm.jar) for linux-arm on branch |
I am going to be a bit dumb here but should I just download the new libjnidispatch.so and replace it in my jna-4.2.0.jar? I understand a jar is just a zip, just want to make sure I don't break anything. |
I will run 2 tests with the 4.2.0 jar. First will be with the libjnidispatch.so you just compiled. Second will be with the libjnidispatch.so from the 4.1.0 jar. I will run both even if the new compile works without error and report back on my results. |
Placed the 4.1.0 libjnidispatch.so in the 4.2.0 jar, same issue. Placed the new libjnidipatch.so in the 4.2.0 jar, working without error. |
Just an observation, most likely way off base but..., because the original 2014 library failed and the 4.1.0 library failed at the same place but the newly compiled library did not fail, maybe something changed in the calls to the JNI dispatch library in 4.2.0 which precludes using older libraries with 4.2.0. Just an observation, nothing more... |
Ok, thanks for checking. There were no API changes at the JNI level, but apparently the actual API usage is sufficiently different to cause an issue, although it does seem odd given that the error trigger is coming from the native level in the older library.
|
The reason I mentioned it was because if this is true for the linux-arm libjnidispatch.so, could it be true of other dispatch libraries? Glad you were able to isolate the issue. |
I was able to reproduce the NPE using the released versions ("old" JNI library and "new" Java code). The
|
While the root cause is that the linux-arm native library was not updated in this release, the newer Java code was still expected to be backwards-compatible with the older JNI code. Obviously this is not entirely the case. Thanks again for tracking this down. |
Glad you were able to reproduce it. I will leave this open and let you close it when you determine it is resolved to your satisfaction since it may affect other native builds. |
It's a follow-up to #1861 Fixes the regression on linux-arm: java-native-access/jna#507
…java-native-access#507) Motivation: Let's upgrade to latest quiche release Modifications: Upgrade to quiche sha that is the latest quiche release (0.17.2) Result: Use latest quiche release
Just tried jna-4.2.0.jar on a RaspberryPi V2 running Raspbian Linux and JDK 8 build 51 and received the following in 2 different programs using 2 completely different libraries:
The specific methods being called are
NativeSize is a size_t encapsulation:
Switched back to 4.1.0 and working perfectly.
The text was updated successfully, but these errors were encountered: