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

Native image build fails with VMError$HostedError: Boolean option value can be only + or - #36684

Closed
brunobat opened this issue Oct 25, 2023 · 10 comments
Assignees
Labels

Comments

@brunobat
Copy link
Contributor

brunobat commented Oct 25, 2023

Describe the bug

Build fails with cryptic message and not allowing further actions from the user:
https://github.com/quarkiverse/quarkus-opentelemetry-exporter/actions/runs/6629170891/job/18007855740?pr=104

Fatal error: org.graalvm.compiler.debug.GraalError: com.oracle.svm.core.util.VMError$HostedError: Boolean option value can be only + or -
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.AnalysisFuture.setException(AnalysisFuture.java:49)
	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:63)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapInstance.readFieldValue(ImageHeapInstance.java:110)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapScanner.onObjectReachable(ImageHeapScanner.java:472)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.heap.SVMImageHeapScanner.onObjectReachable(SVMImageHeapScanner.java:156)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapScanner.lambda$markReachable$5(ImageHeapScanner.java:452)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.heap.ImageHeapScanner.lambda$postTask$14(ImageHeapScanner.java:695)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:187)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:171)
	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1423)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)
Caused by: com.oracle.svm.core.util.VMError$HostedError: Boolean option value can be only + or -
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:78)

Also discussed here: https://quarkusio.zulipchat.com/#narrow/stream/187038-dev/topic/GraalVM.20error/near/398318139

Expected behavior

According to @zakkak the message should be:

If you are seeing this message after enabling %s, 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 %s 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.

Actual behavior

build fails with cryptic message

How to Reproduce?

Build this PR with graalvm 21

Output of uname -a or ver

No response

Output of java -version

Java version: 21+35-LTS, vendor version: Mandrel-23.1.0.0-Final

Quarkus version or git rev

At least Quarkus 3.5.0

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

No response

Additional information

See Quarkiverse CI: https://github.com/quarkiverse/quarkus-opentelemetry-exporter/actions/runs/6639560552/job/18038172666?pr=104

@brunobat brunobat added the kind/bug Something isn't working label Oct 25, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Oct 25, 2023

You added a link to a Zulip discussion, please make sure the description of the issue is comprehensive and doesn't require accessing Zulip

This message is automatically generated by a bot.

@quarkus-bot
Copy link

quarkus-bot bot commented Oct 25, 2023

/cc @Karm (mandrel), @galderz (mandrel), @zakkak (mandrel)

@zakkak zakkak self-assigned this Oct 25, 2023
@zakkak
Copy link
Contributor

zakkak commented Oct 25, 2023

This is fixed upstream with oracle/graal@a28e629, the fix is included in GraalVM for 21.0.1 (GraalVM 23.1.1) and will be part of Mandrel 23.1.1.0-Final which is expected to land in the following days.

Leaving the issue open till the Mandrel release becomes available and the quarkus-images get updated.

Thanks for the report @brunobat

@brunobat
Copy link
Contributor Author

Good to hear we will get the fix soon. Thanks @zakkak !

@zakkak
Copy link
Contributor

zakkak commented Oct 30, 2023

@brunobat the aforementioned releases are now available and the updated Mandrel images are now available in quay.io, could you please try and see if they resolve the issue?

Please make sure to pull the latest jdk-21 image (Quarkus should automatically do it for you).

@brunobat
Copy link
Contributor Author

Thanks @zakkak.
Now with Java version: 21.0.1+12-LTS, vendor version: Mandrel-23.1.1.0-Final
I get a different error: https://github.com/quarkiverse/quarkus-opentelemetry-exporter/actions/runs/6639560552/job/18176638457
Not sure if it's best than before.

@zakkak
Copy link
Contributor

zakkak commented Oct 30, 2023

@brunobat that's a known upstream GraalVM bug. You should upgrade to a newer (>= 2.25.0) gax-grpc version which includes googleapis/sdk-platform-java#1892.

@brunobat
Copy link
Contributor Author

brunobat commented Nov 3, 2023

Still no luck after upgrading.
A strange thing is happening, though.

I get different errors depending on the graallvm being used.
Locally, with Java version: 21.0.1+12, vendor version: Oracle GraalVM 21.0.1+12.1I get:

com.oracle.svm.core.util.VMError$HostedError: InternalFeature defined by com.oracle.svm.hosted.ReachabilityHandlerFeature unexpectedly failed with a(n) java.lang.NullPointerException

In the CI, with 21.0.1+12-LTS, vendor version: Mandrel-23.1.1.0-Final
I get:

...
If it is intended that objects of type 'io.grpc.netty.shaded.io.grpc.netty.UdsNameResolverProvider' are persisted in the image heap, add

    '--initialize-at-build-time=io.grpc.netty.shaded.io.grpc.netty.UdsNameResolverProvider'
...

FYI, I added I've added this code to one of the processors:

  NativeImageConfigBuildItem.Builder builder = NativeImageConfigBuildItem.builder()
...
                .addRuntimeReinitializedClass("io.grpc.netty.shaded.io.grpc.netty.UdsNameResolverProvider");
...

@zakkak
Copy link
Contributor

zakkak commented Nov 3, 2023

Locally, with Java version: 21.0.1+12, vendor version: Oracle GraalVM 21.0.1+12.1I get:

Do you get the same error with GraalVM CE 21.0.1? If not, it might be an Oracle GraalVM specific issue.

Still no luck after upgrading.

I suggest closing this issues as fixed (since the initial error no longer appears with the latest GraalVM and Mandrel) and opening a new issue for the new error including the full log, I guess the reproducer is the same?

@brunobat
Copy link
Contributor Author

brunobat commented Nov 3, 2023

Looks good to me.

@brunobat brunobat closed this as completed Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants