-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[GR-50854] [GR-50853] Native Image: ClassCastException: class jdk.vm.ci.meta.NullConstant cannot be cast to class org.graalvm.compiler.core.common.type.TypedConstant #7986
Comments
This might be a duplicate of #7500 |
The stack trace suggests that the build failed generating a build report. If you remove the -H:+BuildReport option, does the problem go away? |
Scratch that...the error is thrown in |
Thank you 😊 If I can help with anything please let me know. |
Is there any way you could provide us with a reproducer, @mmoayyed? |
I'll give it a shot, sure. At the moment I am working off of https://github.com/apereo/cas/ which might be too big of a reproducer. I'll work on a smaller sample. Thanks much for looking into this! |
It doesn't really matter how big the project is. If it's relatively easy to reproduce with the code from the project you mentioned, please feel free to share the steps so that we can take a closer look. Thanks! |
Sure, let's try with these: git clone --depth=1 --branch=master git@github.com:mmoayyed/cas.git
cd cas Then: ./gradlew :webapp:cas-server-webapp-native:build :webapp:cas-server-webapp-native:nativeCompile \
-DaotSpringActiveProfiles=none -DskipNestedConfigMetadataGen=true -x check -x test -x javadoc \
--build-cache --configure-on-demand --parallel -DcasModules=throttle,throttle-hazelcast \
--no-watch-fs --max-workers=8 --no-configuration-cache You should then see this when the AOT step runs in the banner:
This step should fail. |
Thanks for the reproducer. We're integrating #8039 with a fix for this. Even though the problem is no longer hit, I still can't build your reproducer successfully as it fails due to a heap policy issue. |
Thanks much for the update. Look forward to testing the fix :) To be sure, are you saying you're running out of heap memory? Would adjusting these lines help? |
You are welcome!
No, the build does not fail with an OOM error. It fails because objects are added to the image heap that are not explicitly allowed. For general info, see #4684. Long story short: you need to adjust your list of classes for build-time init. I'd recommend you reduce your current list. |
Thank you. That is interesting. I wonder if there is something specific about this particular scenario that leads to heap policy issues. Lots of other native tests with the exact same setup are able to build fine, but nonetheless, I will certainly work on trimming down that list. Thanks again for the fix! |
@fniephaus could I ask you to please clarify whether the fix, #8039, would be included in some upcoming patch release of GraalVM? I am at the moment running |
Hi @mmoayyed, the fix should ship with Oracle GraalVM 21.0.2 which is due on Jan 16, 2024 (next Tuesday). Hope this helps! |
|
@linghengqian our dev build pipeline broke over the holidays and we are unfortunately still working on resolving the issues. we'll hopefully have new dev builds very soon. |
Running with Gradle
8.5
, and GraalVM23.1.1
, the following stacktrace shows up when native images are built:The particular application I am testing is a Java Spring Boot 3.2 web application that also does contain Hazelcast
5.3.6
. This Hazelcast library I think is somehow contributing to the issue here.The text was updated successfully, but these errors were encountered: