DataDog / dd-trace-java

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

DD 1.38.1 doesn't work on native #7479

Closed luneo7 closed 1 week ago

luneo7 commented 3 weeks ago

When trying to build natively with DD 1.38.1 we've got the following error:

Error: An object of type 'datadog.trace.api.Config' was found in the image heap. This type, however, is marked for initialization at image run time for the following reason: classes are initialized at run time by default.
This is not allowed for correctness reasons: All objects that are stored in the image heap must be initialized at build time.

You now have two options to resolve this:

1) If it is intended that objects of type 'datadog.trace.api.Config' are persisted in the image heap, add 

    '--initialize-at-build-time=datadog.trace.api.Config'

to the native-image arguments. Note that initializing new types can store additional objects to the heap. It is advised to check the static fields of 'datadog.trace.api.Config' to see if they are safe for build-time initialization,  and that they do not contain any sensitive data that should not become part of the image.

2) If these objects should not be stored in the image heap, you can use 

    '--trace-object-instantiation=datadog.trace.api.Config'

to find classes that instantiate these objects. Once you found such a class, you can mark it explicitly for run time initialization with 

    '--initialize-at-run-time=<culprit>'

to prevent the instantiation of the object.

If you are seeing this message after enabling '--strict-image-heap', this means that some objects ended up in the image heap without their type being marked with --initialize-at-build-time.
To fix this, include '--initialize-at-build-time=datadog.trace.api.Config' in your configuration. If the classes do not originate from your code, it is advised to update all library or framework dependencies to the latest version before addressing this error.
Please address this problem to be prepared for future releases of GraalVM.

The following detailed trace displays from which field in the code the object was reached.
Detailed message:
Trace: Object was reached by
  reading field datadog.trace.agent.core.tagprocessor.RemoteHostnameAdder.config of constant 
    datadog.trace.agent.core.tagprocessor.RemoteHostnameAdder@c0e575: datadog.trace.agent.core.tagprocessor.RemoteHostnameAdder@c0e575
  indexing into array datadog.trace.agent.core.tagprocessor.TagsPostProcessor[]@454656a1: [Ldatadog.trace.agent.core.tagprocessor.TagsPostProcessor;@454656a1
  reading field datadog.trace.agent.core.tagprocessor.PostProcessorChain.chain of constant 
    datadog.trace.agent.core.tagprocessor.PostProcessorChain@33682bfa: datadog.trace.agent.core.tagprocessor.PostProcessorChain@33682bfa
  reading static field datadog.trace.agent.core.tagprocessor.TagsPostProcessorFactory$Lazy.instance
    at datadog.trace.agent.core.tagprocessor.TagsPostProcessorFactory$Lazy.access$200(TagsPostProcessorFactory.java:11)
  parsing method datadog.trace.agent.core.tagprocessor.TagsPostProcessorFactory$Lazy.access$200(TagsPostProcessorFactory.java:11) reachable via the parsing context
    at static root method.(Unknown Source)

com.oracle.svm.core.util.UserError$UserException: An object of type 'datadog.trace.api.Config' was found in the image heap. This type, however, is marked for initialization at image run time for the following reason: classes are initialized at run time by default.
This is not allowed for correctness reasons: All objects that are stored in the image heap must be initialized at build time.

You now have two options to resolve this:

1) If it is intended that objects of type 'datadog.trace.api.Config' are persisted in the image heap, add 

    '--initialize-at-build-time=datadog.trace.api.Config'

to the native-image arguments. Note that initializing new types can store additional objects to the heap. It is advised to check the static fields of 'datadog.trace.api.Config' to see if they are safe for build-time initialization,  and that they do not contain any sensitive data that should not become part of the image.

2) If these objects should not be stored in the image heap, you can use 

    '--trace-object-instantiation=datadog.trace.api.Config'

to find classes that instantiate these objects. Once you found such a class, you can mark it explicitly for run time initialization with 

    '--initialize-at-run-time=<culprit>'

to prevent the instantiation of the object.

If you are seeing this message after enabling '--strict-image-heap', this means that some objects ended up in the image heap without their type being marked with --initialize-at-build-time.
To fix this, include '--initialize-at-build-time=datadog.trace.api.Config' in your configuration. If the classes do not originate from your code, it is advised to update all library or framework dependencies to the latest version before addressing this error.
Please address this problem to be prepared for future releases of GraalVM.

The following detailed trace displays from which field in the code the object was reached.
Detailed message:
Trace: Object was reached by
  reading field datadog.trace.agent.core.tagprocessor.RemoteHostnameAdder.config of constant 
    datadog.trace.agent.core.tagprocessor.RemoteHostnameAdder@c0e575: datadog.trace.agent.core.tagprocessor.RemoteHostnameAdder@c0e575
  indexing into array datadog.trace.agent.core.tagprocessor.TagsPostProcessor[]@454656a1: [Ldatadog.trace.agent.core.tagprocessor.TagsPostProcessor;@454656a1
  reading field datadog.trace.agent.core.tagprocessor.PostProcessorChain.chain of constant 
    datadog.trace.agent.core.tagprocessor.PostProcessorChain@33682bfa: datadog.trace.agent.core.tagprocessor.PostProcessorChain@33682bfa
  reading static field datadog.trace.agent.core.tagprocessor.TagsPostProcessorFactory$Lazy.instance
    at datadog.trace.agent.core.tagprocessor.TagsPostProcessorFactory$Lazy.access$200(TagsPostProcessorFactory.java:11)
  parsing method datadog.trace.agent.core.tagprocessor.TagsPostProcessorFactory$Lazy.access$200(TagsPostProcessorFactory.java:11) reachable via the parsing context
    at static root method.(Unknown Source)

        at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.UserError.abort(UserError.java:85)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FallbackFeature.reportAsFallback(FallbackFeature.java:248)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:814)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:592)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:550)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:539)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:721)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:143)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:98)
------------------------------------------------------------------------------------------------------------------------
Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: An object of type 'datadog.trace.api.Config' was found in the image heap. This type, however, is marked for initialization at image run time for the following reason: classes are initialized at run time by default.
This is not allowed for correctness reasons: All objects that are stored in the image heap must be initialized at build time.

You now have two options to resolve this:

1) If it is intended that objects of type 'datadog.trace.api.Config' are persisted in the image heap, add 

    '--initialize-at-build-time=datadog.trace.api.Config'

to the native-image arguments. Note that initializing new types can store additional objects to the heap. It is advised to check the static fields of 'datadog.trace.api.Config' to see if they are safe for build-time initialization,  and that they do not contain any sensitive data that should not become part of the image.

2) If these objects should not be stored in the image heap, you can use 

    '--trace-object-instantiation=datadog.trace.api.Config'

to find classes that instantiate these objects. Once you found such a class, you can mark it explicitly for run time initialization with 

    '--initialize-at-run-time=<culprit>'

to prevent the instantiation of the object.

If you are seeing this message after enabling '--strict-image-heap', this means that some objects ended up in the image heap without their type being marked with --initialize-at-build-time.
To fix this, include '--initialize-at-build-time=datadog.trace.api.Config' in your configuration. If the classes do not originate from your code, it is advised to update all library or framework dependencies to the latest version before addressing this error.
Please address this problem to be prepared for future releases of GraalVM.

The following detailed trace displays from which field in the code the object was reached.
Detailed message:
Trace: Object was reached by
  reading field datadog.trace.agent.core.tagprocessor.RemoteHostnameAdder.config of constant 
    datadog.trace.agent.core.tagprocessor.RemoteHostnameAdder@c0e575: datadog.trace.agent.core.tagprocessor.RemoteHostnameAdder@c0e575
  indexing into array datadog.trace.agent.core.tagprocessor.TagsPostProcessor[]@454656a1: [Ldatadog.trace.agent.core.tagprocessor.TagsPostProcessor;@454656a1
  reading field datadog.trace.agent.core.tagprocessor.PostProcessorChain.chain of constant 
    datadog.trace.agent.core.tagprocessor.PostProcessorChain@33682bfa: datadog.trace.agent.core.tagprocessor.PostProcessorChain@33682bfa
  reading static field datadog.trace.agent.core.tagprocessor.TagsPostProcessorFactory$Lazy.instance
    at datadog.trace.agent.core.tagprocessor.TagsPostProcessorFactory$Lazy.access$200(TagsPostProcessorFactory.java:11)
  parsing method datadog.trace.agent.core.tagprocessor.TagsPostProcessorFactory$Lazy.access$200(TagsPostProcessorFactory.java:11) reachable via the parsing context
    at static root method.(Unknown Source)

        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.constraints.UnsupportedFeatures.report(UnsupportedFeatures.java:126)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:809)
        ... 6 more

Seems related to https://github.com/DataDog/dd-trace-java/pull/7426/files and the setting datadog.trace.api.Config:rerun

mcculls commented 3 weeks ago

Hi @luneo7 - the RemoteHostnameAdder class comes from https://github.com/DataDog/dd-trace-java/pull/7388 which was cherry-picked into 1.38.1 under https://github.com/DataDog/dd-trace-java/pull/7426

This doesn't cause any issues with our suite of GraalVM smoke tests, so it could be specific to a particular GraalVM release.

Note that datadog.trace.api.Config:rerun is intentional because we want the final native-image to pick up the latest non-instrumentation configuration from the environment (for example, which host and port to use to contact the agent). This is separate from the InstrumenterConfig which gets baked into the final native-image.

The fix will involve using Platform.isNativeImageBuilder() to add a guard so that class doesn't activate during native image analysis, while still allowing for it to be used when using the native-image.

luneo7 commented 3 weeks ago

Yup, I've pointed that because of the 1.38.1 release =) so there it came from the 7426 The issue comes from it actually not being lazy, and injecting the config, and it getting instantiated, and recorded during build time, and the config (on purpose) is required to be rerun during runtime. We are using GraalVM for JDK 21 (23.1.4), if the RemoteHostnameAdder injects the property instead of the config class it gets fixed (as it is being done with the other TagsPostProcessor)

mcculls commented 3 weeks ago

It seems like this trips up the Mandrel fork of GraalVM, but not other variants.

Note that the reason it can't use Config.get().getHostName() is because getHostName is potentially a blocking operation and should not be called on the main/premain thread as it could noticeably delay application startup.

I have a fix that changes RemoteHostnameAdder to accept a supplier, which solves the reference issue while still keeping the hostname lookup lazy.

Meanwhile we'll also look at incorporating Mandrel into our existing smoke tests to avoid future regressions.

mcculls commented 3 weeks ago

https://github.com/DataDog/dd-trace-java/pull/7480 fixes this for Mandrel - this will be in 1.39.0 (expected around the start of the month)

luneo7 commented 3 weeks ago

It happens with Liberica NIK 23 (Java 21) (default for Spring), GraalVM CE 21.0.2, Mandrel 23.1.4 (Java 21), and Oracle GraalVM 21.0.4, so for me happens with our current LTS distributions, and it is expected to happen as the native image tool and SubstrateVM is the "same"... so it is not a Mandrel thing

mcculls commented 3 weeks ago

We don't see it on GraalVM CE 17.0.9+9.1, GraalVM 22.3.0 Java 17 CE, or GraalVM CE 21.0.2+13.1 - so there must be some difference with the substrate version because I'd expect this to show up in our smoke tests.

luneo7 commented 3 weeks ago

Funny, I've tested with GraalVM CE 21.0.2 and this happens:

[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
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildRunner] /Users/lucas.ferreira/.sdkman/candidates/java/current/bin/native-image -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Dlogging.initial-configurator.min-level=500 -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -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=CA -J-Dfile.encoding=UTF-8 --features=io.quarkus.runner.Feature,io.quarkus.runtime.graal.DisableLoggingFeature,io.quarkus.caffeine.runtime.graal.CacheConstructorsFeature -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=kafka-with-quarkus-1.0.0-SNAPSHOT-runner-build-output-stats.json -H:-UnlockExperimentalVMOptions --strict-image-heap -J-javaagent:/Users/lucas.ferreira/Downloads/kafka-with-quarkus/dd-java-agent.jar -march=native -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 --enable-monitoring=heapdump -H:+UnlockExperimentalVMOptions -H:-UseServiceLoaderFeature -H:-UnlockExperimentalVMOptions -H:+UnlockExperimentalVMOptions -H:AdditionalSecurityProviders=com.sun.security.sasl.Provider,org.apache.kafka.common.security.oauthbearer.internals.OAuthBearerSaslClientProvider,org.apache.kafka.common.security.scram.internals.ScramSaslClientProvider -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 kafka-with-quarkus-1.0.0-SNAPSHOT-runner -jar kafka-with-quarkus-1.0.0-SNAPSHOT-runner.jar
========================================================================================================================
GraalVM Native Image: Generating 'kafka-with-quarkus-1.0.0-SNAPSHOT-runner' (executable)...
========================================================================================================================
[1/8] Initializing...                                                                                   (28.1s @ 0.16GB)
 Java version: 21.0.2+13, vendor version: GraalVM CE 21.0.2+13.1
 Graal compiler: optimization level: 2, target machine: native
 C compiler: cc (apple, x86_64, 14.0.0)
 Garbage collector: Serial GC (max heap size: 80% of RAM)
 4 user-specific feature(s):
 - com.oracle.svm.thirdparty.gson.GsonFeature
 - io.quarkus.caffeine.runtime.graal.CacheConstructorsFeature
 - io.quarkus.runner.Feature: Auto-generated class by Quarkus from the existing extensions
 - io.quarkus.runtime.graal.DisableLoggingFeature: Disables INFO logging during the analysis phase
------------------------------------------------------------------------------------------------------------------------
 8 experimental option(s) unlocked:
 - '-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.DeadlockEvent:build_time,com.datadog.profiling.controller.openjdk.events.ProfilerSettingEvent:build_time,com.datadog.profiling.controller.openjdk.events.EndpointEvent:build_time,com.datadog.profiling.controller.openjdk.events.QueueTimeEvent:build_time,com.datadog.profiling.controller.openjdk.events.TimelineEvent:build_time,com.datadog.profiling.controller.openjdk.events.SmapEntryEvent:build_time,com.datadog.profiling.controller.openjdk.events.SmapEntryFactory$SmapParseErrorEvent: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.config.provider.OtelEnvironmentConfigSource: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.InstrumentationErrors: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.bootstrap.instrumentation.jfr.backpressure.BackpressureSampleEvent:build_time,datadog.trace.bootstrap.instrumentation.jfr.directallocation.DirectAllocationTotalEvent:build_time,datadog.trace.logging.LoggingSettingsDescription:build_time,datadog.trace.logging.simplelogger.SLCompatFactory:build_time,datadog.trace.logging.LogReporter:build_time,datadog.trace.logging.PrintStreamWrapper: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, --initialize-at-run-time=io.netty.resolver.dns.ResolvConf$ResolvConfLazy:run_time, --initialize-at-run-time=io.netty.resolver.dns.DefaultDnsServerAddressStreamProvider:run_time, --initialize-at-run-time=io.opentelemetry.instrumentation.api.internal.cache.concurrentlinkedhashmap.ConcurrentLinkedHashMap:build_time; origin(s): command line)
 - '-H:+AllowFoldMethods' (origin(s): command line)
 - '-H:EnableURLProtocols' (alternative API option(s): --enable-http, --enable-http, --enable-https; origin(s): command line)
 - '-H:BuildOutputJSONFile' (origin(s): command line)
 - '-H:-UseServiceLoaderFeature' (origin(s): command line)
 - '-H:AdditionalSecurityProviders' (origin(s): command line)
 - '-H:IncludeResources' (origin(s): command line)
 - '-H:ReflectionConfigurationResources' (origin(s): command line)
------------------------------------------------------------------------------------------------------------------------
Build resources:
 - 24.18GB of memory (75.6% of 32.00GB system memory, determined at start)
 - 12 thread(s) (100.0% of 12 available processor(s), determined at start)
[dd.trace 2024-08-20 14:26:03:622 -0600] [ForkJoinPool-2-worker-5] ERROR datadog.common.version.VersionInfo - No version file found
[68.791s][warning][jfr] @Name ignored, not a valid Java identifier.
14:26:32,677 WARN  [io.net.res.dns.DnsServerAddressStreamProviders] Can not find io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider in the classpath, fallback to system defaults. This may result in incorrect DNS resolutions on MacOS. Check whether you have a dependency on 'io.netty:netty-resolver-dns-native-macos'
[2/8] Performing analysis...  [******]                                                                  (55.6s @ 2.24GB)
   19,464 reachable types   (88.4% of   22,018 total)
   30,469 reachable fields  (60.0% of   50,795 total)
   99,605 reachable methods (58.0% of  171,815 total)
    5,570 types,   328 fields, and 3,769 methods registered for reflection
       63 types,    67 fields, and    55 methods registered for JNI access
        5 native libraries: -framework CoreServices, -framework Foundation, dl, pthread, z

Error: An object of type 'datadog.trace.api.Config' was found in the image heap. This type, however, is marked for initialization at image run time for the following reason: classes are initialized at run time by default.
This is not allowed for correctness reasons: All objects that are stored in the image heap must be initialized at build time.

You now have two options to resolve this:

1) If it is intended that objects of type 'datadog.trace.api.Config' are persisted in the image heap, add 

    '--initialize-at-build-time=datadog.trace.api.Config'

to the native-image arguments. Note that initializing new types can store additional objects to the heap. It is advised to check the static fields of 'datadog.trace.api.Config' to see if they are safe for build-time initialization,  and that they do not contain any sensitive data that should not become part of the image.

2) If these objects should not be stored in the image heap, you can use 

    '--trace-object-instantiation=datadog.trace.api.Config'

to find classes that instantiate these objects. Once you found such a class, you can mark it explicitly for run time initialization with 

    '--initialize-at-run-time=<culprit>'

to prevent the instantiation of the object.

If you are seeing this message after enabling '--strict-image-heap', this means that some objects ended up in the image heap without their type being marked with --initialize-at-build-time.
To fix this, include '--initialize-at-build-time=datadog.trace.api.Config' in your configuration. If the classes do not originate from your code, it is advised to update all library or framework dependencies to the latest version before addressing this error.
Please address this problem to be prepared for future releases of GraalVM.

The following detailed trace displays from which field in the code the object was reached.
Detailed message:
Trace: Object was reached by
  reading field datadog.trace.agent.core.tagprocessor.RemoteHostnameAdder.config of constant 
    datadog.trace.agent.core.tagprocessor.RemoteHostnameAdder@7926db22: datadog.trace.agent.core.tagprocessor.RemoteHostnameAdder@7926db22
  indexing into array datadog.trace.agent.core.tagprocessor.TagsPostProcessor[]@9081169: [Ldatadog.trace.agent.core.tagprocessor.TagsPostProcessor;@9081169
  reading field datadog.trace.agent.core.tagprocessor.PostProcessorChain.chain of constant 
    datadog.trace.agent.core.tagprocessor.PostProcessorChain@1223356b: datadog.trace.agent.core.tagprocessor.PostProcessorChain@1223356b
  reading static field datadog.trace.agent.core.tagprocessor.TagsPostProcessorFactory$Lazy.instance
    at datadog.trace.agent.core.tagprocessor.TagsPostProcessorFactory$Lazy.access$200(TagsPostProcessorFactory.java:11)
  parsing method datadog.trace.agent.core.tagprocessor.TagsPostProcessorFactory$Lazy.access$200(TagsPostProcessorFactory.java:11) reachable via the parsing context
    at static root method.(Unknown Source)

com.oracle.svm.core.util.UserError$UserException: An object of type 'datadog.trace.api.Config' was found in the image heap. This type, however, is marked for initialization at image run time for the following reason: classes are initialized at run time by default.
This is not allowed for correctness reasons: All objects that are stored in the image heap must be initialized at build time.

You now have two options to resolve this:

1) If it is intended that objects of type 'datadog.trace.api.Config' are persisted in the image heap, add 

    '--initialize-at-build-time=datadog.trace.api.Config'

to the native-image arguments. Note that initializing new types can store additional objects to the heap. It is advised to check the static fields of 'datadog.trace.api.Config' to see if they are safe for build-time initialization,  and that they do not contain any sensitive data that should not become part of the image.

2) If these objects should not be stored in the image heap, you can use 

    '--trace-object-instantiation=datadog.trace.api.Config'

to find classes that instantiate these objects. Once you found such a class, you can mark it explicitly for run time initialization with 

    '--initialize-at-run-time=<culprit>'

to prevent the instantiation of the object.

If you are seeing this message after enabling '--strict-image-heap', this means that some objects ended up in the image heap without their type being marked with --initialize-at-build-time.
To fix this, include '--initialize-at-build-time=datadog.trace.api.Config' in your configuration. If the classes do not originate from your code, it is advised to update all library or framework dependencies to the latest version before addressing this error.
Please address this problem to be prepared for future releases of GraalVM.

The following detailed trace displays from which field in the code the object was reached.
Detailed message:
Trace: Object was reached by
  reading field datadog.trace.agent.core.tagprocessor.RemoteHostnameAdder.config of constant 
    datadog.trace.agent.core.tagprocessor.RemoteHostnameAdder@7926db22: datadog.trace.agent.core.tagprocessor.RemoteHostnameAdder@7926db22
  indexing into array datadog.trace.agent.core.tagprocessor.TagsPostProcessor[]@9081169: [Ldatadog.trace.agent.core.tagprocessor.TagsPostProcessor;@9081169
  reading field datadog.trace.agent.core.tagprocessor.PostProcessorChain.chain of constant 
    datadog.trace.agent.core.tagprocessor.PostProcessorChain@1223356b: datadog.trace.agent.core.tagprocessor.PostProcessorChain@1223356b
  reading static field datadog.trace.agent.core.tagprocessor.TagsPostProcessorFactory$Lazy.instance
    at datadog.trace.agent.core.tagprocessor.TagsPostProcessorFactory$Lazy.access$200(TagsPostProcessorFactory.java:11)
  parsing method datadog.trace.agent.core.tagprocessor.TagsPostProcessorFactory$Lazy.access$200(TagsPostProcessorFactory.java:11) reachable via the parsing context
    at static root method.(Unknown Source)

        at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.UserError.abort(UserError.java:85)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FallbackFeature.reportAsFallback(FallbackFeature.java:248)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:814)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:592)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:550)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:539)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:721)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:143)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:98)
Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: An object of type 'datadog.trace.api.Config' was found in the image heap. This type, however, is marked for initialization at image run time for the following reason: classes are initialized at run time by default.
This is not allowed for correctness reasons: All objects that are stored in the image heap must be initialized at build time.

You now have two options to resolve this:

1) If it is intended that objects of type 'datadog.trace.api.Config' are persisted in the image heap, add 

    '--initialize-at-build-time=datadog.trace.api.Config'

to the native-image arguments. Note that initializing new types can store additional objects to the heap. It is advised to check the static fields of 'datadog.trace.api.Config' to see if they are safe for build-time initialization,  and that they do not contain any sensitive data that should not become part of the image.

2) If these objects should not be stored in the image heap, you can use 

    '--trace-object-instantiation=datadog.trace.api.Config'

to find classes that instantiate these objects. Once you found such a class, you can mark it explicitly for run time initialization with 

    '--initialize-at-run-time=<culprit>'

to prevent the instantiation of the object.

If you are seeing this message after enabling '--strict-image-heap', this means that some objects ended up in the image heap without their type being marked with --initialize-at-build-time.
To fix this, include '--initialize-at-build-time=datadog.trace.api.Config' in your configuration. If the classes do not originate from your code, it is advised to update all library or framework dependencies to the latest version before addressing this error.
Please address this problem to be prepared for future releases of GraalVM.

The following detailed trace displays from which field in the code the object was reached.
Detailed message:
Trace: Object was reached by
  reading field datadog.trace.agent.core.tagprocessor.RemoteHostnameAdder.config of constant 
    datadog.trace.agent.core.tagprocessor.RemoteHostnameAdder@7926db22: datadog.trace.agent.core.tagprocessor.RemoteHostnameAdder@7926db22
  indexing into array datadog.trace.agent.core.tagprocessor.TagsPostProcessor[]@9081169: [Ldatadog.trace.agent.core.tagprocessor.TagsPostProcessor;@9081169
  reading field datadog.trace.agent.core.tagprocessor.PostProcessorChain.chain of constant 
    datadog.trace.agent.core.tagprocessor.PostProcessorChain@1223356b: datadog.trace.agent.core.tagprocessor.PostProcessorChain@1223356b
  reading static field datadog.trace.agent.core.tagprocessor.TagsPostProcessorFactory$Lazy.instance
    at datadog.trace.agent.core.tagprocessor.TagsPostProcessorFactory$Lazy.access$200(TagsPostProcessorFactory.java:11)
  parsing method datadog.trace.agent.core.tagprocessor.TagsPostProcessorFactory$Lazy.access$200(TagsPostProcessorFactory.java:11) reachable via the parsing context
    at static root method.(Unknown Source)

        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.constraints.UnsupportedFeatures.report(UnsupportedFeatures.java:126)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:809)
        ... 6 more
------------------------------------------------------------------------------------------------------------------------
                        7.9s (9.0% of total time) in 69 GCs | Peak RSS: 3.64GB | CPU load: 5.86
------------------------------------------------------------------------------------------------------------------------
Produced artifacts:
 /Users/lucas.ferreira/Downloads/kafka-with-quarkus/target/kafka-with-quarkus-1.0.0-SNAPSHOT-native-image-source-jar/kafka-with-quarkus-1.0.0-SNAPSHOT-runner-build-output-stats.json (build_info)
mcculls commented 3 weeks ago

I wonder if it's the -H:+AllowFoldMethods feature - our existing smoke tests don't use that...

Warning: The NATIVE_IMAGE_DEPRECATED_BUILDER_SANITATION environment variable is deprecated and might be removed in a future release. Please refer to the GraalVM release notes.
========================================================================================================================
GraalVM Native Image: Generating 'native-3.0-smoketest' (executable)...
========================================================================================================================
For detailed information and explanations on the build output, visit:
https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/BuildOutput.md
------------------------------------------------------------------------------------------------------------------------
[6.055s][warning][jfr] @Name ignored, not a valid Java identifier.
[1/8] Initializing...                                                                                    (7.6s @ 0.14GB)
 Java version: 21.0.2+13, vendor version: GraalVM CE 21.0.2+13.1
 Graal compiler: optimization level: b, target machine: x86-64-v3
 C compiler: gcc (linux, x86_64, 11.4.0)
 Garbage collector: Serial GC (max heap size: 80% of RAM)
 2 user-specific feature(s):
 - com.oracle.svm.thirdparty.gson.GsonFeature
 - org.springframework.aot.nativex.feature.PreComputeFieldFeature
------------------------------------------------------------------------------------------------------------------------
 5 experimental option(s) unlocked:
 - '-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.DeadlockEvent:build_time,com.datadog.profiling.controller.openjdk.events.ProfilerSettingEvent:build_time,com.datadog.profiling.controller.openjdk.events.EndpointEvent:build_time,com.datadog.profiling.controller.openjdk.events.QueueTimeEvent:build_time,com.datadog.profiling.controller.openjdk.events.TimelineEvent:build_time,com.datadog.profiling.controller.openjdk.events.SmapEntryEvent:build_time,com.datadog.profiling.controller.openjdk.events.SmapEntryFactory$SmapParseErrorEvent: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.config.provider.OtelEnvironmentConfigSource: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.InstrumentationErrors: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.bootstrap.instrumentation.jfr.backpressure.BackpressureSampleEvent:build_time,datadog.trace.bootstrap.instrumentation.jfr.directallocation.DirectAllocationTotalEvent:build_time,datadog.trace.logging.LoggingSettingsDescription:build_time,datadog.trace.logging.simplelogger.SLCompatFactory:build_time,datadog.trace.logging.LogReporter:build_time,datadog.trace.logging.PrintStreamWrapper: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=org.springframework.aot.nativex.feature.ThrowawayClassLoader:build_time; origin(s): command line)
 - '-H:EnableURLProtocols' (alternative API option(s): --enable-http, --enable-http, --enable-https; origin(s): command line)
 - '-H:ResourceConfigurationResources' (origin(s): 'META-INF/native-image/org.apache.tomcat.embed/tomcat-embed-websocket/native-image.properties' in 'file:///home/circleci/.gradle/caches/modules-2/files-2.1/org.apache.tomcat.embed/tomcat-embed-websocket/10.1.1/c5a12c16c7ae8dc39f6dad01e486f6c76ef10343/tomcat-embed-websocket-10.1.1.jar', 'META-INF/native-image/org.apache.tomcat.embed/tomcat-embed-core/native-image.properties' in 'file:///home/circleci/.gradle/caches/modules-2/files-2.1/org.apache.tomcat.embed/tomcat-embed-core/10.1.1/d3bbf1c2c71a79c5c472090c31e3c28efea5304e/tomcat-embed-core-10.1.1.jar', 'META-INF/native-image/org.apache.tomcat.embed/tomcat-embed-el/native-image.properties' in 'file:///home/circleci/.gradle/caches/modules-2/files-2.1/org.apache.tomcat.embed/tomcat-embed-el/10.1.1/a5282bdc29026cacc8e2941b53c78621beed4c7/tomcat-embed-el-10.1.1.jar')
 - '-H:IncludeResources' (origin(s): command line)
 - '-H:ReflectionConfigurationResources' (origin(s): command line, 'META-INF/native-image/org.apache.tomcat.embed/tomcat-embed-websocket/native-image.properties' in 'file:///home/circleci/.gradle/caches/modules-2/files-2.1/org.apache.tomcat.embed/tomcat-embed-websocket/10.1.1/c5a12c16c7ae8dc39f6dad01e486f6c76ef10343/tomcat-embed-websocket-10.1.1.jar', 'META-INF/native-image/org.apache.tomcat.embed/tomcat-embed-core/native-image.properties' in 'file:///home/circleci/.gradle/caches/modules-2/files-2.1/org.apache.tomcat.embed/tomcat-embed-core/10.1.1/d3bbf1c2c71a79c5c472090c31e3c28efea5304e/tomcat-embed-core-10.1.1.jar', 'META-INF/native-image/org.apache.tomcat.embed/tomcat-embed-el/native-image.properties' in 'file:///home/circleci/.gradle/caches/modules-2/files-2.1/org.apache.tomcat.embed/tomcat-embed-el/10.1.1/a5282bdc29026cacc8e2941b53c78621beed4c7/tomcat-embed-el-10.1.1.jar')
------------------------------------------------------------------------------------------------------------------------
Build resources:
 - 11.60GB of memory (75.6% of 15.35GB system memory, determined at start)
 - 4 thread(s) (100.0% of 4 available processor(s), determined at start)
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#romePresent set to false at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#jaxb2Present set to false at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#jackson2Present set to true at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#jackson2XmlPresent set to false at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#jackson2SmilePresent set to false at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#jackson2CborPresent set to false at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#gsonPresent set to false at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#jsonbPresent set to false at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#kotlinSerializationCborPresent set to false at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#kotlinSerializationJsonPresent set to false at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#kotlinSerializationProtobufPresent set to false at build time
Field org.apache.commons.logging.LogAdapter#log4jSpiPresent set to true at build time
Field org.apache.commons.logging.LogAdapter#log4jSlf4jProviderPresent set to true at build time
Field org.apache.commons.logging.LogAdapter#slf4jSpiPresent set to true at build time
Field org.apache.commons.logging.LogAdapter#slf4jApiPresent set to true at build time
Field org.springframework.boot.logging.log4j2.Log4J2LoggingSystem$Factory#PRESENT set to false at build time
Field org.springframework.boot.logging.logback.LogbackLoggingSystem$Factory#PRESENT set to true at build time
Field org.springframework.core.NativeDetector#imageCode set to true at build time
Field org.springframework.web.client.RestTemplate#romePresent set to false at build time
Field org.springframework.web.client.RestTemplate#jaxb2Present set to false at build time
Field org.springframework.web.client.RestTemplate#jackson2Present set to true at build time
Field org.springframework.web.client.RestTemplate#jackson2XmlPresent set to false at build time
Field org.springframework.web.client.RestTemplate#jackson2SmilePresent set to false at build time
Field org.springframework.web.client.RestTemplate#jackson2CborPresent set to false at build time
Field org.springframework.web.client.RestTemplate#gsonPresent set to false at build time
Field org.springframework.web.client.RestTemplate#jsonbPresent set to false at build time
Field org.springframework.web.client.RestTemplate#kotlinSerializationCborPresent set to false at build time
Field org.springframework.web.client.RestTemplate#kotlinSerializationJsonPresent set to false at build time
Field org.springframework.web.client.RestTemplate#kotlinSerializationProtobufPresent set to false at build time
Field org.springframework.boot.logging.java.JavaLoggingSystem$Factory#PRESENT set to true at build time
Field org.springframework.cglib.core.AbstractClassGenerator#imageCode set to true at build time
Field org.springframework.core.KotlinDetector#kotlinPresent set to false at build time
Field org.springframework.core.KotlinDetector#kotlinReflectPresent set to false at build time
Field org.springframework.format.support.DefaultFormattingConversionService#jsr354Present set to false at build time
Field org.springframework.web.context.support.StandardServletEnvironment#jndiPresent set to true at build time
Field org.springframework.boot.logging.logback.LogbackLoggingSystemProperties#JBOSS_LOGGING_PRESENT set to false at build time
Field org.springframework.web.servlet.view.InternalResourceViewResolver#jstlPresent set to false at build time
Field org.springframework.web.context.support.WebApplicationContextUtils#jsfPresent set to false at build time
Field org.springframework.web.context.request.RequestContextHolder#jsfPresent set to false at build time
Field org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter#jaxb2Present set to false at build time
Field org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter#jackson2Present set to true at build time
Field org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter#jackson2XmlPresent set to false at build time
Field org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter#jackson2SmilePresent set to false at build time
Field org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter#gsonPresent set to false at build time
Field org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter#jsonbPresent set to false at build time
Field org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter#kotlinSerializationCborPresent set to false at build time
Field org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter#kotlinSerializationJsonPresent set to false at build time
Field org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter#kotlinSerializationProtobufPresent set to false at build time
Field org.springframework.boot.autoconfigure.web.format.WebConversionService#JSR_354_PRESENT set to false at build time
Field org.springframework.core.ReactiveAdapterRegistry#reactorPresent set to false at build time
Field org.springframework.core.ReactiveAdapterRegistry#rxjava3Present set to false at build time
Field org.springframework.core.ReactiveAdapterRegistry#kotlinCoroutinesPresent set to false at build time
Field org.springframework.core.ReactiveAdapterRegistry#mutinyPresent set to false at build time
Field org.springframework.web.servlet.mvc.method.annotation.ReactiveTypeHandler#isContextPropagationPresent set to false at build time
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Field org.springframework.context.event.ApplicationListenerMethodAdapter#reactiveStreamsPresent set to false at build time
Field org.springframework.web.servlet.support.RequestContext#jstlPresent set to false at build time
[2/8] Performing analysis...  [*****]                                                                   (79.3s @ 1.41GB)
   19,016 reachable types   (89.9% of   21,145 total)
   30,203 reachable fields  (60.4% of   50,029 total)
   89,717 reachable methods (62.7% of  142,997 total)
    5,800 types,   442 fields, and 4,506 methods registered for reflection
       62 types,    63 fields, and    55 methods registered for JNI access
        4 native libraries: dl, pthread, rt, z
[3/8] Building universe...                                                                              (11.5s @ 2.47GB)
[4/8] Parsing methods...      [***]                                                                      (6.9s @ 2.42GB)
[5/8] Inlining methods...     [****]                                                                     (4.7s @ 2.41GB)
[6/8] Compiling methods...    [******]                                                                  (37.3s @ 1.86GB)
[7/8] Layouting methods...    [***]                                                                      (7.1s @ 1.77GB)
[8/8] Creating image...       [***]                                                                      (7.1s @ 2.56GB)
  40.87MB (42.44%) for code area:    57,164 compilation units
  52.25MB (54.25%) for image heap:  491,169 objects and 424 resources
   3.19MB ( 3.32%) for other data
  96.31MB in total
------------------------------------------------------------------------------------------------------------------------
Top 10 origins of code area:                                Top 10 object types in image heap:
  13.68MB java.base                                           13.97MB byte[] for code metadata
   4.14MB tomcat-embed-core-10.1.1.jar                         6.81MB byte[] for java.lang.String
   3.54MB java.xml                                             4.51MB java.lang.Class
   1.91MB jackson-databind-2.14.1.jar                          4.43MB char[]
   1.49MB svm.jar (Native Image)                               4.28MB java.lang.String
   1.32MB spring-core-6.0.2.jar                                3.81MB byte[] for embedded resources
   1.19MB com.google.re2j                                      1.74MB com.oracle.svm.core.hub.DynamicHubCompanion
   1.12MB spring-boot-3.0.0.jar                                1.02MB byte[] for reflection metadata
 802.65kB spring-beans-6.0.2.jar                             949.47kB com.oracle.svm.core.jfr.JfrNativeEventSetting
 779.46kB spring-webmvc-6.0.2.jar                            943.28kB byte[] for general heap data
  10.54MB for 202 more packages                                9.85MB for 4232 more object types
------------------------------------------------------------------------------------------------------------------------
Recommendations:
 INIT: Adopt '--strict-image-heap' to prepare for the next GraalVM release.
 HEAP: Set max heap for improved and more predictable memory usage.
 CPU:  Enable more CPU features with '-march=native' for improved performance.
------------------------------------------------------------------------------------------------------------------------
                       20.0s (12.2% of total time) in 161 GCs | Peak RSS: 4.85GB | CPU load: 3.45
------------------------------------------------------------------------------------------------------------------------
Produced artifacts:
 /home/circleci/dd-trace-java/workspace/dd-smoke-tests/spring-boot-3.0-native/build/application/native/nativeCompile/native-3.0-smoketest (executable)
========================================================================================================================
Finished generating 'native-3.0-smoketest' in 2m 42s.
[native-image-plugin] Native Image written to: /home/circleci/dd-trace-java/workspace/dd-smoke-tests/spring-boot-3.0-native/build/application/native/nativeCompile

BUILD SUCCESSFUL in 2m 57s
mcculls commented 3 weeks ago

I noticed that Quarkus uses the --strict-image-heap option - there are a few other differences in flags that control resolution, such as --link-at-build-time - so it's likely a combination of these flags which our current smoke tests don't cover. We'll look at extending them to include a Quarkus native example.

github-actions[bot] commented 1 week ago

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