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

Integration tests using avro fail to compile natively with GraalVM CE 21.3 Java 17 #21370

Closed
Tracked by #21481
zakkak opened this issue Nov 11, 2021 · 3 comments
Closed
Tracked by #21481
Labels
area/native-image kind/bug Something isn't working

Comments

@zakkak
Copy link
Contributor

zakkak commented Nov 11, 2021

Describe the bug

Native compilation of integration tests using apache avro fails with GraalVM CE 21.3 Java17 (quay.io/quarkus/ubi-quarkus-native-image:21.3-java17)

Namely the following tests fail to build:

  • kafka-avro
  • kafka-avro-apicurio2

See https://github.com/graalvm/mandrel/runs/4170345140?check_suite_focus=true

Note that this is not a Quarkus issue. The underlying issue is only reproducible on Java 17 and is being tracked upstream at oracle/graal#4006

Expected behavior

Tests should build and run.

Actual behavior

Tests fail to build with:

Error: com.oracle.svm.hosted.substitute.DeletedElementException: Unsupported method java.lang.Class.protectionDomain() is reachable: The declaring class of this element has been substituted, but this element is not present in the substitution class
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.
Detailed message:
Trace: 
	at parsing java.lang.System$2.protectionDomain(System.java:2418)
Call path from entry point to java.lang.System$2.protectionDomain(Class): 
	at java.lang.System$2.protectionDomain(System.java:2418)
	at java.lang.invoke.MethodHandles$Lookup.lookupClassProtectionDomain(MethodHandles.java:2457)
	at java.lang.invoke.MethodHandles$Lookup$ClassDefiner.defineClass(MethodHandles.java:2437)
	at java.lang.invoke.MethodHandles$Lookup$ClassDefiner.defineClassAsLookup(MethodHandles.java:2420)
	at java.lang.invoke.MethodHandles$Lookup.defineHiddenClass(MethodHandles.java:2127)
	at java.lang.invoke.InnerClassLambdaMetafactory.generateInnerClass(InnerClassLambdaMetafactory.java:407)
	at java.lang.invoke.InnerClassLambdaMetafactory.spinInnerClass(InnerClassLambdaMetafactory.java:315)
	at java.lang.invoke.InnerClassLambdaMetafactory.buildCallSite(InnerClassLambdaMetafactory.java:228)
	at java.lang.invoke.LambdaMetafactory.metafactory(LambdaMetafactory.java:341)
	at org.apache.avro.reflect.ReflectionUtil.getConstructorAsFunction(ReflectionUtil.java:195)
	at org.apache.avro.io.FastReaderBuilder.lambda$getTransformingStringReader$31(FastReaderBuilder.java:439)
	at org.apache.avro.io.FastReaderBuilder$$Lambda$1402/0x00000007c211cf58.apply(Unknown Source)
	at sun.security.ec.ParametersMap$1.get(ParametersMap.java:78)
	at com.oracle.svm.core.jdk.SystemPropertiesSupport.initializeLazyValue(SystemPropertiesSupport.java:216)
	at com.oracle.svm.core.jdk.SystemPropertiesSupport.getProperty(SystemPropertiesSupport.java:169)
	at com.oracle.svm.core.jdk.Target_java_lang_System.getProperty(JavaLangSubstitutions.java:287)
	at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_VA_LIST_System_getProperty_deeeaa72a006d330408a3b7d002c7533e108bc28(generated:0)
...

How to Reproduce?

./mvnw -Dnative -Dnative.surefire.skip -pl integration-tests/kafka-avro package -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-native-image:21.3-java17

Output of uname -a or ver

5.14.15-200.fc34.x86_64 #1 SMP Wed Oct 27 15:53:30 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

OpenJDK 64-Bit Server VM Temurin-11.0.13+8 (build 11.0.13+8, mixed mode)

GraalVM version (if different from Java)

OpenJDK 64-Bit Server VM GraalVM CE 21.3.0 (build 17.0.1+12-jvmci-21.3-b05, mixed mode, sharing)

Quarkus version or git rev

132d9ea

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)

@quarkus-bot
Copy link

quarkus-bot bot commented Nov 11, 2021

/cc @Karm, @galderz

@zakkak zakkak added area/native-image kind/bug Something isn't working and removed area/mandrel labels Nov 11, 2021
@zakkak zakkak changed the title ntegration tests using avro fail to compile natively with GraalVM CE 21.3 Java 17 Integration tests using avro fail to compile natively with GraalVM CE 21.3 Java 17 Nov 11, 2021
@cescoffier
Copy link
Member

Closed by #21464

@galderz
Copy link
Member

galderz commented Nov 16, 2021

Nice fix! Thx @cescoffier

@maxandersen maxandersen mentioned this issue Nov 16, 2021
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/native-image kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants