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

java.lang.UnsatisfiedLinkError: could not get native definition for type POINTER #4702

Closed
florianmutter opened this issue Feb 9, 2023 · 4 comments
Assignees
Milestone

Comments

@florianmutter
Copy link

florianmutter commented Feb 9, 2023

After updating to 1.7.0 from 0.115.0 we get the following error on startup of our services:

Exception in thread "main" java.lang.UnsatisfiedLinkError: could not load FFI provider ddtrot.jnr.ffi.provider.jffi.Provider
	at ddtrot.jnr.ffi.provider.InvalidProvider$1.loadLibrary(InvalidProvider.java:49)
	at ddtrot.jnr.ffi.LibraryLoader.load(LibraryLoader.java:420)
	at ddtrot.jnr.unixsocket.Native.<clinit>(Native.java:80)
	at ddtrot.jnr.unixsocket.UnixSocketChannel.<init>(UnixSocketChannel.java:101)
	at ddtrot.jnr.unixsocket.UnixSocketChannel.open(UnixSocketChannel.java:60)
	at ddtrot.dd.common.socket.UnixDomainSocketFactory.createSocket(UnixDomainSocketFactory.java:27)
	at ddtrot.okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:241)
	at ddtrot.okhttp3.internal.connection.RealConnection.connect(RealConnection.java:167)
	at ddtrot.okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:258)
	at ddtrot.okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135)
	at ddtrot.okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114)
	at ddtrot.okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
	at ddtrot.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at ddtrot.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
	at ddtrot.okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
	at ddtrot.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at ddtrot.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
	at ddtrot.okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
	at ddtrot.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at ddtrot.okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:127)
	at ddtrot.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at ddtrot.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
	at ddtrot.okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:257)
	at ddtrot.okhttp3.RealCall.execute(RealCall.java:93)
	at ddtrot.dd.communication.ddagent.DDAgentFeaturesDiscovery.doDiscovery(DDAgentFeaturesDiscovery.java:132)
	at ddtrot.dd.communication.ddagent.DDAgentFeaturesDiscovery.discoverIfOutdated(DDAgentFeaturesDiscovery.java:117)
	at ddtrot.dd.communication.ddagent.DDAgentFeaturesDiscovery.discover(DDAgentFeaturesDiscovery.java:105)
	at ddtrot.dd.communication.ddagent.SharedCommunicationObjects.featuresDiscovery(SharedCommunicationObjects.java:83)
	at ddtrot.dd.trace.common.writer.WriterFactory.createWriter(WriterFactory.java:80)
	at ddtrot.dd.trace.common.writer.WriterFactory.createWriter(WriterFactory.java:42)
	at ddtrot.dd.trace.core.CoreTracer.<init>(CoreTracer.java:529)
	at ddtrot.dd.trace.core.CoreTracer.<init>(CoreTracer.java:101)
	at ddtrot.dd.trace.core.CoreTracer$CoreTracerBuilder.build(CoreTracer.java:399)
	at datadog.opentracing.DDTracer.<init>(DDTracer.java:402)
	at datadog.opentracing.DDTracer.<init>(DDTracer.java:41)
	at datadog.opentracing.DDTracer$DDTracerBuilder.build(DDTracer.java:168)
	at com.example.tracing.SetupKt.initTracing(Setup.kt:38)
	at com.example.lifecycle.LifecycleKt.runApplication(Lifecycle.kt:73)
	at com.example.lifecycle.LifecycleKt.runService(Lifecycle.kt:47)
	at com.example.myService.MainKt.main(Main.kt:61)
	at com.example.myService.MainKt.main(Main.kt)
Caused by: java.lang.UnsatisfiedLinkError: could not get native definition for type `POINTER`, original error message follows: 'int ddtrot.com.kenai.jffi.Foreign.getVersion()'
	at ddtrot.com.kenai.jffi.Type$Builtin.lookupTypeInfo(Type.java:253)
	at ddtrot.com.kenai.jffi.Type$Builtin.getTypeInfo(Type.java:237)
	at ddtrot.com.kenai.jffi.Type.resolveSize(Type.java:155)
	at ddtrot.com.kenai.jffi.Type.size(Type.java:138)
	at ddtrot.jnr.ffi.provider.jffi.NativeRuntime$TypeDelegate.size(NativeRuntime.java:198)
	at ddtrot.jnr.ffi.provider.AbstractRuntime.<init>(AbstractRuntime.java:48)
	at ddtrot.jnr.ffi.provider.jffi.NativeRuntime.<init>(NativeRuntime.java:77)
	at ddtrot.jnr.ffi.provider.jffi.NativeRuntime.<init>(NativeRuntime.java:49)
	at ddtrot.jnr.ffi.provider.jffi.NativeRuntime$SingletonHolder.<clinit>(NativeRuntime.java:73)
	at ddtrot.jnr.ffi.provider.jffi.NativeRuntime.getInstance(NativeRuntime.java:60)
	at ddtrot.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:77)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
	at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128)
	at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347)
	at java.base/java.lang.Class.newInstance(Class.java:645)
	at ddtrot.jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.getInstance(FFIProvider.java:68)
	at ddtrot.jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.<clinit>(FFIProvider.java:57)
	at ddtrot.jnr.ffi.provider.FFIProvider.getSystemProvider(FFIProvider.java:35)
	at ddtrot.jnr.ffi.LibraryLoader.create(LibraryLoader.java:89)
	at ddtrot.jnr.unixsocket.Native.<clinit>(Native.java:76)
	... 38 more

This is a kotlin service using gradle. The base image we run on is openjdk:17-jdk-bullseye. This is the output of uname -a:

Linux example-7c84f9446c-qfkwv 5.10.147+ jnr/jnr-ffi#1 SMP Thu Nov 10 10:14:30 UTC 2022 x86_64 GNU/Linux
@mcculls
Copy link
Contributor

mcculls commented Feb 9, 2023

This sounds related to jnr/jffi#138

We upgraded jnr_unixsocket from 0.28 to 0.38.17 between those releases of the Java tracer

@mcculls
Copy link
Contributor

mcculls commented Feb 9, 2023

Another possibility is that the recent ddtrot repackaging/shading is confusing JNI - that could be more likely as Foreign.getVersion() is a native method - we'll try to recreate this locally and confirm

@mcculls mcculls self-assigned this Feb 22, 2023
@mcculls
Copy link
Contributor

mcculls commented Feb 22, 2023

Recreated and fixed in #4779 which will be available in 1.9.0 (expected soon)

@bantonsson bantonsson added this to the 1.9.0 milestone Feb 22, 2023
@github-actions
Copy link
Contributor

🤖 This issue has been addressed in the latest release. See full details in the Release Notes.

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

3 participants