-
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
Register String(byte[]) constructor for runtime JNI access #3680
Conversation
Not registering this causes failures reported in Quarkus native applications: quarkusio/quarkus#19082 quarkusio/quarkus#10682 (comment)
/cc @zakkak |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks @jaikiran
Hello @cstancu, would you be able to help review and merge this one, if this looks fine? |
Hello @dougxc, would you be able to help to have someone review this PR please? |
@peter-hofer can you please review and merge this if it looks good. |
@dougxc , @peter-hofer what needs to be done to approve this single line change? |
Thank you @dougxc and @peter-hofer for helping in the review and merge. |
More than one user in the Quarkus project has reported that they run into the following exception when building a native image for a Quarkus application:
The previous report of this was in [1] but reproducing that wasn't working out. The more recent report is here [2] and has more clear instructions on how to reproduce this. Looking at the code in these stacktraces and then looking at the JRE code, it comes down to a code path in
jni_util.c
which can lead to a call to thejava.lang.String
constructor which just takes thebyte[]
as a param (as uses the platform encoding internally). This is the place injni_util.c
where that call happens https://github.com/openjdk/jdk11u-dev/blob/master/src/java.base/share/native/libjava/jni_util.c#L732 :The commit in this PR registers this constructor for JNI runtime access to prevent this exception.
[1] quarkusio/quarkus#10682 (comment)
[2] quarkusio/quarkus#19082