-
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
MacOS only: Preferences.exportSubtree()/childrenNames() always kills process with "Fatal error reported via JNI: JVM_ArrayCopy called: Unimplemented" #9261
Comments
Can also be reproduced simply by calling childrenNames, which also ultimately calls the same native methods: public class StaticFortune {
public static void main(String[] args) throws InterruptedException {
Preferences prefs = Preferences.userRoot().node("/testapp");
prefs.childrenNames();
}
} |
Thank you for reaching out about this, we'll take a look into it shortly |
Could you please confirm if this issue happens on one of the latest dev builds as well? |
Yes, exact same problem happening on:
Build downloaded from:
|
Thanks for the report @credmond. We saw this internally already at some point (GR-54756), but wasn't considered "important" yet. Thanks for the concise reproducer, I'll have a look. |
Proposed fix: #9285 |
@credmond would you mind giving it another shot with a newer build? https://github.com/graalvm/graalvm-ce-dev-builds/releases |
I can confirm this is fixed in: https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/24.2.0-dev-20240730_0347/graalvm-community-java24-darwin-amd64-dev.tar.gz Thanks! |
Thanks a lot! |
Describe the issue
As per title, on MacOs, calling prefs.exportSubtree(x) always causes "Fatal error reported via JNI: JVM_ArrayCopy called: Unimplemented" and kills the running binary immediately. I suspect this has been a problem forever, as I first noticed it on Gluon's build from 2022 and prefs support was only added a little before that -- but it's still present on the latest CE builds: graalvm-community-openjdk-22.0.1+8.1
I regard this as a serious bug, as these methods are used to import/export preferences, etc. -- behaviour that has been stable for a long time.
Steps to reproduce the issue
Reproducing is simple, simply build a native image with something like the below (i.e, I highjacked the StaticFortune example in the demos folder to reproduce with the smallest/simplest project -- just run the commands in build.sh):
The process dies with key error being: "Fatal error reported via JNI: JVM_ArrayCopy called: Unimplemented".
It's ultimately calling a native method called getChildrenForNode(), and that might be reaching this line here (see stracktrace at bottom for more):
https://github.com/openjdk/jdk/blob/6f7f0f1de05fdc0f6a88ccd90b806e8a5c5074ef/src/java.prefs/macosx/native/libprefs/MacOSXPreferencesFile.m#L1013
JVM_ArrayCopy is obviously used by System.arraycopy() and in a couple of other places, so it definitely exists (and I can call that without issue). There there must be some sort of linking issue.
This problem does NOT occur on Windows or Linux (and the equivalent preferences classes do not refer to JVM_ArrayCopy either).
Describe GraalVM and your environment:
More details
The text was updated successfully, but these errors were encountered: