-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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] NPE when building image serialization-config involving invalid customTargetConstructorClass #3521
Comments
@aldettinger thanks for reporting the issue, we will check it out and get back to you |
@aldettinger is it possible to provide a simple reprodcuer or a sample code? |
I'm trying to setup a simple reproducer but not succeeding yet. As of today, I could only reproduce on the CAMEL-QUARKUS-2107 branch as described in steps to reproduce. Are you able to reproduce on that branch ? I should be able to assist if you have issues building it. |
@mcraj017 The steps to reproduce section was dubious and I have corrected it. Locally, I could rebuild and reproduce from there with java 11, maven 3.6.3 and native-image 21.1.0. It arguably takes a while to build and would be good to shrink the reproducer but at this stage I've not succeeded. |
@aldettinger I tired but got error at the end, I will give a try again, thanks |
@mcraj017 Sure, in case of persisting issue, I'm happy to help. |
@mcraj017 I was able to shrink to a more minimal reproducer. Does it reproduce on your side too ? |
@aldettinger many thanks for the reduced reproducer. I can confirm that it allows us to reproduce the issue. |
@aldettinger what you are doing in
Usually this is not necessary as serialization infrastructure decides itself which constructor should be used to initialize the object that needs to be deserialized. The constructor that will be used is specified in the serialization specification chapter 3.1 (11.a.) https://docs.oracle.com/javase/8/docs/platform/serialization/spec/input.html For regular serialization use cases the That said, if a |
BTW, #3581 will add agent support for generating serialization-configs where |
@olpaw Many thanks for taking a look. Ok, so having I've debugged the JBoss River case at hand and it happens that |
Describe the issue
This issue occurs in the context of building a native executable involving JBoss River serialization. From #3156, it looks that one needs to add an entry in serialization-config.json for each direct call to
jdk.internal.reflect.ReflectionFactory#newConstructorForSerialization(Class<?>, Constructor<?>)
. In the case at hand, we end up with a serialization-configs with 400 entries but the build fails with ajava.lang.NullPointerException
.Steps to reproduce the issue
I was not able to setup a minimal reproducer but steps below should do the job
Describe GraalVM and your environment:
GraalVM 21.1.0 Java 11 CE (Java Version 11.0.11+8-jvmci-21.1-b05)
openjdk version "11.0.9.1" 2020-11-04
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.9.1+1)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.9.1+1, mixed mode)
Linux aldettinger.remote.csb 3.10.0-1160.25.1.el7.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux
More details
The text was updated successfully, but these errors were encountered: