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

Different result presented in os.arch between openjdk and openj9 on Mac #5493

Closed
kiszk opened this issue Apr 15, 2019 · 8 comments · Fixed by #5556
Closed

Different result presented in os.arch between openjdk and openj9 on Mac #5493

kiszk opened this issue Apr 15, 2019 · 8 comments · Fixed by #5556
Assignees

Comments

@kiszk
Copy link

kiszk commented Apr 15, 2019

I realized that os.arch is different between openjdk and openj9 on Mac. On Linux, they return the same os.arch.

$ /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/bin/java -XshowSettings:all
...
    os.arch = x86_64
...
$ /Library/Java/JavaVirtualMachines/adoptopenjdk-8-openj9.jdk/Contents/Home/bin/java -XshowSettings:all
...
    os.arch = amd64
...

This difference causes an JNI link error in Spark. This is because zstd-jni determines dll path by using os.arch as a part of the path name.

@keithc-ca
Copy link
Contributor

This seems to be platform specific: on a Linux x86 system:

$ ./bin/java -version
openjdk version "1.8.0_202"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_202-b08)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.202-b08, mixed mode)
$ ./bin/java -XshowSettings:properties |& grep os.arch
    os.arch = amd64

It's surprising to me that hotspot would use a different name on MacOSX for the same CPU architecture.

@kiszk
Copy link
Author

kiszk commented Apr 15, 2019

Yes, this problem occurs only on Mac.

This code seems to try to follow the behavior of OpenJDK. I am investigating why it does not work.

@DanHeidinga
Copy link
Member

To fix this we either need to

  1. update j9sysinfo_get_CPU_architecture / omrsysinfo_get_CPU_architecture to return x86_64 and check all the callers are ready to deal with this string, or
  2. change vmprops.c to map from amd64 to x86_64 on osx.

@kiszk
Copy link
Author

kiszk commented Apr 17, 2019

Thank you for your investigation and comments.
IMHO, 2. is preferable to me.

@pshipton
Copy link
Member

@keithc-ca can you please open a PR to fix this for the 0.14.2 release.

@keithc-ca
Copy link
Contributor

can you please open a PR to fix this for the 0.14.2 release

Done, see #5771.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants