DataDog / dd-trace-java

Datadog APM client for Java
https://docs.datadoghq.com/tracing/languages/java
Apache License 2.0
573 stars 285 forks source link

DatadogProfiler: failed to instantiate Datadog profiler on linux arm64 because: libjavaProfiler.so not found on classpath #6539

Closed thpoiani closed 7 months ago

thpoiani commented 8 months ago

Hello Datadog Team!

I'm attempting to activate the profiler in a Quarkus GraalVM Native Executable application, a feature introduced in the dd-trace-java 1.25.1 version. The build step is running within a Linux ARM64 container. However, I'm encountering the following warning, and it appears that the profiler is not successfully enabled:

WARN com.datadog.profiling.ddprof.DatadogProfiler - failed to instantiate Datadog profiler on linux arm64 because: /META-INF/native-libs/linux-arm64/libjavaProfiler.so not found on classpath

Use the following Dockerfile to reproduce this behaviour:

FROM quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:jdk-21.0.2-arm64

USER root
RUN microdnf install wget

RUN wget -O code-with-quarkus.zip 'https://code.quarkus.io/d?e=resteasy-reactive&S=io.quarkus.platform%3A3.6&cn=code.quarkus.io' \
    && unzip code-with-quarkus.zip \
    && wget -O code-with-quarkus/dd-java-agent.jar 'https://github.com/DataDog/dd-trace-java/releases/download/v1.27.0/dd-java-agent-1.27.0.jar'

WORKDIR /project/code-with-quarkus

RUN ./mvnw package -Dnative -Dquarkus.native.additional-build-args=-J-javaagent:/project/code-with-quarkus/dd-java-agent.jar,-J-Ddd.profiling.enabled=true
docker build . --progress=plain ``` #8 60.24 [INFO] --- quarkus:3.6.6:build (default) @ code-with-quarkus --- #8 60.74 [INFO] [io.quarkus.deployment.pkg.steps.JarResultBuildStep] Building native image source jar: /project/code-with-quarkus/target/code-with-quarkus-1.0.0-SNAPSHOT-native-image-source-jar/code-with-quarkus-1.0.0-SNAPSHOT-runner.jar #8 60.94 [INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Building native image from /project/code-with-quarkus/target/code-with-quarkus-1.0.0-SNAPSHOT-native-image-source-jar/code-with-quarkus-1.0.0-SNAPSHOT-runner.jar #8 60.95 [INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Running Quarkus native-image plugin on GRAALVM 23.1 JDK 21.0.2+13-jvmci-23.1-b30 #8 60.95 [INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildRunner] /opt/graalvm/bin/native-image -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dlogging.initial-configurator.min-level=500 -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=3 -J-Duser.language=en -J-Duser.country=US -J-Dfile.encoding=UTF-8 --features=io.quarkus.runner.Feature,io.quarkus.runtime.graal.DisableLoggingFeature -J--add-exports=java.security.jgss/sun.security.krb5=ALL-UNNAMED -J--add-opens=java.base/java.text=ALL-UNNAMED -J--add-opens=java.base/java.io=ALL-UNNAMED -J--add-opens=java.base/java.lang.invoke=ALL-UNNAMED -J--add-opens=java.base/java.util=ALL-UNNAMED -H:+UnlockExperimentalVMOptions -H:BuildOutputJSONFile=code-with-quarkus-1.0.0-SNAPSHOT-runner-build-output-stats.json -H:-UnlockExperimentalVMOptions --strict-image-heap -J-javaagent:/project/code-with-quarkus/dd-java-agent.jar -J-Ddd.profiling.enabled=true -H:+UnlockExperimentalVMOptions -H:+AllowFoldMethods -H:-UnlockExperimentalVMOptions -J-Djava.awt.headless=true --no-fallback --link-at-build-time -H:+UnlockExperimentalVMOptions -H:+ReportExceptionStackTraces -H:-UnlockExperimentalVMOptions -H:-AddAllCharsets --enable-url-protocols=http -H:NativeLinkerOption=-no-pie --enable-monitoring=heapdump -H:+UnlockExperimentalVMOptions -H:-UseServiceLoaderFeature -H:-UnlockExperimentalVMOptions -J--add-exports=org.graalvm.nativeimage/org.graalvm.nativeimage.impl=ALL-UNNAMED --exclude-config io\.netty\.netty-codec /META-INF/native-image/io\.netty/netty-codec/generated/handlers/reflect-config\.json --exclude-config io\.netty\.netty-handler /META-INF/native-image/io\.netty/netty-handler/generated/handlers/reflect-config\.json code-with-quarkus-1.0.0-SNAPSHOT-runner -jar code-with-quarkus-1.0.0-SNAPSHOT-runner.jar #8 60.97 Warning: The option '-H:ReflectionConfigurationResources=META-INF/native-image/io.netty/netty-transport/reflection-config.json' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future. #8 60.97 Warning: Please re-evaluate whether any experimental option is required, and either remove or unlock it. The build output lists all active experimental options, including where they come from and possible alternatives. If you think an experimental option should be considered as stable, please file an issue. #8 63.74 ======================================================================================================================== #8 63.74 GraalVM Native Image: Generating 'code-with-quarkus-1.0.0-SNAPSHOT-runner' (executable)... #8 63.74 ======================================================================================================================== #8 63.74 For detailed information and explanations on the build output, visit: #8 63.74 https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/BuildOutput.md #8 63.74 ------------------------------------------------------------------------------------------------------------------------ #8 65.00 [1/8] Initializing... (3.0s @ 0.13GB) #8 65.00 Java version: 21.0.2+13, vendor version: GraalVM CE 21.0.2+13.1 #8 65.00 Graal compiler: optimization level: 2, target machine: armv8-a #8 65.00 C compiler: gcc (redhat, aarch64, 8.5.0) #8 65.00 Garbage collector: Serial GC (max heap size: 80% of RAM) #8 65.00 3 user-specific feature(s): #8 65.00 - com.oracle.svm.thirdparty.gson.GsonFeature #8 65.00 - io.quarkus.runner.Feature: Auto-generated class by Quarkus from the existing extensions #8 65.00 - io.quarkus.runtime.graal.DisableLoggingFeature: Disables INFO logging during the analysis phase #8 65.00 ------------------------------------------------------------------------------------------------------------------------ #8 65.00 7 experimental option(s) unlocked: #8 65.00 - '-H:ClassInitialization' (alternative API option(s): --initialize-at-run-time=com.datadog.profiling.controller.openjdk.events.AvailableProcessorCoresEvent:build_time,com.datadog.profiling.controller.openjdk.events.ProfilerSettingEvent:build_time,com.datadog.profiling.controller.openjdk.events.TimelineEvent:build_time,datadog.trace.api.Config:rerun,datadog.trace.api.Platform:rerun,datadog.trace.api.Platform$Captured:build_time,datadog.trace.api.env.CapturedEnvironment:build_time,datadog.trace.api.ConfigCollector:rerun,datadog.trace.api.ConfigDefaults:build_time,datadog.trace.api.ConfigSetting:build_time,datadog.trace.api.InstrumenterConfig:build_time,datadog.trace.api.Functions:build_time,datadog.trace.api.GlobalTracer:build_time,datadog.trace.api.MethodFilterConfigParser:build_time,datadog.trace.api.WithGlobalTracer:build_time,datadog.trace.api.PropagationStyle:build_time,datadog.trace.bootstrap.config.provider.ConfigConverter:build_time,datadog.trace.bootstrap.config.provider.ConfigProvider:build_time,datadog.trace.bootstrap.config.provider.ConfigProvider$Singleton:build_time,datadog.trace.bootstrap.Agent:build_time,datadog.trace.bootstrap.BootstrapProxy:build_time,datadog.trace.bootstrap.CallDepthThreadLocalMap:build_time,datadog.trace.bootstrap.DatadogClassLoader:build_time,datadog.trace.bootstrap.InstrumentationClassLoader:build_time,datadog.trace.bootstrap.FieldBackedContextStores:build_time,datadog.trace.bootstrap.benchmark.StaticEventLogger:build_time,datadog.trace.bootstrap.instrumentation.java.concurrent.ConcurrentState:build_time,datadog.trace.bootstrap.instrumentation.java.concurrent.ExcludeFilter:build_time,datadog.trace.bootstrap.instrumentation.java.concurrent.QueueTimeHelper:build_time,datadog.trace.bootstrap.instrumentation.java.concurrent.TPEHelper:build_time,datadog.trace.bootstrap.instrumentation.jfr.exceptions.ExceptionCountEvent:build_time,datadog.trace.bootstrap.instrumentation.jfr.exceptions.ExceptionSampleEvent:build_time,datadog.trace.logging.LoggingSettingsDescription:build_time,datadog.trace.logging.simplelogger.SLCompatFactory:build_time,datadog.trace.util.CollectionUtils:build_time,datadog.slf4j.impl.StaticLoggerBinder:build_time,datadog.slf4j.LoggerFactory:build_time,com.blogspot.mydailyjava.weaklockfree.WeakConcurrentMap:build_time,net.bytebuddy:build_time,com.sun.proxy:build_time,jnr.enxio.channels:run_time,jnr.unixsocket:run_time, --initialize-at-run-time=io.netty.handler.codec.compression.BrotliDecoder:run_time, --initialize-at-run-time=io.netty.util.AbstractReferenceCounted:run_time,io.netty.util.concurrent.GlobalEventExecutor:run_time,io.netty.util.concurrent.ImmediateEventExecutor:run_time,io.netty.util.concurrent.ScheduledFutureTask:run_time,io.netty.util.internal.ThreadLocalRandom:run_time, --initialize-at-run-time=io.netty.util.NetUtilSubstitutions$NetUtilLocalhost4LazyHolder:run_time, --initialize-at-run-time=io.netty.util.NetUtilSubstitutions$NetUtilLocalhost6LazyHolder:run_time, --initialize-at-run-time=io.netty.util.NetUtilSubstitutions$NetUtilLocalhostLazyHolder:run_time, --initialize-at-run-time=io.netty.util.NetUtilSubstitutions$NetUtilNetworkInterfacesLazyHolder:run_time, --initialize-at-run-time=io.netty.buffer.PooledByteBufAllocator:run_time,io.netty.buffer.ByteBufAllocator:run_time,io.netty.buffer.ByteBufUtil:run_time,io.netty.buffer.AbstractReferenceCountedByteBuf:run_time, --initialize-at-run-time=io.netty.handler.ssl.util.ThreadLocalInsecureRandom:run_time, --initialize-at-run-time=io.netty:build_time, --initialize-at-run-time=io.netty.handler.codec.http.HttpObjectEncoder:run_time,io.netty.handler.codec.http.websocketx.WebSocket00FrameEncoder:run_time,io.netty.handler.codec.http.websocketx.extensions.compression.DeflateDecoder:run_time, --initialize-at-run-time=io.netty:build_time, --initialize-at-run-time=io.netty.handler.codec.http2.Http2CodecUtil:run_time,io.netty.handler.codec.http2.Http2ClientUpgradeCodec:run_time,io.netty.handler.codec.http2.Http2ConnectionHandler:run_time,io.netty.handler.codec.http2.DefaultHttp2FrameWriter:run_time, --initialize-at-run-time=io.netty.resolver.dns.DefaultDnsServerAddressStreamProvider:run_time, --initialize-at-run-time=io.netty.resolver.dns.DnsServerAddressStreamProviders$DefaultProviderHolder:run_time, --initialize-at-run-time=io.netty.resolver.dns.DnsNameResolver:run_time, --initialize-at-run-time=io.netty.resolver.HostsFileEntriesResolver:run_time; origin(s): command line) #8 65.00 - '-H:+AllowFoldMethods' (origin(s): command line) #8 65.00 - '-H:EnableURLProtocols' (alternative API option(s): --enable-http, --enable-http; origin(s): command line) #8 65.00 - '-H:BuildOutputJSONFile' (origin(s): command line) #8 65.00 - '-H:-UseServiceLoaderFeature' (origin(s): command line) #8 65.00 - '-H:IncludeResources' (origin(s): command line) #8 65.00 - '-H:ReflectionConfigurationResources' (origin(s): command line, 'META-INF/native-image/io.netty/netty-transport/native-image.properties' in 'file:///project/code-with-quarkus/target/code-with-quarkus-1.0.0-SNAPSHOT-native-image-source-jar/lib/io.netty.netty-transport-4.1.100.Final.jar') #8 65.01 ------------------------------------------------------------------------------------------------------------------------ #8 65.01 Build resources: #8 65.01 - 5.79GB of memory (75.6% of 7.66GB system memory, determined at start) #8 65.01 - 12 thread(s) (100.0% of 12 available processor(s), determined at start) #8 71.62 [dd.trace 2024-01-23 15:31:01:379 +0000] [ForkJoinPool-2-worker-10] ERROR datadog.common.version.VersionInfo - No version file found #8 73.67 [dd.trace 2024-01-23 15:31:03:439 +0000] [ForkJoinPool-2-worker-11] WARN com.datadog.profiling.ddprof.DatadogProfiler - failed to instantiate Datadog profiler on linux arm64 because: /META-INF/native-libs/linux-arm64/libjavaProfiler.so not found on classpath #8 75.61 [14.527s][warning][jfr] @Name ignored, not a valid Java identifier. #8 84.89 [2/8] Performing analysis... [*****] (19.8s @ 1.28GB) #8 84.90 13,207 reachable types (87.1% of 15,171 total) #8 84.90 19,689 reachable fields (54.4% of 36,171 total) #8 84.94 65,550 reachable methods (57.2% of 114,697 total) #8 84.94 4,087 types, 257 fields, and 3,366 methods registered for reflection #8 84.94 61 types, 61 fields, and 55 methods registered for JNI access #8 84.94 4 native libraries: dl, pthread, rt, z #8 87.58 [3/8] Building universe... (2.6s @ 1.24GB) #8 89.41 [4/8] Parsing methods... [*] (1.8s @ 1.71GB) #8 90.55 [5/8] Inlining methods... [***] (1.0s @ 1.21GB) #8 104.3 [6/8] Compiling methods... [****] (13.8s @ 1.20GB) #8 106.7 [7/8] Layouting methods... [**] (2.4s @ 1.95GB) #8 110.2 [8/8] Creating image... [**] (3.4s @ 1.47GB) #8 110.2 22.42MB (42.22%) for code area: 41,319 compilation units #8 110.2 30.33MB (57.11%) for image heap: 355,402 objects and 65 resources #8 110.2 367.14kB ( 0.68%) for other data #8 110.2 53.11MB in total #8 110.2 ------------------------------------------------------------------------------------------------------------------------ #8 110.2 Top 10 origins of code area: Top 10 object types in image heap: #8 110.2 10.81MB java.base 8.18MB byte[] for code metadata #8 110.2 1.38MB svm.jar (Native Image) 4.57MB byte[] for java.lang.String #8 110.2 798.02kB modified-io.vertx.vertx-core-4.4.6.jar 3.23MB java.lang.Class #8 110.2 744.85kB code-with-quarkus-1.0.0-SNAPSHOT-runner.jar 3.20MB java.lang.String #8 110.2 615.18kB jdk.jfr 1.21MB com.oracle.svm.core.hub.DynamicHubCompanion #8 110.2 493.80kB io.netty.netty-buffer-4.1.100.Final.jar 1001.98kB byte[] for general heap data #8 110.2 435.96kB io.netty.netty-common-4.1.100.Final.jar 742.45kB byte[] for reflection metadata #8 110.2 408.07kB java.management 648.12kB java.lang.String[] #8 110.2 385.72kB io.netty.netty-transport-4.1.100.Final.jar 484.17kB java.util.HashMap$Node #8 110.2 366.21kB io.netty.netty-codec-http-4.1.100.Final.jar 478.71kB c.o.svm.core.hub.DynamicHub$ReflectionMetadata #8 110.2 5.85MB for 189 more packages 6.66MB for 3412 more object types #8 110.2 ------------------------------------------------------------------------------------------------------------------------ #8 110.2 Recommendations: #8 110.2 HEAP: Set max heap for improved and more predictable memory usage. #8 110.2 CPU: Enable more CPU features with '-march=native' for improved performance. #8 110.2 ------------------------------------------------------------------------------------------------------------------------ #8 110.2 5.1s (10.4% of total time) in 206 GCs | Peak RSS: 3.25GB | CPU load: 8.71 #8 110.2 ------------------------------------------------------------------------------------------------------------------------ #8 110.2 Produced artifacts: #8 110.2 /project/code-with-quarkus/target/code-with-quarkus-1.0.0-SNAPSHOT-native-image-source-jar/code-with-quarkus-1.0.0-SNAPSHOT-runner (executable) #8 110.2 /project/code-with-quarkus/target/code-with-quarkus-1.0.0-SNAPSHOT-native-image-source-jar/code-with-quarkus-1.0.0-SNAPSHOT-runner-build-output-stats.json (build_info) #8 110.2 ======================================================================================================================== #8 110.2 Finished generating 'code-with-quarkus-1.0.0-SNAPSHOT-runner' in 48.2s. #8 110.7 [INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildRunner] objcopy --strip-debug code-with-quarkus-1.0.0-SNAPSHOT-runner #8 110.8 [INFO] [io.quarkus.deployment.QuarkusAugmentor] Quarkus augmentation completed in 50518ms ```

Let me share some assumptions regarding this warning, it could support the investigation:


FROM quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:jdk-21.0.2-arm64

USER root
RUN microdnf install wget

RUN wget --no-verbose -O dd-java-agent.jar 'https://github.com/DataDog/dd-trace-java/releases/download/v1.27.0/dd-java-agent-1.27.0.jar' \
    && jar xf dd-java-agent.jar \
    && ls -R profiling/META-INF
docker build . --progress=plain ``` #6 5.230 profiling/META-INF: #6 5.230 MANIFEST.MF #6 5.230 native-libs #6 5.230 services #6 5.230 #6 5.230 profiling/META-INF/native-libs: #6 5.230 linux-arm64 #6 5.230 linux-arm64-musl #6 5.230 linux-x64 #6 5.230 linux-x64-musl #6 5.230 #6 5.230 profiling/META-INF/native-libs/linux-arm64: #6 5.230 libjavaProfiler.so #6 5.230 #6 5.230 profiling/META-INF/native-libs/linux-arm64-musl: #6 5.230 libjavaProfiler.so #6 5.230 #6 5.230 profiling/META-INF/native-libs/linux-x64: #6 5.230 libjavaProfiler.so #6 5.230 #6 5.230 profiling/META-INF/native-libs/linux-x64-musl: #6 5.230 libjavaProfiler.so #6 5.230 #6 5.230 profiling/META-INF/services: #6 5.230 com.datadog.profiling.auxiliary.AuxiliaryImplementation$Provider #6 5.230 com.datadog.profiling.controller.jfr.JFRAccess$Factory ```



Kindly request the Datadog Team to investigate this issue. 🙇


I believe that https://github.com/DataDog/dd-trace-java/issues/6443 seems somehow related, as the NativeImageGeneratorRunnerInstrumentation.java tries to include .*dd-.*version$ version files

jbachorik commented 8 months ago

Hi @thpoiani - first of all, thanks for reporting this!

Did you verify that profiling is not working at all? The warning message is appearing because we are trying to check for the profiler library first and then fall back to JFR. Since it is not possible to use native JVMTI agents in the native image we will always fall back to JFR. I will fix the enablement process to be aware of the native image build process and not output noisy warnings. But if you find the profiler not working at all, please, let us know - we would need to investigate because the profiling capacity should not be affected by the warning you are seeing.

thpoiani commented 8 months ago

Thanks for the information @jbachorik, makes sense to use JFR 👍

Let me share my application deployment context:

quarkus.native.additional-build-args=\
  -J-javaagent:/opt/dd-java-agent-1.27.0.jar,\
  -J-Ddd.profiling.enabled=true
Build step ``` 09:28:28 [INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Running Quarkus native-image plugin on GRAALVM 23.1 JDK 21.0.1+12-jvmci-23.1-b19 09:28:28 [INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildRunner] /usr/lib/jvm/graalvm/bin/native-image -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Dlogging.initial-configurator.min-level=500 -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=3 -J-Duser.language=en -J-Dfile.encoding=UTF-8 --features=io.quarkus.hibernate.validator.runtime.DisableLoggingFeature,ca.skipthedishes.quarkus.extensions.okhttp.runtime.graal.OkHttpFeature,io.quarkus.runner.Feature,io.quarkus.runtime.graal.DisableLoggingFeature -J--add-exports=java.security.jgss/sun.security.krb5=ALL-UNNAMED -J--add-opens=java.base/java.text=ALL-UNNAMED -J--add-opens=java.base/java.io=ALL-UNNAMED -J--add-opens=java.base/java.lang.invoke=ALL-UNNAMED -J--add-opens=java.base/java.util=ALL-UNNAMED -H:+UnlockExperimentalVMOptions -H:BuildOutputJSONFile=application-name-runner-build-output-stats.json -H:-UnlockExperimentalVMOptions --strict-image-heap -J-javaagent:/opt/deploy/extras/dd-java-agent.jar -J-Ddd.profiling.enabled=true -H:+UnlockExperimentalVMOptions -H:+AllowFoldMethods -H:-UnlockExperimentalVMOptions -J-Djava.awt.headless=true --no-fallback --link-at-build-time -H:+UnlockExperimentalVMOptions -H:+ReportExceptionStackTraces -H:-UnlockExperimentalVMOptions -H:-AddAllCharsets --enable-url-protocols=http,https -H:NativeLinkerOption=-no-pie --enable-monitoring=heapdump -H:+UnlockExperimentalVMOptions -H:-UseServiceLoaderFeature -H:-UnlockExperimentalVMOptions -J--add-exports=org.graalvm.nativeimage/org.graalvm.nativeimage.impl=ALL-UNNAMED --exclude-config io\.netty\.netty-codec /META-INF/native-image/io\.netty/netty-codec/generated/handlers/reflect-config\.json --exclude-config io\.netty\.netty-handler /META-INF/native-image/io\.netty/netty-handler/generated/handlers/reflect-config\.json application-name-runner -jar application-name-runner.jar 09:28:28 Warning: The option '-H:ReflectionConfigurationResources=META-INF/native-image/io.micrometer/micrometer-core/reflect-config.json' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future. 09:28:28 Warning: The option '-H:ReflectionConfigurationResources=META-INF/native-image/io.netty/netty-transport/reflection-config.json' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future. 09:28:28 Warning: The option '-H:IncludeResources=rabbitmq-amqp-client.properties|version.properties' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future. 09:28:28 Warning: Please re-evaluate whether any experimental option is required, and either remove or unlock it. The build output lists all active experimental options, including where they come from and possible alternatives. If you think an experimental option should be considered as stable, please file an issue. 09:28:46 ======================================================================================================================== 09:28:46 GraalVM Native Image: Generating 'application-name-runner' (executable)... 09:28:46 ======================================================================================================================== 09:28:46 For detailed information and explanations on the build output, visit: 09:28:46 https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/BuildOutput.md 09:28:46 ------------------------------------------------------------------------------------------------------------------------ 09:28:50 [1/8] Initializing... (17.8s @ 0.19GB) 09:28:50 Java version: 21.0.1+12, vendor version: GraalVM CE 21.0.1+12.1 09:28:50 Graal compiler: optimization level: 2, target machine: armv8-a 09:28:50 C compiler: gcc (linux, aarch64, 12.2.0) 09:28:50 Garbage collector: Serial GC (max heap size: 80% of RAM) 09:28:50 5 user-specific feature(s): 09:28:50 - ca.skipthedishes.quarkus.extensions.okhttp.runtime.graal.OkHttpFeature 09:28:50 - com.oracle.svm.thirdparty.gson.GsonFeature 09:28:50 - io.quarkus.hibernate.validator.runtime.DisableLoggingFeature: Disables INFO logging during the analysis phase for the [org.hibernate.validator.internal.util.Version] categories 09:28:50 - io.quarkus.runner.Feature: Auto-generated class by Quarkus from the existing extensions 09:28:50 - io.quarkus.runtime.graal.DisableLoggingFeature: Disables INFO logging during the analysis phase 09:28:50 ------------------------------------------------------------------------------------------------------------------------ 09:28:50 7 experimental option(s) unlocked: 09:28:50 - '-H:ClassInitialization' (alternative API option(s): --initialize-at-run-time=com.datadog.profiling.controller.openjdk.events.AvailableProcessorCoresEvent:build_time,com.datadog.profiling.controller.openjdk.events.ProfilerSettingEvent:build_time,com.datadog.profiling.controller.openjdk.events.TimelineEvent:build_time,datadog.trace.api.Config:rerun,datadog.trace.api.Platform:rerun,datadog.trace.api.Platform$Captured:build_time,datadog.trace.api.env.CapturedEnvironment:build_time,datadog.trace.api.ConfigCollector:rerun,datadog.trace.api.ConfigDefaults:build_time,datadog.trace.api.ConfigSetting:build_time,datadog.trace.api.InstrumenterConfig:build_time,datadog.trace.api.Functions:build_time,datadog.trace.api.GlobalTracer:build_time,datadog.trace.api.MethodFilterConfigParser:build_time,datadog.trace.api.WithGlobalTracer:build_time,datadog.trace.api.PropagationStyle:build_time,datadog.trace.bootstrap.config.provider.ConfigConverter:build_time,datadog.trace.bootstrap.config.provider.ConfigProvider:build_time,datadog.trace.bootstrap.config.provider.ConfigProvider$Singleton:build_time,datadog.trace.bootstrap.Agent:build_time,datadog.trace.bootstrap.BootstrapProxy:build_time,datadog.trace.bootstrap.CallDepthThreadLocalMap:build_time,datadog.trace.bootstrap.DatadogClassLoader:build_time,datadog.trace.bootstrap.InstrumentationClassLoader:build_time,datadog.trace.bootstrap.FieldBackedContextStores:build_time,datadog.trace.bootstrap.benchmark.StaticEventLogger:build_time,datadog.trace.bootstrap.instrumentation.java.concurrent.ConcurrentState:build_time,datadog.trace.bootstrap.instrumentation.java.concurrent.ExcludeFilter:build_time,datadog.trace.bootstrap.instrumentation.java.concurrent.QueueTimeHelper:build_time,datadog.trace.bootstrap.instrumentation.java.concurrent.TPEHelper:build_time,datadog.trace.bootstrap.instrumentation.jfr.exceptions.ExceptionCountEvent:build_time,datadog.trace.bootstrap.instrumentation.jfr.exceptions.ExceptionSampleEvent:build_time,datadog.trace.logging.LoggingSettingsDescription:build_time,datadog.trace.logging.simplelogger.SLCompatFactory:build_time,datadog.trace.util.CollectionUtils:build_time,datadog.slf4j.impl.StaticLoggerBinder:build_time,datadog.slf4j.LoggerFactory:build_time,com.blogspot.mydailyjava.weaklockfree.WeakConcurrentMap:build_time,net.bytebuddy:build_time,com.sun.proxy:build_time,jnr.enxio.channels:run_time,jnr.unixsocket:run_time, --initialize-at-run-time=io.netty.util.AbstractReferenceCounted:run_time,io.netty.util.concurrent.GlobalEventExecutor:run_time,io.netty.util.concurrent.ImmediateEventExecutor:run_time,io.netty.util.concurrent.ScheduledFutureTask:run_time,io.netty.util.internal.ThreadLocalRandom:run_time, --initialize-at-run-time=io.netty.util.NetUtilSubstitutions$NetUtilLocalhost4LazyHolder:run_time, --initialize-at-run-time=io.netty.util.NetUtilSubstitutions$NetUtilLocalhost6LazyHolder:run_time, --initialize-at-run-time=io.netty.util.NetUtilSubstitutions$NetUtilLocalhostLazyHolder:run_time, --initialize-at-run-time=io.netty.util.NetUtilSubstitutions$NetUtilNetworkInterfacesLazyHolder:run_time, --initialize-at-run-time=io.netty.resolver.dns.DefaultDnsServerAddressStreamProvider:run_time, --initialize-at-run-time=io.netty.resolver.dns.DnsServerAddressStreamProviders$DefaultProviderHolder:run_time, --initialize-at-run-time=io.netty.resolver.dns.DnsNameResolver:run_time, --initialize-at-run-time=io.netty.resolver.HostsFileEntriesResolver:run_time, --initialize-at-run-time=io.netty.handler.codec.compression.BrotliDecoder:run_time, --initialize-at-run-time=io.netty:build_time, --initialize-at-run-time=io.netty.handler.codec.http.HttpObjectEncoder:run_time,io.netty.handler.codec.http.websocketx.WebSocket00FrameEncoder:run_time,io.netty.handler.codec.http.websocketx.extensions.compression.DeflateDecoder:run_time, --initialize-at-run-time=io.netty:build_time, --initialize-at-run-time=io.netty.handler.codec.http2.Http2CodecUtil:run_time,io.netty.handler.codec.http2.Http2ClientUpgradeCodec:run_time,io.netty.handler.codec.http2.Http2ConnectionHandler:run_time,io.netty.handler.codec.http2.DefaultHttp2FrameWriter:run_time, --initialize-at-run-time=io.netty.handler.ssl.util.ThreadLocalInsecureRandom:run_time, --initialize-at-run-time=io.netty.buffer.PooledByteBufAllocator:run_time,io.netty.buffer.ByteBufAllocator:run_time,io.netty.buffer.ByteBufUtil:run_time,io.netty.buffer.AbstractReferenceCountedByteBuf:run_time, --initialize-at-run-time=io.opentelemetry.instrumentation.api.internal.cache.concurrentlinkedhashmap.ConcurrentLinkedHashMap:build_time; origin(s): command line) 09:28:50 - '-H:+AllowFoldMethods' (origin(s): command line) 09:28:50 - '-H:EnableURLProtocols' (alternative API option(s): --enable-http, --enable-http, --enable-https; origin(s): command line) 09:28:50 - '-H:BuildOutputJSONFile' (origin(s): command line) 09:28:50 - '-H:-UseServiceLoaderFeature' (origin(s): command line) 09:28:50 - '-H:IncludeResources' (origin(s): command line, 'META-INF/native-image/com.rabbitmq/amqp-client/native-image.properties' in 'null') 09:28:50 - '-H:ReflectionConfigurationResources' (origin(s): command line, 'META-INF/native-image/io.netty/netty-transport/native-image.properties' in 'null', 'META-INF/native-image/io.micrometer/micrometer-core/native-image.properties' in 'null') 09:28:50 ------------------------------------------------------------------------------------------------------------------------ 09:28:50 Build resources: 09:28:50 - 6.80GB of memory (75.6% of 9.00GB system memory, determined at start) 09:28:50 - 3 thread(s) (100.0% of 3 available processor(s), determined at start) 09:29:36 [dd.trace 2024-01-23 16:29:36:667 +0000] [ForkJoinPool-2-worker-2] ERROR datadog.common.version.VersionInfo - No version file found 09:29:42 [dd.trace 2024-01-23 16:29:41:923 +0000] [main] WARN com.datadog.profiling.ddprof.DatadogProfiler - failed to instantiate Datadog profiler on linux arm64 because: /META-INF/native-libs/linux-arm64/libjavaProfiler.so not found on classpath 09:30:08 [97.994s][warning][jfr] @Name ignored, not a valid Java identifier. 09:30:55 [2/8] Performing analysis... [******] (120.6s @ 2.18GB) 09:30:55 20,322 reachable types (89.0% of 22,821 total) 09:30:55 29,667 reachable fields (57.9% of 51,199 total) 09:30:55 97,735 reachable methods (56.0% of 174,440 total) 09:30:55 5,972 types, 544 fields, and 5,539 methods registered for reflection 09:30:55 61 types, 59 fields, and 55 methods registered for JNI access 09:30:55 4 native libraries: dl, pthread, rt, z 09:31:05 [3/8] Building universe... (14.2s @ 2.04GB) 09:31:15 [4/8] Parsing methods... [***] (9.6s @ 2.50GB) 09:31:21 [5/8] Inlining methods... [***] (6.3s @ 2.62GB) 09:32:58 [6/8] Compiling methods... [*********] (82.6s @ 2.15GB) 09:32:58 [7/8] Layouting methods... [****] (14.4s @ 1.77GB) 09:33:13 [8/8] Creating image... [****] (14.2s @ 2.66GB) 09:33:13 32.54MB (40.02%) for code area: 62,775 compilation units 09:33:13 48.39MB (59.52%) for image heap: 496,447 objects and 87 resources 09:33:13 375.71kB ( 0.45%) for other data 09:33:13 81.30MB in total 09:33:13 ------------------------------------------------------------------------------------------------------------------------ 09:33:13 Top 10 origins of code area: Top 10 object types in image heap: 09:33:13 11.48MB java.base 11.98MB byte[] for code metadata 09:33:13 1.75MB c.f.jackson.core.jackson-databind-2.15.3.jar 6.93MB byte[] for java.lang.String 09:33:13 1.73MB application-name-runner.jar 5.01MB java.lang.Class 09:33:13 1.57MB svm.jar (Native Image) 4.72MB byte[] for embedded resources 09:33:13 1.17MB modified-io.vertx.vertx-core-4.4.6.jar 4.50MB java.lang.String 09:33:13 617.03kB jdk.jfr 1.86MB com.oracle.svm.core.hub.DynamicHubCompanion 09:33:13 542.51kB com.fasterxml.jackson.core.jackson-core-2.15.3.jar 1.22MB byte[] for reflection metadata 09:33:13 464.27kB io.netty.netty-buffer-4.1.100.Final.jar 1.21MB byte[] for general heap data 09:33:13 439.36kB com.squareup.okhttp3.okhttp-4.12.0.jar 949.77kB java.lang.String[] 09:33:13 417.23kB java.management 738.44kB c.o.svm.core.hub.DynamicHub$ReflectionMetadata 09:33:13 12.07MB for 289 more packages 9.30MB for 5301 more object types 09:33:13 ------------------------------------------------------------------------------------------------------------------------ 09:33:13 Recommendations: 09:33:13 HEAP: Set max heap for improved and more predictable memory usage. 09:33:13 CPU: Enable more CPU features with '-march=native' for improved performance. 09:33:13 ------------------------------------------------------------------------------------------------------------------------ 09:33:13 40.4s (14.2% of total time) in 221 GCs | Peak RSS: 4.64GB | CPU load: 2.50 09:33:13 ------------------------------------------------------------------------------------------------------------------------ 09:33:13 Produced artifacts: 09:33:13 /home/jenkins/agent/workspace/application/target/application-name-native-image-source-jar/application-name-runner (executable) 09:33:13 /home/jenkins/agent/workspace/application/target/application-name-native-image-source-jar/application-name-runner-build-output-stats.json (build_info) 09:33:13 ======================================================================================================================== 09:33:13 Finished generating 'application-name-runner' in 4m 40s. ```
DATADOG TRACER CONFIGURATION
{
    "version": "unknown",
    "os_name": "Linux",
    "os_version": "5.10.205-195.804.amzn2.aarch64",
    "architecture": "aarch64",
    "lang": "jvm",
    "lang_version": "21.0.1",
    "jvm_vendor": "GraalVM Community",
    "jvm_version": "21.0.1+12",
    "java_class_version": "65.0",
    "http_nonProxyHosts": "null",
    "http_proxyHost": "null",
    "enabled": true,
    "service": "APPLICATION-NAME",
    "agent_url": "http://localhost:8126",
    "agent_error": true,
    "debug": false,
    "trace_propagation_style_extract": [
        "datadog",
        "tracecontext"
    ],
    "trace_propagation_style_inject": [
        "datadog",
        "tracecontext"
    ],
    "analytics_enabled": false,
    "sampling_rules": [
        {},
        {}
    ],
    "priority_sampling_enabled": true,
    "logs_correlation_enabled": true,
    "profiling_enabled": true,
    "remote_config_enabled": true,
    "debugger_enabled": false,
    "appsec_enabled": "FULLY_DISABLED",
    "telemetry_enabled": false,
    "telemetry_dependency_collection_enabled": true,
    "telemetry_log_collection_enabled": false,
    "dd_version": "6eadeac",
    "health_checks_enabled": true,
    "configuration_file": "no config file present",
    "runtime_id": "43eab721-d7c4-47db-ab94-8e9346e6dcfd",
    "logging_settings": {
        "levelInBrackets": false,
        "dateTimeFormat": "'[dd.trace 'yyyy-MM-dd HH:mm:ss:SSS Z']'",
        "logFile": "System.err",
        "configurationFile": "simplelogger.properties",
        "showShortLogName": false,
        "showDateTime": true,
        "showLogName": true,
        "showThreadName": true,
        "defaultLogLevel": "INFO",
        "warnLevelString": "WARN",
        "embedException": false
    },
    "cws_enabled": false,
    "cws_tls_refresh": 5000,
    "datadog_profiler_enabled": false,
    "datadog_profiler_safe": false,
    "datadog_profiler_enabled_overridden": false,
    "data_streams_enabled": false
}

With the current configuration, I can view the traces. However, upon accessing the Profile tab: 'We found no profiles for this service in the last eight days.' 🙅

thpoiani commented 8 months ago

Few updates:

No profiling yet

jbachorik commented 8 months ago

I have tried reproducing using the quarkus getting-started demo app

This will properly start profiling but it will crash in JFR code when we are trying to obtain the collected data due to AccessController used from JFR. I am working with people from the graalvm native-image team to figure out the problem and possible fix.

In the meantime, I tried building and running native images with profiler for spring-boot, micronaut and the the 'native-image' tool and they all start properly and generate profiles.

If you don't see any crashes you might want to add DD_PROFILING_DEBUG_DUMP_PATH=/tmp/debug_dmp env variable when you are launching the native image to enable storing the JFR recordings in that location before trying to upload them. If you then see JFR files in that folder but still no data in DD UI there would be issues with the upload itself (DD agent must be running and reachable etc.)

thpoiani commented 8 months ago

I was able to reproduce this error, probably the same you are seeing:

Fatal error: Non-allowed AccessControlContext that was replaced with a blank one at build time was invoked without being reinitialized at run time.
This might be an indicator of improper build time initialization, or of a non-compatible JDK version.
In order to fix this you can either:
    * Annotate the offending context's field with @RecomputeFieldValue
    * Implement a custom runtime accessor and annotate said field with @InjectAccessors
    * If this context originates from the JDK, and it doesn't leak sensitive info, you can allow it in 'AccessControlContextReplacerFeature.duringSetup'

Printing instructions (ip=0x00000000008236d4):
  0x00000000008235d4: 0xc0 0x03 0x5f 0xd6 0x00 0xc4 0x84 0xd2 0xc0 0x3c 0xa0 0xf2 0x00 0x00 0xc0 0xf2
  0x00000000008235e4: 0x00 0x00 0xe0 0xf2 0x60 0x03 0x00 0x8b 0xf1 0x91 0x01 0x94 0x1f 0x20 0x03 0xd5
  0x00000000008235f4: 0xf2 0xff 0xff 0x17 0xe2 0x13 0x00 0xf9 0x84 0xff 0xff 0x17 0x58 0x40 0x01 0x94
  0x0000000000823604: 0x1f 0x20 0x03 0xd5 0x8d 0xff 0xff 0x17 0xe0 0x03 0x03 0xaa 0xb2 0xff 0xff 0x17
  0x0000000000823614: 0xe3 0x23 0x40 0xf9 0xe1 0x03 0x03 0xaa 0xbd 0xff 0xff 0x17 0x10 0x61 0x03 0x94
  0x0000000000823624: 0x1f 0x20 0x03 0xd5 0xe9 0xff 0xff 0x17 0xe0 0x03 0x00 0x32 0xe1 0x03 0x00 0x32
  0x0000000000823634: 0x7f 0x61 0x03 0x94 0x1f 0x20 0x03 0xd5 0xe0 0xff 0xff 0x17 0xbb 0xff 0xff 0x17
  0x0000000000823644: 0xba 0xff 0xff 0x17 0xb9 0xff 0xff 0x17 0xb8 0xff 0xff 0x17 0xb7 0xff 0xff 0x17
  0x0000000000823654: 0xb6 0xff 0xff 0x17 0xb5 0xff 0xff 0x17 0xb4 0xff 0xff 0x17 0xb3 0xff 0xff 0x17
  0x0000000000823664: 0xb2 0xff 0xff 0x17 0xb1 0xff 0xff 0x17 0xb0 0xff 0xff 0x17 0xaf 0xff 0xff 0x17
  0x0000000000823674: 0xae 0xff 0xff 0x17 0xad 0xff 0xff 0x17 0x61 0x85 0xff 0x97 0x1f 0x20 0x03 0xd5
  0x0000000000823684: 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xff 0x03 0x01 0xd1
  0x0000000000823694: 0xfd 0x7b 0x03 0xa9 0xe1 0x8b 0x01 0xa9 0xe0 0x17 0x00 0xf9 0xa8 0x44 0x03 0x94
  0x00000000008236a4: 0x1f 0x20 0x03 0xd5 0xe0 0x03 0x00 0x32 0x88 0xf3 0x05 0x91 0x00 0xfd 0x9f 0x88
  0x00000000008236b4: 0xe0 0x03 0x40 0xb2 0x80 0x07 0x00 0xf9 0xc0 0xdf 0x9f 0x52 0xc0 0xdf 0xaf 0x72
  0x00000000008236c4: 0x80 0x7b 0x01 0xb9 0xe0 0x17 0x40 0xf9 0xe1 0x8b 0x41 0xa9 0x24 0xff 0xff 0x97
> 0x00000000008236d4: 0x1f 0x20 0x03 0xd5 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xff 0x03 0x01 0xd1
  0x00000000008236e4: 0xfd 0x7b 0x03 0xa9 0x80 0x07 0x40 0xf9 0x02 0x24 0x80 0xd2 0xa2 0x38 0xa0 0xf2
  0x00000000008236f4: 0x02 0x00 0xc0 0xf2 0x02 0x00 0xe0 0xf2 0x62 0x03 0x02 0x8b 0xff 0x63 0x20 0xeb
  0x0000000000823704: 0xa9 0x05 0x00 0x54 0x3f 0x00 0x1b 0xeb 0xc0 0x05 0x00 0x54 0xe2 0x17 0x00 0xf9
  0x0000000000823714: 0x20 0x00 0x40 0xf9 0x03 0x80 0x88 0xd2 0x23 0x2d 0xa0 0xf2 0x03 0x00 0xc0 0xf2
  0x0000000000823724: 0x03 0x00 0xe0 0xf2 0x63 0x03 0x03 0x8b 0x00 0xf0 0x7d 0x92 0x64 0x03 0x00 0x8b
  0x0000000000823734: 0xe0 0x03 0x03 0xaa 0xe1 0x13 0x00 0xf9 0xe1 0x03 0x04 0xaa 0xa0 0xff 0x46 0x94
  0x0000000000823744: 0x1f 0x20 0x03 0xd5 0x1f 0x00 0x1b 0xeb 0x00 0x01 0x00 0x54 0x01 0x00 0x40 0xf9
  0x0000000000823754: 0x21 0xf0 0x7d 0x92 0x61 0x03 0x01 0x8b 0x21 0x20 0x41 0xb8 0x21 0x3c 0x00 0x12
  0x0000000000823764: 0x3f 0xd4 0x1b 0x71 0xc1 0x03 0x00 0x54 0x1f 0x00 0x1b 0xeb 0xe0 0x02 0x00 0x54
  0x0000000000823774: 0x01 0x00 0x40 0xf9 0x21 0xf0 0x7d 0x92 0x61 0x03 0x01 0x8b 0x3e 0x78 0x40 0xf9
  0x0000000000823784: 0xe1 0x13 0x40 0xf9 0xc0 0x03 0x3f 0xd6 0x1f 0x20 0x03 0xd5 0x88 0x13 0x40 0xb9
  0x0000000000823794: 0x08 0x05 0x00 0x71 0x88 0x13 0x00 0xb9 0x8d 0x00 0x00 0x54 0xfd 0x7b 0x43 0xa9
  0x00000000008237a4: 0xff 0x03 0x01 0x91 0xc0 0x03 0x5f 0xd6 0xad 0x60 0x03 0x94 0x1f 0x20 0x03 0xd5
  0x00000000008237b4: 0xfb 0xff 0xff 0x17 0xe1 0x13 0x00 0xf9 0x45 0x85 0xff 0x97 0x1f 0x20 0x03 0xd5
  0x00000000008237c4: 0xdb 0x3d 0x03 0x94 0x1f 0x20 0x03 0xd5 0xe2 0x17 0x40 0xf9 0xe0 0x03 0x02 0xaa

Top of stack (sp=0x0000ffffe01777f0):
  0x0000ffffe01777d0: 0x0000000000000000 0x0000000000000000 0x0000ffffe0177eb0 0x00000000008236d4
> 0x0000ffffe01777f0: 0x0000ffffe01778d0 0x000000000179cdbc 0x0000ffffe0177890 0x0000ffff996647b0
  0x0000ffffe0177810: 0x0000ffff98c00000 0x000000000179cbb4 0x0000ffffe0177eb0 0x0000000000902d08
  0x0000ffffe0177830: 0x0000000000000000 0x3f8dbda033e8e4be 0x0000ffffe0177eb0 0x0000000001bbdafc
  0x0000ffffe0177850: 0x0000ffffe0177eb0 0x000000000179cbb4 0x0000ffff83e6f2c0 0x000000000000000b
  0x0000ffffe0177870: 0x0000ffff83271b20 0x0000ffff9a4fc140 0x0000ffffe0177eb0 0x000000000179cdd4
  0x0000ffffe0177890: 0x0000ffff9be039e0 0x0000ffff9a65b338 0x0000ffffe0177eb0 0x0000ffff99c1ed30
  0x0000ffffe01778b0: 0x0000ffff83271b00 0x0000ffff9a4fc140 0x0000ffffe0177eb0 0x0000000001c6ba14
  0x0000ffffe01778d0: 0x0000ffff9a65b338 0x0000ffff9a530650 0x0000ffff9a85cba0 0x0000000007c7cb90
  0x0000ffffe01778f0: 0x0000ffffe0177eb0 0x0000000001c6a4d0 0x0000ffff83f13c88 0x0000ffffdf783000
  0x0000ffffe0177910: 0x0000ffffe0177eb0 0x000000000193bfd8 0x0000ffff83f13c88 0x0000ffffdf783000
  0x0000ffffe0177930: 0x0000000000000066 0x0000ffff9a85cba0 0x0000ffff9a4c9380 0x0000000007c7cb90
  0x0000ffffe0177950: 0x0000ffffe0177eb0 0x0000000001c69448 0x0000ffffe0177eb0 0x00000000018debf4
  0x0000ffffe0177970: 0x0000ffffe0177eb0 0x0000ffff83271ad8 0x0000ffff83271680 0x0000000007c7cb90
  0x0000ffffe0177990: 0x0000ffffe0177eb0 0x0000000001c0d220 0x0000ffffe0177eb0 0x00000000008fd4e8
  0x0000ffffe01779b0: 0x0000000000000007 0x0000ffff93353858 0x0000000001c5ca88 0x0000ffff9a85ca88
  0x0000ffffe01779d0: 0x0000ffff93353858 0x0000000000804b40 0x0000000000000005 0x0000ffff83271680

VM thread locals for the failing thread 0x000000002fd8c8c0:
  0 (8 bytes): JNIThreadLocalEnvironment.jniFunctions = (bytes)
    0x000000002fd8c8c0: 0x0000ffff99a9c010
  8 (8 bytes): StackOverflowCheckImpl.stackBoundaryTL = (Word) 1 (0x0000000000000001)
  16 (4 bytes): Safepoint.safepointRequested = (int) 11197 (0x00002bbd)
  20 (4 bytes): StatusSupport.statusTL = (int) 1 (0x00000001)
  24 (32 bytes): ThreadLocalAllocation.regularTLAB = (bytes)
    0x000000002fd8c8d8: 0x0000ffff83200000 0x0000ffff83280000
    0x000000002fd8c8e8: 0x0000ffff83271cd8 0x0000ffff81d5f000
  56 (8 bytes): PlatformThreads.currentThread = (Object) java.lang.Thread (0x0000ffff9a1fd0f8)
  64 (8 bytes): JavaFrameAnchors.lastAnchor = (Word) 0 (0x0000000000000000)
  72 (8 bytes): PlatformThreads.currentVThreadId = (long) 1 (0x0000000000000001)
  80 (8 bytes): AccessControlContextStack = (Object) java.util.ArrayDeque (0x0000ffff98b02208)
  88 (8 bytes): ExceptionUnwind.currentException = (Object) null
  96 (8 bytes): IdentityHashCodeSupport.hashCodeGeneratorTL = (Object) java.util.SplittableRandom (0x0000ffff9334d4c8)
  104 (8 bytes): IsolatedCompileClient.currentClient = (Object) null
  112 (8 bytes): IsolatedCompileContext.currentContext = (Object) null
  120 (8 bytes): JNIObjectHandles.handles = (Object) com.oracle.svm.core.handles.ThreadLocalHandles (0x0000ffff98b016a8)
  128 (8 bytes): JNIThreadLocalPendingException.pendingException = (Object) null
  136 (8 bytes): JNIThreadLocalReferencedObjects.referencedObjectsListHead = (Object) null
  144 (8 bytes): JNIThreadOwnedMonitors.ownedMonitors = (Object) null
  152 (8 bytes): JfrThreadLocal.javaEventWriter = (Object) jdk.jfr.internal.event.EventWriter (0x0000ffff83f17a08)
  160 (8 bytes): NoAllocationVerifier.openVerifiers = (Object) null
  168 (8 bytes): ThreadingSupportImpl.activeTimer = (Object) com.oracle.svm.core.thread.ThreadingSupportImpl$RecurringCallbackTimer (0x0000ffff83f13c88)
  176 (8 bytes): ActionOnExitSafepointSupport.returnIP = (Word) 0 (0x0000000000000000)
  184 (8 bytes): ActionOnExitSafepointSupport.returnSP = (Word) 0 (0x0000000000000000)
  192 (8 bytes): JfrThreadLocal.dataLost = (Word) 0 (0x0000000000000000)
  200 (8 bytes): JfrThreadLocal.javaBuffer = (Word) 802846848 (0x000000002fda7880)
  208 (8 bytes): JfrThreadLocal.missedSamples = (long) 0 (0x0000000000000000)
  216 (8 bytes): JfrThreadLocal.nativeBuffer = (Word) 802764576 (0x000000002fd93720)
  224 (8 bytes): JfrThreadLocal.samplerBuffer = (Word) 802838624 (0x000000002fda5860)
  232 (8 bytes): JfrThreadLocal.samplerWriterData = (Word) 0 (0x0000000000000000)
  240 (8 bytes): JfrThreadLocal.unparseableStacks = (long) 0 (0x0000000000000000)
  248 (8 bytes): SubstrateDiagnostics.threadOnlyAttachedForCrashHandler = (bytes)
    0x000000002fd8c9b8: 0x0000000000000000
  256 (8 bytes): ThreadCPULoadEvent.cpuTimeTL = (long) 0 (0x0000000000000000)
  264 (8 bytes): ThreadCPULoadEvent.userTimeTL = (long) 0 (0x0000000000000000)
  272 (8 bytes): ThreadCPULoadEvent.wallclockTimeTL = (long) 0 (0x0000000000000000)
  280 (8 bytes): ThreadLocalAllocation.allocatedBytes = (Word) 6949032 (0x00000000006a08a8)
  288 (8 bytes): VMThreads.IsolateTL = (Word) 281473244463104 (0x0000ffff98c00000)
  296 (8 bytes): VMThreads.OSThreadHandleTL = (Word) 281473298386976 (0x0000ffff9bf6d020)
  304 (8 bytes): VMThreads.OSThreadIdTL = (Word) 1 (0x0000000000000001)
  312 (8 bytes): VMThreads.StackBase = (Word) 281474441383936 (0x0000ffffe0179000)
  320 (8 bytes): VMThreads.StackEnd = (Word) 281474430898176 (0x0000ffffdf779000)
  328 (8 bytes): VMThreads.StartedByCurrentIsolate = (bytes)
    0x000000002fd8ca08: 0x0000000000000000
  336 (8 bytes): VMThreads.nextTL = (Word) 0 (0x0000000000000000)
  344 (8 bytes): VMThreads.unalignedIsolateThreadMemoryTL = (Word) 802736272 (0x000000002fd8c890)
  352 (4 bytes): ActionOnExitSafepointSupport.actionTL = (int) 0 (0x00000000)
  356 (4 bytes): ActionOnTransitionToJavaSupport.actionTL = (int) 0 (0x00000000)
  360 (4 bytes): ImplicitExceptions.implicitExceptionsAreFatal = (int) 0 (0x00000000)
  364 (4 bytes): JfrSampler.isDisabledForCurrentThread = (int) 0 (0x00000000)
  368 (4 bytes): JfrSampler.samplerState = (int) 1 (0x00000001)
  372 (4 bytes): JfrThreadLocal.notified = (int) 0 (0x00000000)
  376 (4 bytes): StackOverflowCheckImpl.yellowZoneStateTL = (int) 2130640638 (0x7efefefe)
  380 (4 bytes): StatusSupport.safepointBehaviorTL = (int) 1 (0x00000001)
  384 (4 bytes): ThreadingSupportImpl.currentPauseDepth = (int) 0 (0x00000000)

Java frame anchors for the failing thread 0x000000002fd8c8c0:
  No anchors

Stacktrace for the failing thread 0x000000002fd8c8c0 (A=AOT compiled, J=JIT compiled, D=deoptimized, i=inlined):
  i  SP 0x0000ffffe01777f0 IP 0x00000000008236d4 size=64    com.oracle.svm.core.jdk.VMErrorSubstitutions.shutdown(VMErrorSubstitutions.java:148)
  A  SP 0x0000ffffe01777f0 IP 0x00000000008236d4 size=64    com.oracle.svm.core.jdk.VMErrorSubstitutions.shouldNotReachHere(VMErrorSubstitutions.java:141)
  A  SP 0x0000ffffe0177830 IP 0x0000000000902d08 size=48    com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:90)
  A  SP 0x0000ffffe0177860 IP 0x000000000179cbb4 size=48    java.security.AccessController.checkContext(AccessController.java:140)
  A  SP 0x0000ffffe0177890 IP 0x000000000179cdd4 size=64    java.security.AccessController.doPrivileged(AccessController.java:399)
  A  SP 0x0000ffffe01778d0 IP 0x0000000001c6ba14 size=48    jdk.jfr.internal.periodic.UserEventTask.execute(UserEventTask.java:54)
  A  SP 0x0000ffffe0177900 IP 0x0000000001c6a4d0 size=96    jdk.jfr.internal.periodic.PeriodicTask.run(PeriodicTask.java:128)
  A  SP 0x0000ffffe0177960 IP 0x0000000001c69448 size=64    jdk.jfr.internal.periodic.PeriodicEvents.doChunkEnd(PeriodicEvents.java:92)
  A  SP 0x0000ffffe01779a0 IP 0x0000000001c0d220 size=160   jdk.jfr.internal.PlatformRecorder.start(PlatformRecorder.java:265)
  A  SP 0x0000ffffe0177a40 IP 0x0000000001c16028 size=176   jdk.jfr.internal.PlatformRecording.start(PlatformRecording.java:123)
  i  SP 0x0000ffffe0177af0 IP 0x000000000084395c size=288   jdk.jfr.Recording.start(Recording.java:177)
  A  SP 0x0000ffffe0177af0 IP 0x000000000084395c size=288   com.oracle.svm.core.jfr.JfrManager.initRecording(JfrManager.java:246)
  A  SP 0x0000ffffe0177c10 IP 0x0000000000845f1c size=48    com.oracle.svm.core.jfr.JfrManager.lambda$startupHook$0(JfrManager.java:91)
  A  SP 0x0000ffffe0177c40 IP 0x0000000000841f4c size=48    com.oracle.svm.core.jfr.JfrManager$$Lambda$b3f652724e375272d1823cbd069b9505bf78a240.execute(Unknown Source)
  A  SP 0x0000ffffe0177c70 IP 0x000000000081cef8 size=64    com.oracle.svm.core.jdk.RuntimeSupport.executeHooks(RuntimeSupport.java:161)
  A  SP 0x0000ffffe0177cb0 IP 0x000000000081d0f4 size=48    com.oracle.svm.core.jdk.RuntimeSupport.initialize(RuntimeSupport.java:98)
  A  SP 0x0000ffffe0177ce0 IP 0x0000000001e25478 size=80    org.graalvm.nativeimage.VMRuntime.initialize(VMRuntime.java:65)
  A  SP 0x0000ffffe0177d30 IP 0x000000000077b508 size=48    com.oracle.svm.core.JavaMainWrapper.runCore0(JavaMainWrapper.java:219)
  i  SP 0x0000ffffe0177d60 IP 0x000000000077b398 size=64    com.oracle.svm.core.JavaMainWrapper.runCore(JavaMainWrapper.java:204)
  A  SP 0x0000ffffe0177d60 IP 0x000000000077b398 size=64    com.oracle.svm.core.JavaMainWrapper.doRun(JavaMainWrapper.java:293)
  i  SP 0x0000ffffe0177da0 IP 0x00000000007de0cc size=272   com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:279)
  A  SP 0x0000ffffe0177da0 IP 0x00000000007de0cc size=272   com.oracle.svm.core.code.IsolateEnterStub.JavaMainWrapper_run_5087f5482cc9a6abc971913ece43acb471d2631b(IsolateEnterStub.java:0)

Threads:
  0x0000ffff68000b80 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "dd-trace-processor" - 0x0000ffff8322f3c8, daemon, stack(0x0000ffff81df1000,0x0000ffff827f0000)
  0x0000ffff74000b80 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "dd-data-streams-monitor" - 0x0000ffff8323cb98, daemon, stack(0x0000ffff81360000,0x0000ffff81d5f000)
  0x0000ffff70000b80 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "dd-trace-monitor" - 0x0000ffff83238610, daemon, stack(0x0000ffff82801000,0x0000ffff83200000)
  0x0000ffff78000b80 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "dd-profiler-recording-scheduler" - 0x0000ffff83e6c4a8, daemon, stack(0x0000ffff83401000,0x0000ffff83e00000)
  0x0000ffff7c000b80 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "JFR Periodic Tasks" - 0x0000ffff912a1ad0, daemon, stack(0x0000ffff90881000,0x0000ffff91280000)
  0x0000ffff88000b80 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "JFR recorder" - 0x0000ffff9a1eeeb0, daemon, stack(0x0000ffff9146e000,0x0000ffff91e6d000)
  0x0000ffff84000b80 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "dd-task-scheduler" - 0x0000ffff9334ab28, daemon, stack(0x0000ffff92901000,0x0000ffff93300000)
  0x0000ffff8c000b80 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "Signal Dispatcher" - 0x0000ffff98b3ad00, daemon, stack(0x0000ffff93501000,0x0000ffff93f00000)
  0x0000ffff94000b80 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "Reference Handler" - 0x0000ffff9a1fd1c8, daemon, stack(0x0000ffff98101000,0x0000ffff98b00000)
  0x000000002fd8c8c0 STATUS_IN_JAVA (PREVENT_VM_FROM_REACHING_SAFEPOINT) "main" - 0x0000ffff9a1fd0f8, stack(0x0000ffffdf779000,0x0000ffffe0179000)

No VMOperation in progress

The 30 most recent VM operation status changes:
  0.649s - Started JFR begin recording (safepoint: true, queueingThread: 0x000000002fd8c8c0, executingThread: 0x000000002fd8c8c0, safepointId: 1)
  0.649s -   Started Update JFR sampler (safepoint: true, queueingThread: 0x000000002fd8c8c0, executingThread: 0x000000002fd8c8c0, safepointId: 1)
  0.649s -   Finished Update JFR sampler (safepoint: true, queueingThread: 0x000000002fd8c8c0, executingThread: 0x000000002fd8c8c0, safepointId: 1)
  0.649s - Finished JFR begin recording (safepoint: true, queueingThread: 0x000000002fd8c8c0, executingThread: 0x000000002fd8c8c0, safepointId: 1)
  0.652s - Started Update JFR sampler (safepoint: true, queueingThread: 0x000000002fd8c8c0, executingThread: 0x000000002fd8c8c0, safepointId: 2)
  0.652s - Finished Update JFR sampler (safepoint: true, queueingThread: 0x000000002fd8c8c0, executingThread: 0x000000002fd8c8c0, safepointId: 2)
  0.652s - Started Update JFR sampler (safepoint: true, queueingThread: 0x000000002fd8c8c0, executingThread: 0x000000002fd8c8c0, safepointId: 3)
  0.652s - Finished Update JFR sampler (safepoint: true, queueingThread: 0x000000002fd8c8c0, executingThread: 0x000000002fd8c8c0, safepointId: 3)
  0.652s - Started Update JFR sampler (safepoint: true, queueingThread: 0x000000002fd8c8c0, executingThread: 0x000000002fd8c8c0, safepointId: 4)
  0.652s - Finished Update JFR sampler (safepoint: true, queueingThread: 0x000000002fd8c8c0, executingThread: 0x000000002fd8c8c0, safepointId: 4)

VM mutexes:
  mutex "RealLog.backTracePrinterMutex" is unlocked.
  mutex "SamplerBufferPool" is unlocked.
  mutex "jfrChunkWriter" is unlocked.
  mutex "jfrMethodRepository" is unlocked.
  mutex "jfrStackTraceRepository" is unlocked.
  mutex "jfrSymbolRepository" is unlocked.
  mutex "jfrThreadRepository" is unlocked.
  mutex "mainVMOperationControlWorkQueue" is unlocked.
  mutex "referencePendingList" is unlocked.
  mutex "thread" is unlocked.

General information:
  VM version: 21.0.1+12, linux/aarch64
  Current timestamp: 1706108150288
  VM uptime: 0.699s
  AOT compiled code: 0x0000000000407000 - 0x000000000248110f
  CPU features used for AOT compiled code: FP, ASIMD, EVTSTRM, AES, PMULL, SHA1, SHA2, CRC32, LSE, DCPOP

Command line:

Heap settings and statistics:
  Supports isolates: true
  Heap base: 0x0000ffff98c00000
  Object reference size: 8
  Aligned chunk size: 524288
  Large array threshold: 131072
  Incremental collections: 0
  Complete collections: 0

Heap usage:
  Eden: 0.00M (0.00M in 0 aligned chunks, 0.00M in 0 unaligned chunks)
  Old: 0.00M (0.00M in 0 aligned chunks, 0.00M in 0 unaligned chunks)

Native image heap boundaries:
  ReadOnly Primitives: 0x0000ffff98c80830 - 0x0000ffff9949d7d0
  ReadOnly References: 0x0000ffff9949d7d0 - 0x0000ffff99a9b630
  ReadOnly Relocatables: 0x0000ffff99a9c000 - 0x0000ffff99eb69c0
  Writable Primitives: 0x0000ffff99eb7000 - 0x0000ffff9a0a76b0
  Writable References: 0x0000ffff9a0a76b0 - 0x0000ffff9aa84bf8
  Writable Huge: 0x0000ffff9ab00038 - 0x0000ffff9ac383a0
  ReadOnly Huge: 0x0000ffff9ac39038 - 0x0000ffff9bce2088

Heap chunks: E=eden, S=survivor, O=old, F=free; A=aligned chunk, U=unaligned chunk; T=to space

Fatal error: Non-allowed AccessControlContext that was replaced with a blank one at build time was invoked without being reinitialized at run time.
This might be an indicator of improper build time initialization, or of a non-compatible JDK version.
In order to fix this you can either:
    * Annotate the offending context's field with @RecomputeFieldValue
    * Implement a custom runtime accessor and annotate said field with @InjectAccessors
    * If this context originates from the JDK, and it doesn't leak sensitive info, you can allow it in 'AccessControlContextReplacerFeature.duringSetup'
jbachorik commented 8 months ago

Hi @thpoiani - this should be fixed in the linked PR. The fix should become available in the next release 1.29.0

thpoiani commented 8 months ago

Amazing @jbachorik! Do you know if there is any plan for a RC release?

jbachorik commented 8 months ago

@thpoiani , can't promise any exact dates but given the current cadence it is possible in 1-2 weeks?

thpoiani commented 8 months ago

@jbachorik I was able to see the profiling using the 1.29.0! Thanks for the support!! 🎉

thpoiani commented 7 months ago

@jbachorik by any chance, do you know how to collect Allocations and Allocated Memory using Native Executables?

jbachorik commented 7 months ago

@thpoiani This should work OOTB - we are enabling those events. If this does not work for you and you are a DD customer, could you raise a support ticket so we can track it. Also, if you happen to be a paying customer of the GraalVM you could also trying to bring this up with Oracle - we are using plain JFR so we are relying on the events being emitted by the GraalVM native image. I am going to close this ticket as the original problem has been solved.