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

UnsatisfiedLinkError for linux-arm when using jna 4.2.0 from Maven repo #538

Closed
antonio-dibacco opened this issue Nov 19, 2015 · 18 comments
Closed

Comments

@antonio-dibacco
Copy link

I get the following exception with jna 4.2.0 for linux arm platform 32 bit:

Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/jna-3506402/jna8529987963707458054.tmp: /tmp/jna-3506402/jna8529987963707458054.tmp: internal error
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.load0(Unknown Source)
at java.lang.System.load(Unknown Source)
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:851)
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:826)
at com.sun.jna.Native.(Native.java:140)
at com.sun.jna.Pointer.(Pointer.java:41)
at com.sun.jna.Structure.(Structure.java:2078)
at Net.main(Net.java:32)

@Zubnix
Copy link

Zubnix commented Dec 11, 2015

Can confirm. Same issue here.

@twall
Copy link
Contributor

twall commented Dec 13, 2015

Are you running v5 or v7? hf or soft float?

I’m pretty sure the JNA library for linux/arm is compiled for v7+hf (android defaults to v5+soft float)

On Dec 11, 2015, at 6:07 PM, Zubnix notifications@github.com wrote:

Can confirm. Same issue here.


Reply to this email directly or view it on GitHub.

@Zubnix
Copy link

Zubnix commented Dec 14, 2015

I've tested on rpi 1 model B using latest raspbian, which is I believe is armv6hf. I've also seen the issue on a freescale imx6, which I believe was running an armv7 hf yocto build.

@CmptrExpr
Copy link

I'm seeing the same problem under Windows 2012 with JNA 4.2.1 and 4.2.2.

@twall
Copy link
Contributor

twall commented Apr 7, 2016

You’re seeing UnsatisfiedLinkError or “internal error”?

On Apr 7, 2016, at 11:42 AM, Steve notifications@github.com wrote:

I'm seeing the same problem under Windows 2012 with JNA 4.2.1 and 4.2.2.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub

@CmptrExpr
Copy link

UnsatisfiedLinkError

Steve Freeman

On Thu, Apr 7, 2016 at 4:03 PM, Timothy Wall notifications@github.com
wrote:

You’re seeing UnsatisfiedLinkError or “internal error”?

On Apr 7, 2016, at 11:42 AM, Steve notifications@github.com wrote:

I'm seeing the same problem under Windows 2012 with JNA 4.2.1 and 4.2.2.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#538 (comment)

@twall
Copy link
Contributor

twall commented Apr 7, 2016

Not the same error. arm/internal error != windows unsatisfied link error.

Please post to jna-users first (with full context and stack trace) and open a new issue here only if it’s determined to be a bug and not a configuration issue.

On Apr 7, 2016, at 4:23 PM, Steve notifications@github.com wrote:

UnsatisfiedLinkError

Steve Freeman

On Thu, Apr 7, 2016 at 4:03 PM, Timothy Wall notifications@github.com
wrote:

You’re seeing UnsatisfiedLinkError or “internal error”?

On Apr 7, 2016, at 11:42 AM, Steve notifications@github.com wrote:

I'm seeing the same problem under Windows 2012 with JNA 4.2.1 and 4.2.2.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#538 (comment)


You are receiving this because you commented.
Reply to this email directly or view it on GitHub

@matthiasblaesing
Copy link
Member

Please test with 4.2.2 - if it fails, please:

  • make sure only one copy of JNA is on the class path
  • report the exact version of the JDK/JRE (including bitness) and
  • exact processor + linux distribution you are running

I'm closing this as not enough information is provided. Feel free to reopen with further information.

@bondolo
Copy link

bondolo commented Jan 16, 2017

Seeing this problem with JNA 4.2.2 with JDK 8u6 (32bit, softfloat) on ARM7l softfloat (32-bit). The OS is TimeSys Linux 3.0 (softfloat).

@matthiasblaesing
Copy link
Member

yes - I'm sorry the ARM builds are hardfloat. If you can give be a pointer how to determine hardfloat/softfloat at runtime, I'm willing to do softfloat builds (in fact I already did by accident).

@bondolo
Copy link

bondolo commented Jan 16, 2017

Sorry, I don't know the answer to that. Earlier JNA builds were softfloat compatible, 4.0.0, which is what I am upgrading from did include ARM7 softfloat support.

@bondolo
Copy link

bondolo commented Jan 16, 2017

This is what I was able to find regarding determining armel vs armfp:

https://www.raspberrypi.org/forums/viewtopic.php?f=33&t=20873

@bondolo
Copy link

bondolo commented Jan 16, 2017

And this which appears to be the best solution:

https://bugs.openjdk.java.net/browse/JDK-8005545

gnueabi GNU softfp EABI
gnueabihf GNU hard float EABI
androideabi Android EABI

@bondolo
Copy link

bondolo commented Jan 16, 2017

For java 7 on ARM I don't believe there was ever an official hardfloat build so if the property doesn't exist assume softfloat

@matthiasblaesing
Copy link
Member

Thank you - this looks also matching:

https://blogs.oracle.com/jtc/entry/is_it_armhf_or_armel

With regard to past builds, I just fetched from maven central: 4.0.0, 4.2.0, 4.2.2, 4.3.0. They are all hardfloat:

matthias@athena:~/x$ readelf -A x-jna-4.3.0.jar/com/sun/jna/linux-arm/libjnidispatch.so  | grep VFP
  Tag_FP_arch: VFPv2
  Tag_ABI_VFP_args: VFP registers
matthias@athena:~/x$ readelf -A x-jna-4.2.2.jar/com/sun/jna/linux-arm/libjnidispatch.so  | grep VFP
  Tag_FP_arch: VFPv2
  Tag_ABI_VFP_args: VFP registers
matthias@athena:~/x$ readelf -A x-jna-4.2.0.jar/com/sun/jna/linux-arm/libjnidispatch.so  | grep VFP
  Tag_FP_arch: VFPv2
  Tag_ABI_VFP_args: VFP registers
matthias@athena:~/x$ readelf -A x-jna-4.0.0.jar/com/sun/jna/linux-arm/libjnidispatch.so  | grep VFP
  Tag_FP_arch: VFPv2
  Tag_ABI_VFP_args: VFP registers

@bondolo
Copy link

bondolo commented Jan 16, 2017

I just re-verified that replacing the 4.2.2 dependency with 4.0.0 works correctly for purejavacomm. I can't explain the difference in behaviour between 4.0.0. and 4.2.2

diff -uwd <(readelf -A 4.0.0.libjnidispatch.so) <(readelf -A 4.2.2.libjnidispatch.so)

shows that they were built with the same options. ie. no difference.

The repo version of libjnidispatch is built differently but I haven't actually tested that:

diff -uwd <(readelf -A 4.2.2.libjnidispatch.so) <(readelf -A libjnidispatch.so)
--- /dev/fd/63 2017-01-16 21:24:27.897202513 +0000
+++ /dev/fd/62 2017-01-16 21:24:27.905015003 +0000
@@ -13,5 +13,4 @@
Tag_ABI_enum_size: int
Tag_ABI_HardFP_use: SP and DP
Tag_ABI_VFP_args: VFP registers

  • Tag_ABI_optimization_goals: Aggressive Speed
  • Tag_DIV_use: Not allowed
  • Tag_CPU_unaligned_access: v6

@matthiasblaesing
Copy link
Member

matthiasblaesing commented Jan 16, 2017 via email

@bondolo
Copy link

bondolo commented Jan 16, 2017

The other libjnidispatch is 4.0.0. I will resume on jna-user mailinglist

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

6 participants