Giter Site home page Giter Site logo

Not using the embedded library about jna-gmp HOT 22 CLOSED

square avatar square commented on August 19, 2024
Not using the embedded library

from jna-gmp.

Comments (22)

kevinconaway avatar kevinconaway commented on August 19, 2024 1

I'm realizing that you and @kevinconaway are reporting two different issues here.

I believe its the same issue. The issue originally presented itself to us with the exact same stack trace that Jake posted. Its just that LibGmp or perhaps NativeLibrary swallows the original linker error. I pulled out the shared library file and tried to load it directly on my target system and thats where the error I posted came from.

from jna-gmp.

JakeWharton avatar JakeWharton commented on August 19, 2024 1

@dragonsinth It wasn't me. Was someone else. I just moved the report here.

from jna-gmp.

dragonsinth avatar dragonsinth commented on August 19, 2024 1

I did just update the CHANGELOG.md so it should be fairly ready to go.

from jna-gmp.

JakeWharton avatar JakeWharton commented on August 19, 2024 1

from jna-gmp.

JakeWharton avatar JakeWharton commented on August 19, 2024 1

from jna-gmp.

kevinconaway avatar kevinconaway commented on August 19, 2024

@JakeWharton we're seeing this as well after upgrading to 2.0.0 It looks like the shared library thats being distributed requires GLIBC 2.14 but our system has 2.12:

Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/jna--1159748624/jna6403537542271234011.tmp: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /tmp/jna--1159748624/jna6403537542271234011.tmp)
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1929)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1814)
	at java.lang.Runtime.load0(Runtime.java:809)
	at java.lang.System.load(System.java:1083)
	at Test.main(Test.java:10)

Dependencies for the 2.0.0 library:

ldd -r -v  /tmp/jna--1159748624/jna6403537542271234011.tmp
ldd: warning: you do not have execution permission for `/tmp/jna--1159748624/jna6403537542271234011.tmp'
/tmp/jna--1159748624/jna6403537542271234011.tmp: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /tmp/jna--1159748624/jna6403537542271234011.tmp)
	linux-vdso.so.1 =>  (0x00007fffdece7000)
	libc.so.6 => /lib64/libc.so.6 (0x00007ffac21ec000)
	/lib64/ld-linux-x86-64.so.2 (0x0000003b93800000)
symbol memcpy, version GLIBC_2.14 not defined in file libc.so.6 with link time reference	(/tmp/jna--1159748624/jna6403537542271234011.tmp)

	Version information:
	/tmp/jna--1159748624/jna6403537542271234011.tmp:
		libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6
		libc.so.6 (GLIBC_2.14) => not found
		libc.so.6 (GLIBC_2.7) => /lib64/libc.so.6
		libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
	/lib64/libc.so.6:
		ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
		ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2

Looking at the 1.x version:

ldd -r -v libgmp.so
ldd: warning: you do not have execution permission for `./libgmp.so'
	linux-vdso.so.1 =>  (0x00007ffcc07dc000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f0994678000)
	/lib64/ld-linux-x86-64.so.2 (0x000000383e800000)

	Version information:
	./libgmp.so:
		libc.so.6 (GLIBC_2.3) => /lib64/libc.so.6
		libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
	/lib64/libc.so.6:
		ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
		ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2

@dragonsinth Is this just a matter of recompiling libgmp on a machine that doesn't have glibc 2.14?

from jna-gmp.

dragonsinth avatar dragonsinth commented on August 19, 2024

I'm definitely at the limits of my knowledge when it comes to effectively building linux binaries. :( Especially all the nuances about building against particular library versions.

Googling "how do i create an lsb compatible binary gcc" turns up stuff that's like 7 years old and contains broken links. :/

I'd definitely welcome any expertise on this.

from jna-gmp.

dragonsinth avatar dragonsinth commented on August 19, 2024

@kevinconaway I would definitely suggest tho, if you recompile libgmp on the system you're trying to run on, it should work.

from jna-gmp.

dragonsinth avatar dragonsinth commented on August 19, 2024

BTW @JakeWharton I assume you got past the original issue reported? I'm realizing that you and @kevinconaway are reporting two different issues here.

from jna-gmp.

kevinconaway avatar kevinconaway commented on August 19, 2024

I would definitely suggest tho, if you recompile libgmp on the system you're trying to run on, it should work.

I did do that and it did work but, much like you, I'm not really knowledgeable beyond the standard ./configure && make incantation. We run on a number of different platforms so ideally I'd like to build a version that targets the lowest common denominator but I'm not sure of the best way to do that.

from jna-gmp.

dragonsinth avatar dragonsinth commented on August 19, 2024

I'm interested in the outcome but I can't really spend the time to research the best way to build compatible binaries (past the half hour I already spend). But if someone can come up with a reasonable plan (like, use this docker image that contains an older distro) I'm happy to help execute and submit a new prebuilt binary.

from jna-gmp.

kevinconaway avatar kevinconaway commented on August 19, 2024

Sure. I'll spend some time and come up with a recommendation.

Thanks for your help so far

from jna-gmp.

kevinconaway avatar kevinconaway commented on August 19, 2024

JNA had this issue as well java-native-access/jna#853

from jna-gmp.

dragonsinth avatar dragonsinth commented on August 19, 2024

Looks like they solved it with "The native libraries were rebuild in a debian squeeze chroot, which
results in support for GLIBC version down to 2.7.". I'm not entirely sure what that means or how to set that up.

from jna-gmp.

dragonsinth avatar dragonsinth commented on August 19, 2024
$ ldd -r -v libgmp.so 
	linux-vdso.so.1 (0x00007ffebd945000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fdc93e01000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fdc9443b000)

	Version information:
	./libgmp.so:
		libc.so.6 (GLIBC_2.3) => /lib/x86_64-linux-gnu/libc.so.6
		libc.so.6 (GLIBC_2.7) => /lib/x86_64-linux-gnu/libc.so.6
		libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
	/lib/x86_64-linux-gnu/libc.so.6:
		ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2

Merged! Thanks so much for making this happen!

from jna-gmp.

kevinconaway avatar kevinconaway commented on August 19, 2024

Thanks so much for your prompt help on this @dragonsinth.

Will you be able to create a new release with this change?

from jna-gmp.

dragonsinth avatar dragonsinth commented on August 19, 2024

@JakeWharton usually does releases, I don't think I have access to publish artifacts anyway.

from jna-gmp.

JakeWharton avatar JakeWharton commented on August 19, 2024

from jna-gmp.

kevinconaway avatar kevinconaway commented on August 19, 2024

Thank you!

from jna-gmp.

kevinconaway avatar kevinconaway commented on August 19, 2024

Hi @JakeWharton, will you have time to create a release this week?

Thanks.

from jna-gmp.

kevinconaway avatar kevinconaway commented on August 19, 2024

@JakeWharton Will you have time to create a release with this issue?

If its OK with you, I'll continue to write one comment a week a la Andy Dufresne. We'd like to use some of the enhancements in 2.x but we can't without this patch.

Thanks!

from jna-gmp.

kevinconaway avatar kevinconaway commented on August 19, 2024

Got it, thank you!

from jna-gmp.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.