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

Add minimum glibc version to each release #160

Closed
patelh opened this issue Feb 27, 2020 · 8 comments
Closed

Add minimum glibc version to each release #160

patelh opened this issue Feb 27, 2020 · 8 comments

Comments

@patelh
Copy link

patelh commented Feb 27, 2020

Useful to add minimum glibc version to each release so we can easily verify if the right version is installed on the OS.

@odaira
Copy link
Member

odaira commented Feb 27, 2020

I don't have experience to test software across different glibc versions, but how would you figure out the minimum version with which a library is supposed to work? Lz4-java is loaded into a JVM, and I guess the JVM has stricter dependencies on a specific glibc version, so I am wondering how meaningful it is to declare a minimum glibc version for lz4-java itself.

@patelh
Copy link
Author

patelh commented Feb 27, 2020

The minimum glibc version is defined at compile time of the libraries embedded in the jar. For example 1.4.0 has a different minimum glibc version then 1.5.1. It's the OS used to compile your jar which defines the minimum glibc version. IIRC.

e.g. check under /lib64/lib-c*.so

@patelh
Copy link
Author

patelh commented Feb 27, 2020

Otherwise, we see this error which is eaten up and defaults to the Unsafe/Safe java version:

java.lang.UnsatisfiedLinkError: /tmp/liblz4-java-882887096802214809.so: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /tmp/liblz4-java-882887096802214809.so)
  at java.lang.ClassLoader$NativeLibrary.load(Native Method)
  at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1934)
  at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1817)
  at java.lang.Runtime.load0(Runtime.java:809)
  at java.lang.System.load(System.java:1086)
  at net.jpountz.util.Native.load(Native.java:135)

@odaira
Copy link
Member

odaira commented Feb 28, 2020

ok, I've just learned I can use ldd -v to know the dependent glibc version.

$ ldd -v src/resources/net/jpountz/util/linux/amd64/liblz4-java.so
	linux-vdso.so.1 (0x00007ffd14ffa000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f243f1cb000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f243f7ec000)

	Version information:
	src/resources/net/jpountz/util/linux/amd64/liblz4-java.so:
		libc.so.6 (GLIBC_2.14) => /lib/x86_64-linux-gnu/libc.so.6
		libc.so.6 (GLIBC_2.4) => /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
		ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2

In this example, 2.2.5 is the minimum version...? I'll document these in the release note. Thanks for the suggestion.

@patelh
Copy link
Author

patelh commented Mar 2, 2020

No, minimum required is still 2.14 in your example.

Here is ldd output on a centos 6.9 image for 1.4.0 and 1.5.1, where 1.4.0 will work and 1.5.1 does not due to missing required lib:

[root@d7a5a938ee73 amd64]# ldd -v liblz4-java.so 
ldd: warning: you do not have execution permission for `./liblz4-java.so'
	linux-vdso.so.1 =>  (0x00007ffc491d8000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f659964d000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f6599bee000)

	Version information:
	./liblz4-java.so:
		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
[root@d7a5a938ee73 amd64]# ldd -v liblz4-java.so 
ldd: warning: you do not have execution permission for `./liblz4-java.so'
./liblz4-java.so: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./liblz4-java.so)
	linux-vdso.so.1 =>  (0x00007fff61b25000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f0416bd6000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f041719a000)

	Version information:
	./liblz4-java.so:
		libc.so.6 (GLIBC_2.14) => not found
		libc.so.6 (GLIBC_2.4) => /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

@odaira
Copy link
Member

odaira commented Mar 4, 2020

I see, I need more study. I'll check with a centos 6.9 image.

	src/resources/net/jpountz/util/linux/amd64/liblz4-java.so:
		libc.so.6 (GLIBC_2.14) => /lib/x86_64-linux-gnu/libc.so.6
		libc.so.6 (GLIBC_2.4) => /lib/x86_64-linux-gnu/libc.so.6
		libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
  1. In the example above, among GLIBC_2.14, GLIBC_2.4, and GLIBC_2.2.5, GLIBC_2.14 is the highest version, correct?
  2. If so, is the highest dependent version the minimum required version...?

@patelh
Copy link
Author

patelh commented Mar 7, 2020

  1. Yes.
  2. Yes.

@odaira
Copy link
Member

odaira commented Jun 19, 2021

Added minimum glibc versions to https://github.com/lz4/lz4-java/blob/1.8.0/CHANGES.md
Thanks for your help!

@odaira odaira closed this as completed Jun 19, 2021
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

2 participants