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

jffi ships with binaries requiring glibc 2.27 #7695

Closed
headius opened this issue Feb 28, 2023 · 7 comments
Closed

jffi ships with binaries requiring glibc 2.27 #7695

headius opened this issue Feb 28, 2023 · 7 comments
Labels
Milestone

Comments

@headius
Copy link
Member

headius commented Feb 28, 2023

Original issue is here: jnr/jffi#138

jffi's builds are done on a recent version of Debian that has a recent glibc. Unfortunately glibc does not produce dynamic bindings that are compatible with older versions, so the jffi stub fails to load. I attempted to make jffi builds use an older debian in CI, but it did not appear to link against an older glibc.

This should be dealt with for JRuby 9.4.3 but I'm not sure how best to do it.

@headius
Copy link
Member Author

headius commented Oct 9, 2023

This is still stuck. We partially fixed it for Linux on x86_64, but the image we were using (debian:8) no longer works in CI and we have other platforms that still need this fixed. It's getting more and more difficult to build anything on these old Linux distributions.

@headius headius modified the milestones: JRuby 9.4.4.0, JRuby 9.4.5.0 Oct 9, 2023
@RTrampov
Copy link

Any plans to fix this in JRuby 9.3.x.x, since 9.3.10.0 and 9.3.11.0 are also affected?

@headius headius modified the milestones: JRuby 9.4.5.0, JRuby 9.4.6.0 Oct 31, 2023
@jsvd
Copy link
Contributor

jsvd commented Jan 16, 2024

Just for reference, to facilitate reproduction, here's a 1 liner with docker, testing with centos/oraclelinux 7 and aarch64:

docker run -it --platform linux/aarch64 centos:7 sh -c "yum install java-11-openjdk-headless.aarch64 -y --nogpgcheck -q -e 0 && curl -s https://repo1.maven.org/maven2/org/jruby/jruby-dist/9.4.5.0/jruby-dist-9.4.5.0-bin.tar.gz | tar -zxf - && jruby-9.4.5.0/bin/jruby -Xnative.verbose -w -d --dev -e 'system \"date\"'"
Example output here
❯ docker run -it --platform linux/aarch64 centos:7 sh -c "yum install java-11-openjdk-headless.aarch64 -y --nogpgcheck -q -e 0 && curl -s https://repo1.maven.org/maven2/org/jruby/jruby-dist/9.4.5.0/jruby-dist-9.4.5.0-bin.tar.gz | tar -zxf - && jruby-9.4.5.0/bin/jruby -Xnative.verbose -w -d --dev -e 'system \"date\"'"
Failed to load native POSIX impl; falling back on Java impl. Stacktrace follows.
java.lang.UnsatisfiedLinkError: could not load FFI provider jnr.ffi.provider.jffi.Provider
	at org.jruby.dist/jnr.ffi.provider.InvalidProvider$1.loadLibrary(InvalidProvider.java:49)
	at org.jruby.dist/jnr.ffi.LibraryLoader.load(LibraryLoader.java:420)
	at org.jruby.dist/jnr.posix.POSIXFactory$DefaultLibCProvider$SingletonHolder.<clinit>(POSIXFactory.java:307)
	at org.jruby.dist/jnr.posix.POSIXFactory$DefaultLibCProvider.getLibC(POSIXFactory.java:335)
	at org.jruby.dist/jnr.posix.BaseNativePOSIX.<init>(BaseNativePOSIX.java:41)
	at org.jruby.dist/jnr.posix.LinuxPOSIX.<init>(LinuxPOSIX.java:23)
	at org.jruby.dist/jnr.posix.POSIXFactory.loadLinuxPOSIX(POSIXFactory.java:149)
	at org.jruby.dist/jnr.posix.POSIXFactory.loadNativePOSIX(POSIXFactory.java:124)
	at org.jruby.dist/jnr.posix.POSIXFactory.loadPOSIX(POSIXFactory.java:93)
	at org.jruby.dist/jnr.posix.LazyPOSIX.loadPOSIX(LazyPOSIX.java:40)
	at org.jruby.dist/jnr.posix.LazyPOSIX.posix(LazyPOSIX.java:34)
	at org.jruby.dist/jnr.posix.LazyPOSIX.isNative(LazyPOSIX.java:404)
	at org.jruby.dist/org.jruby.util.io.FilenoUtil.<init>(FilenoUtil.java:44)
	at org.jruby.dist/org.jruby.Ruby.<init>(Ruby.java:297)
	at org.jruby.dist/org.jruby.Ruby.newInstance(Ruby.java:735)
	at org.jruby.dist/org.jruby.Main.internalRun(Main.java:266)
	at org.jruby.dist/org.jruby.Main.run(Main.java:227)
	at org.jruby.dist/org.jruby.Main.main(Main.java:199)
Caused by: java.lang.UnsatisfiedLinkError: could not get native definition for type `POINTER`, original error message follows: java.lang.UnsatisfiedLinkError: Unable to execute or load jffi binary stub from `/tmp`. Set `TMPDIR` or Java property `java.io.tmpdir` to a read/write path that is not mounted "noexec".
/jffi4007658418601151543.so: /lib64/libc.so.6: version `GLIBC_2.27' not found (required by /jffi4007658418601151543.so)
	at org.jruby.dist/com.kenai.jffi.internal.StubLoader.tempLoadError(StubLoader.java:563)
	at org.jruby.dist/com.kenai.jffi.internal.StubLoader.loadFromJar(StubLoader.java:462)
	at org.jruby.dist/com.kenai.jffi.internal.StubLoader.load(StubLoader.java:338)
	at org.jruby.dist/com.kenai.jffi.internal.StubLoader.<clinit>(StubLoader.java:626)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:398)
	at org.jruby.dist/com.kenai.jffi.Init.load(Init.java:68)
	at org.jruby.dist/com.kenai.jffi.Foreign$InstanceHolder.getInstanceHolder(Foreign.java:50)
	at org.jruby.dist/com.kenai.jffi.Foreign$InstanceHolder.<clinit>(Foreign.java:46)
	at org.jruby.dist/com.kenai.jffi.Foreign.getInstance(Foreign.java:104)
	at org.jruby.dist/com.kenai.jffi.Type$Builtin.lookupTypeInfo(Type.java:242)
	at org.jruby.dist/com.kenai.jffi.Type$Builtin.getTypeInfo(Type.java:237)
	at org.jruby.dist/com.kenai.jffi.Type.resolveSize(Type.java:155)
	at org.jruby.dist/com.kenai.jffi.Type.size(Type.java:138)
	at org.jruby.dist/jnr.ffi.provider.jffi.NativeRuntime$TypeDelegate.size(NativeRuntime.java:198)
	at org.jruby.dist/jnr.ffi.provider.AbstractRuntime.<init>(AbstractRuntime.java:48)
	at org.jruby.dist/jnr.ffi.provider.jffi.NativeRuntime.<init>(NativeRuntime.java:77)
	at org.jruby.dist/jnr.ffi.provider.jffi.NativeRuntime.<init>(NativeRuntime.java:49)
	at org.jruby.dist/jnr.ffi.provider.jffi.NativeRuntime$SingletonHolder.<clinit>(NativeRuntime.java:73)
	at org.jruby.dist/jnr.ffi.provider.jffi.NativeRuntime.getInstance(NativeRuntime.java:60)
	at org.jruby.dist/jnr.ffi.provider.jffi.Provider.<init>(Provider.java:29)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at java.base/java.lang.Class.newInstance(Class.java:584)
	at org.jruby.dist/jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.getInstance(FFIProvider.java:68)
	at org.jruby.dist/jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.<clinit>(FFIProvider.java:57)
	at org.jruby.dist/jnr.ffi.provider.FFIProvider.getSystemProvider(FFIProvider.java:35)
	at org.jruby.dist/jnr.ffi.LibraryLoader.create(LibraryLoader.java:89)
	at org.jruby.dist/jnr.posix.POSIXFactory$DefaultLibCProvider$SingletonHolder.<clinit>(POSIXFactory.java:292)
	at org.jruby.dist/jnr.posix.POSIXFactory$DefaultLibCProvider.getLibC(POSIXFactory.java:335)
	at org.jruby.dist/jnr.posix.BaseNativePOSIX.<init>(BaseNativePOSIX.java:41)
	at org.jruby.dist/jnr.posix.LinuxPOSIX.<init>(LinuxPOSIX.java:23)
	at org.jruby.dist/jnr.posix.POSIXFactory.loadLinuxPOSIX(POSIXFactory.java:149)
	at org.jruby.dist/jnr.posix.POSIXFactory.loadNativePOSIX(POSIXFactory.java:124)
	at org.jruby.dist/jnr.posix.POSIXFactory.loadPOSIX(POSIXFactory.java:93)
	at org.jruby.dist/jnr.posix.LazyPOSIX.loadPOSIX(LazyPOSIX.java:40)
	at org.jruby.dist/jnr.posix.LazyPOSIX.posix(LazyPOSIX.java:34)
	at org.jruby.dist/jnr.posix.LazyPOSIX.isNative(LazyPOSIX.java:404)
	at org.jruby.dist/org.jruby.util.io.FilenoUtil.<init>(FilenoUtil.java:44)
	at org.jruby.dist/org.jruby.Ruby.<init>(Ruby.java:297)
	at org.jruby.dist/org.jruby.Ruby.newInstance(Ruby.java:735)
	at org.jruby.dist/org.jruby.Main.internalRun(Main.java:266)
	at org.jruby.dist/org.jruby.Main.run(Main.java:227)
	at org.jruby.dist/org.jruby.Main.main(Main.java:199)
java.lang.UnsatisfiedLinkError: /jruby-9.4.5.0/lib/jni/aarch64-Linux/libjffi-1.2.so: /lib64/libc.so.6: version `GLIBC_2.27' not found (required by /jruby-9.4.5.0/lib/jni/aarch64-Linux/libjffi-1.2.so)
	at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
	at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2450)
	at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2506)
	at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2705)
	at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2635)
	at java.base/java.lang.Runtime.load0(Runtime.java:768)
	at java.base/java.lang.System.load(System.java:1850)
	at org.jruby.dist/com.kenai.jffi.internal.StubLoader.loadFromBootPath(StubLoader.java:405)
	at org.jruby.dist/com.kenai.jffi.internal.StubLoader.load(StubLoader.java:307)
	at org.jruby.dist/com.kenai.jffi.internal.StubLoader.<clinit>(StubLoader.java:626)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:398)
	at org.jruby.dist/com.kenai.jffi.Init.load(Init.java:68)
	at org.jruby.dist/com.kenai.jffi.Foreign$InstanceHolder.getInstanceHolder(Foreign.java:50)
	at org.jruby.dist/com.kenai.jffi.Foreign$InstanceHolder.<clinit>(Foreign.java:46)
	at org.jruby.dist/com.kenai.jffi.Foreign.getInstance(Foreign.java:104)
	at org.jruby.dist/com.kenai.jffi.Type$Builtin.lookupTypeInfo(Type.java:242)
	at org.jruby.dist/com.kenai.jffi.Type$Builtin.getTypeInfo(Type.java:237)
	at org.jruby.dist/com.kenai.jffi.Type.resolveSize(Type.java:155)
	at org.jruby.dist/com.kenai.jffi.Type.size(Type.java:138)
	at org.jruby.dist/jnr.ffi.provider.jffi.NativeRuntime$TypeDelegate.size(NativeRuntime.java:198)
	at org.jruby.dist/jnr.ffi.provider.AbstractRuntime.<init>(AbstractRuntime.java:48)
	at org.jruby.dist/jnr.ffi.provider.jffi.NativeRuntime.<init>(NativeRuntime.java:77)
	at org.jruby.dist/jnr.ffi.provider.jffi.NativeRuntime.<init>(NativeRuntime.java:49)
	at org.jruby.dist/jnr.ffi.provider.jffi.NativeRuntime$SingletonHolder.<clinit>(NativeRuntime.java:73)
	at org.jruby.dist/jnr.ffi.provider.jffi.NativeRuntime.getInstance(NativeRuntime.java:60)
	at org.jruby.dist/jnr.ffi.provider.jffi.Provider.<init>(Provider.java:29)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at java.base/java.lang.Class.newInstance(Class.java:584)
	at org.jruby.dist/jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.getInstance(FFIProvider.java:68)
	at org.jruby.dist/jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.<clinit>(FFIProvider.java:57)
	at org.jruby.dist/jnr.ffi.provider.FFIProvider.getSystemProvider(FFIProvider.java:35)
	at org.jruby.dist/jnr.ffi.LibraryLoader.create(LibraryLoader.java:89)
	at org.jruby.dist/jnr.posix.POSIXFactory$DefaultLibCProvider$SingletonHolder.<clinit>(POSIXFactory.java:292)
	at org.jruby.dist/jnr.posix.POSIXFactory$DefaultLibCProvider.getLibC(POSIXFactory.java:335)
	at org.jruby.dist/jnr.posix.BaseNativePOSIX.<init>(BaseNativePOSIX.java:41)
	at org.jruby.dist/jnr.posix.LinuxPOSIX.<init>(LinuxPOSIX.java:23)
	at org.jruby.dist/jnr.posix.POSIXFactory.loadLinuxPOSIX(POSIXFactory.java:149)
	at org.jruby.dist/jnr.posix.POSIXFactory.loadNativePOSIX(POSIXFactory.java:124)
	at org.jruby.dist/jnr.posix.POSIXFactory.loadPOSIX(POSIXFactory.java:93)
	at org.jruby.dist/jnr.posix.LazyPOSIX.loadPOSIX(LazyPOSIX.java:40)
	at org.jruby.dist/jnr.posix.LazyPOSIX.posix(LazyPOSIX.java:34)
	at org.jruby.dist/jnr.posix.LazyPOSIX.isNative(LazyPOSIX.java:404)
	at org.jruby.dist/org.jruby.util.io.FilenoUtil.<init>(FilenoUtil.java:44)
	at org.jruby.dist/org.jruby.Ruby.<init>(Ruby.java:297)
	at org.jruby.dist/org.jruby.Ruby.newInstance(Ruby.java:735)
	at org.jruby.dist/org.jruby.Main.internalRun(Main.java:266)
	at org.jruby.dist/org.jruby.Main.run(Main.java:227)
	at org.jruby.dist/org.jruby.Main.main(Main.java:199)

	at org.jruby.dist/com.kenai.jffi.Type$Builtin.lookupTypeInfo(Type.java:253)
	at org.jruby.dist/com.kenai.jffi.Type$Builtin.getTypeInfo(Type.java:237)
	at org.jruby.dist/com.kenai.jffi.Type.resolveSize(Type.java:155)
	at org.jruby.dist/com.kenai.jffi.Type.size(Type.java:138)
	at org.jruby.dist/jnr.ffi.provider.jffi.NativeRuntime$TypeDelegate.size(NativeRuntime.java:198)
	at org.jruby.dist/jnr.ffi.provider.AbstractRuntime.<init>(AbstractRuntime.java:48)
	at org.jruby.dist/jnr.ffi.provider.jffi.NativeRuntime.<init>(NativeRuntime.java:77)
	at org.jruby.dist/jnr.ffi.provider.jffi.NativeRuntime.<init>(NativeRuntime.java:49)
	at org.jruby.dist/jnr.ffi.provider.jffi.NativeRuntime$SingletonHolder.<clinit>(NativeRuntime.java:73)
	at org.jruby.dist/jnr.ffi.provider.jffi.NativeRuntime.getInstance(NativeRuntime.java:60)
	at org.jruby.dist/jnr.ffi.provider.jffi.Provider.<init>(Provider.java:29)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at java.base/java.lang.Class.newInstance(Class.java:584)
	at org.jruby.dist/jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.getInstance(FFIProvider.java:68)
	at org.jruby.dist/jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.<clinit>(FFIProvider.java:57)
	at org.jruby.dist/jnr.ffi.provider.FFIProvider.getSystemProvider(FFIProvider.java:35)
	at org.jruby.dist/jnr.ffi.LibraryLoader.create(LibraryLoader.java:89)
	at org.jruby.dist/jnr.posix.POSIXFactory$DefaultLibCProvider$SingletonHolder.<clinit>(POSIXFactory.java:292)
	... 15 more
Tue Jan 16 12:37:37 UTC 2024

@headius
Copy link
Member Author

headius commented Jan 19, 2024

Hmm well I guess we could try to set up a build job using centos:7? That would certainly ensure we work on that configuration!

@headius
Copy link
Member Author

headius commented Jan 19, 2024

The complication here is that our cross-platform build on GHA is designed around Debian, so we'd need to make a special build based on CentOS (package names etc) to force this build against older glibc.

@headius
Copy link
Member Author

headius commented Feb 13, 2024

There's some updates in jnr/jffi#138 and a build with newer libffi that may not force a dependency on newer glibc via the memfd_create function...

@headius
Copy link
Member Author

headius commented Feb 14, 2024

Fixed by #8105

@headius headius closed this as completed Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants