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

jdk19 openjdk java/lang/Thread/jni/AttachCurrentThread/AttachTest.java#id1 UnsatisfiedLinkError: jdk/internal/foreign/abi/UpcallLinker.registerNatives()V #15466

Closed
pshipton opened this issue Jun 30, 2022 · 9 comments

Comments

@pshipton
Copy link
Member

pshipton commented Jun 30, 2022

https://openj9-jenkins.osuosl.org/job/Test_openjdk19_j9_sanity.openjdk_aarch64_linux_OpenJDK19/4
jdk_lang_0 & jdk_lang_1
java/lang/Thread/jni/AttachCurrentThread/AttachTest.java#id1

15:16:23  Exception in thread "Thread-0" java.lang.UnsatisfiedLinkError: jdk/internal/foreign/abi/UpcallLinker.registerNatives()V
15:16:23  	at java.base/jdk.internal.foreign.abi.UpcallLinker.<clinit>(UpcallLinker.java:206)
15:16:23  	at java.base/jdk.internal.foreign.abi.aarch64.CallArranger.arrangeUpcall(CallArranger.java:171)
15:16:23  	at java.base/jdk.internal.foreign.abi.aarch64.linux.LinuxAArch64Linker.arrangeUpcall(LinuxAArch64Linker.java:61)
15:16:23  	at java.base/jdk.internal.foreign.abi.AbstractLinker.upcallStub(AbstractLinker.java:70)
15:16:23  	at ImplicitAttach.main(ImplicitAttach.java:53)

https://openj9-jenkins.osuosl.org/job/Test_openjdk19_j9_sanity.openjdk_aarch64_mac_OpenJDK19/3
https://openj9-jenkins.osuosl.org/job/Test_openjdk19_j9_sanity.openjdk_x86-64_linux_OpenJDK19/4/
https://openj9-jenkins.osuosl.org/job/Test_openjdk19_j9_sanity.openjdk_x86-64_mac_OpenJDK19/4

https://openj9-jenkins.osuosl.org/job/Test_openjdk19_j9_sanity.openjdk_ppc64le_linux_OpenJDK19/4

15:53:52  Exception in thread "Thread-0" java.lang.ExceptionInInitializerError
15:53:52  	at java.base/java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:171)
15:53:52  	at java.base/jdk.internal.foreign.abi.SharedUtils$1.<clinit>(SharedUtils.java:236)
15:53:52  	at java.base/jdk.internal.foreign.abi.SharedUtils.getSystemLinker(SharedUtils.java:236)
15:53:52  	at java.base/java.lang.foreign.Linker.nativeLinker(Linker.java:198)
15:53:52  	at ImplicitAttach.main(ImplicitAttach.java:48)
15:53:52  Caused by: java.lang.UnsupportedOperationException: Unsupported os, arch, or address size: Linux, ppc64le, 64
15:53:52  	at java.base/jdk.internal.foreign.CABI.<clinit>(CABI.java:59)
15:53:52  	... 4 more

https://openj9-jenkins.osuosl.org/job/Test_openjdk19_j9_sanity.openjdk_s390x_linux_OpenJDK19/4

15:31:55  Exception in thread "Thread-0" java.lang.ExceptionInInitializerError
15:31:55  	at java.base/java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:171)
15:31:55  	at java.base/jdk.internal.foreign.abi.SharedUtils$1.<clinit>(SharedUtils.java:236)
15:31:55  	at java.base/jdk.internal.foreign.abi.SharedUtils.getSystemLinker(SharedUtils.java:236)
15:31:55  	at java.base/java.lang.foreign.Linker.nativeLinker(Linker.java:198)
15:31:55  	at ImplicitAttach.main(ImplicitAttach.java:48)
15:31:55  Caused by: java.lang.UnsupportedOperationException: Unsupported os, arch, or address size: Linux, s390x, 64
15:31:55  	at java.base/jdk.internal.foreign.CABI.<clinit>(CABI.java:59)
15:31:55  	... 4 more
@pshipton
Copy link
Member Author

@ChengJin01 fyi

@pshipton
Copy link
Member Author

These failures are in the jdk-19+28 acceptance build.
https://openj9-jenkins.osuosl.org/job/Pipeline-OpenJDK19-Acceptance/6/

@ChengJin01
Copy link

ChengJin01 commented Jun 30, 2022

The failing tests above attempted to invoke upcallStub() which are not yet merged to JDK19 (still in the progress of code review via #15068)

15:16:23  	at java.base/jdk.internal.foreign.abi.AbstractLinker.upcallStub(AbstractLinker.java:70) <------
15:16:23  	at ImplicitAttach.main(ImplicitAttach.java:53)

Meanwhile, all previous downcall specific implementation at the java level was entirely removed due to the new API changes in JEP424 and will be replaced with the new code at ibmruntimes/openj9-openjdk-jdk19#5 (not yet merged). So the test need to be excluded till all related code in #15068 are merged to repo.

@pshipton
Copy link
Member Author

pshipton commented Jul 5, 2022

There was a failure after the exclude was merged, it must not be excluded correctly.
https://openj9-jenkins.osuosl.org/job/Test_openjdk19_j9_sanity.openjdk_aarch64_linux_OpenJDK19/5
There are more failures on other platforms in the same build.
https://openj9-jenkins.osuosl.org/job/Pipeline-OpenJDK19-Acceptance/7/

@ChengJin01
Copy link

ChengJin01 commented Jul 5, 2022

It seems the actual test cases are placed at /test/jdk/java/lang/Thread/jni/AttachCurrentThread/ImplicitAttach.java rather than AttachTest which is a helper class in /test/jdk/java/lang/Thread/jni/AttachCurrentThread, which means simply disabling AttachTest won't work in such case. I will create another PR to exclude ImplicitAttach directly to see whether it works as expected.

@tajila
Copy link
Contributor

tajila commented Oct 20, 2022

@ChengJin01 has this been addressed?

@ChengJin01
Copy link

I just verified locally on zLinux which works good as expected:

===============================================
Running test jdk_custom_0 ...
===============================================
jdk_custom_0 Start Time: Thu Oct 20 09:03:25 2022 Epoch Time (ms): 1666281805672
"../jdk19_openj9_ffi_cmk_s390x_v09/bin/java" -Xshareclasses:destroyAll; "../jdk19_openj9_ffi_cmk_s390x_v09/bin/java" -Xshareclasses:groupAccess,destroyAll; echo "cache cleanup done";
...
-jdk:"../jdk19_openj9_ffi_cmk_s390x_v09" \
"../aqa-tests/TKG/../openjdk/openjdk-jdk/test/jdk/test/jdk/java/lang/Thread/jni/AttachCurrentThread/AttachTest.java"; \
if [ $? -eq 0 ] ; then echo ""; echo "jdk_custom_0""_PASSED"; echo ""; cd ../aqa-tests/TKG/..;  else echo ""; echo "jdk_custom_0""_FAILED"; echo ""; fi; } 2>&1 | tee -a "../aqa-tests/TKG/../TKG/output_16662818048524/TestTargetResult";
Directory "../aqa-tests/TKG/../TKG/output_16662818048524/jdk_custom_0/work" not found: creating
Directory "../aqa-tests/TKG/../TKG/output_16662818048524/jdk_custom_0/report" not found: creating
XML output with verification to ../aqa-tests/TKG/output_16662818048524/jdk_custom_0/work
Test results: passed: 2

So it should work fine given the upcall thunk was implemented on all supported platforms. I will need to create a PR at https://github.com/adoptium/aqa-tests to enable this test.

@ChengJin01
Copy link

adoptium/aqa-tests#4068 has been created to enable the test.

@ChengJin01
Copy link

Close this issue as adoptium/aqa-tests#4068 has been merged.

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

No branches or pull requests

3 participants