Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GraalVM for JDK 22] kafka-oauth-keycloak native integration test fails with latest GraalVM sources #37862

Closed
jerboaa opened this issue Dec 20, 2023 · 2 comments · Fixed by #38117
Assignees
Milestone

Comments

@jerboaa
Copy link
Contributor

jerboaa commented Dec 20, 2023

Describe the bug

Since yesterday (Dec 19, 2024) we see the quarkus-integration-test-kafka-oauth-keycloak native integration test fail with:

 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.
========================================================================================================================
GraalVM Native Image: Generating 'quarkus-integration-test-kafka-oauth-keycloak-999-SNAPSHOT-runner' (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
------------------------------------------------------------------------------------------------------------------------
[1/8] Initializing...                                                                                    (7.7s @ 0.16GB)
 Java version: 22-beta+28-202312151258, vendor version: Mandrel-24.0.0.0-dev6d42592f
 Graal compiler: optimization level: 2, target machine: x86-64-v3
 C compiler: gcc (linux, x86_64, 11.4.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
------------------------------------------------------------------------------------------------------------------------
 5 experimental option(s) unlocked:
 - '-H:+AllowFoldMethods' (origin(s): command line)
 - '-H:BuildOutputJSONFile' (origin(s): command line)
 - '-H:-UseServiceLoaderFeature' (origin(s): command line)
 - '-H:AdditionalSecurityProviders' (origin(s): command line)
 - '-H:ReflectionConfigurationResources': Use a reflect-config.json in your META-INF/native-image/<groupID>/<artifactID> directory instead. (origin(s): 'META-INF/native-image/io.netty/netty-transport/native-image.properties' in 'file:///home/runner/work/mandrel/mandrel/quarkus/integration-tests/kafka-oauth-keycloak/target/quarkus-integration-test-kafka-oauth-keycloak-999-SNAPSHOT-native-image-source-jar/lib/io.netty.netty-transport-4.1.100.Final.jar')
------------------------------------------------------------------------------------------------------------------------
Build resources:
 - 4.44GB of memory (28.5% of 15.61GB system memory, set via '-Xmx5g')
 - 4 thread(s) (100.0% of 4 available processor(s), determined at start)
[2/8] Performing analysis...  []                                                                        (18.4s @ 0.41GB)
    4,772 reachable types   (65.7% of    7,259 total)
    4,913 reachable fields  (37.7% of   13,028 total)
   17,395 reachable methods (33.3% of   52,259 total)
    1,759 types,   137 fields, and 1,806 methods registered for reflection

Fatal error: com.oracle.graal.pointsto.util.AnalysisError$ParsingError: Error encountered while parsing com.jayway.jsonpath.Configuration.getEffectiveDefaults(Configuration.java:42) 
Parsing context:
   at com.jayway.jsonpath.Configuration$ConfigurationBuilder.build(Configuration.java:224)
   at io.strimzi.kafka.oauth.jsonpath.JsonPathQuery.<init>(JsonPathQuery.java:87)
   at io.strimzi.kafka.oauth.jsonpath.JsonPathQuery.parse(JsonPathQuery.java:104)
   at io.strimzi.kafka.oauth.common.PrincipalExtractor.parseClaimSpec(PrincipalExtractor.java:168)
   at io.strimzi.kafka.oauth.common.PrincipalExtractor.<init>(PrincipalExtractor.java:68)
   at io.strimzi.kafka.oauth.client.JaasClientOauthLoginCallbackHandler.configure(JaasClientOauthLoginCallbackHandler.java:135)
   at root method.(Unknown Source)

	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.AnalysisError.parsingError(AnalysisError.java:165)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.createFlowsGraph(MethodTypeFlow.java:184)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureFlowsGraphCreated(MethodTypeFlow.java:152)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.getOrCreateMethodFlowsGraphInfo(MethodTypeFlow.java:110)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.typestate.DefaultStaticInvokeTypeFlow.lambda$update$0(DefaultStaticInvokeTypeFlow.java:75)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.LightImmutableCollection.forEach(LightImmutableCollection.java:90)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.typestate.DefaultStaticInvokeTypeFlow.update(DefaultStaticInvokeTypeFlow.java:74)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.PointsToAnalysis$1.run(PointsToAnalysis.java:538)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:169)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:154)
	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.compute(ForkJoinTask.java:1726)
	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.compute(ForkJoinTask.java:1717)
	at java.base/java.util.concurrent.ForkJoinTask$InterruptibleTask.exec(ForkJoinTask.java:1641)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:507)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1491)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:2073)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:2035)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:187)
Caused by: com.oracle.graal.pointsto.util.AnalysisError: java.lang.NullPointerException
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.AnalysisFuture.setException(AnalysisFuture.java:55)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:322)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.AnalysisFuture.ensureDone(AnalysisFuture.java:69)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapConstant.ensureReaderInstalled(ImageHeapConstant.java:112)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapConstant.markReachable(ImageHeapConstant.java:130)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapScanner.markReachable(ImageHeapScanner.java:507)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapScanner.markReachable(ImageHeapScanner.java:501)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapScanner.markReachable(ImageHeapScanner.java:496)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapScanner.onFieldRead(ImageHeapScanner.java:130)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisField.registerAsRead(AnalysisField.java:291)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.registerUsedElements(MethodTypeFlowBuilder.java:298)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:230)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:608)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.createFlowsGraph(MethodTypeFlow.java:167)
	... 16 more
Caused by: java.lang.NullPointerException
	at java.base/java.util.Objects.requireNonNull(Objects.java:220)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.value.ValueSupplier.eagerValue(ValueSupplier.java:46)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.ameta.AnalysisConstantReflectionProvider.readHostedFieldValue(AnalysisConstantReflectionProvider.java:251)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.heap.SVMImageHeapScanner.readHostedFieldValue(SVMImageHeapScanner.java:144)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapScanner.lambda$createImageHeapInstance$6(ImageHeapScanner.java:308)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	... 28 more

See:
https://github.com/graalvm/mandrel/actions/runs/7269633674/job/19808090261#step:12:912

Cause seems to be a NPE when eagerly supplying a value.

Copy link

quarkus-bot bot commented Dec 20, 2023

/cc @Karm (mandrel), @alesj (kafka), @cescoffier (kafka), @galderz (mandrel), @ozangunalp (kafka), @pedroigor (keycloak), @sberyozkin (keycloak), @zakkak (mandrel,native-image)

@zakkak
Copy link
Contributor

zakkak commented Dec 20, 2023

The issue was introduced with oracle/graal#8011 (specifically 8716e0ee64e52a823c0ef3d6f7dfc60231ea4b7d)

The issue happens when accessing field com.jayway.jsonpath.internal.DefaultsImpl.mappingProvider in an instance of io.smallrye.reactive.kafka.graal.Target_com_jayway_jsonpath_internal_DefaultsImpl, which essentially is an instance of com.jayway.jsonpath.internal.DefaultsImpl.

zakkak added a commit to zakkak/quarkus that referenced this issue Jan 10, 2024
Reset `com.jayway.jsonpath.internal.DefaultsImpl#mappingProvider` in
`io.smallrye.reactive.kafka.graal.Target_com_jayway_jsonpath_internal_DefaultsImpl`
since it's no longer used.

Closes quarkusio#37862
zakkak added a commit to zakkak/issue-reproducers that referenced this issue Jan 10, 2024
zakkak added a commit to zakkak/quarkus that referenced this issue Jan 10, 2024
* Don't replace `com.jayway.jsonpath.internal.DefaultsImpl#INSTANCE`,
there is no need.

* Delete `com.jayway.jsonpath.internal.DefaultsImpl#mappingProvider` in
`io.smallrye.reactive.kafka.graal.Target_com_jayway_jsonpath_internal_DefaultsImpl`
since it's no longer used.

Closes quarkusio#37862
@quarkus-bot quarkus-bot bot added this to the 3.7 - main milestone Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants