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

jdk_nio_0_FAILED java/nio/file/attribute/BasicFileAttributeView/CreationTime.java#tmp UnsatisfiedLinkError: Native Library libCreationTimeHelper.so already loaded in another classloader #19978

Closed
JasonFengJ9 opened this issue Aug 7, 2024 · 10 comments · Fixed by #20265

Comments

@JasonFengJ9
Copy link
Member

JasonFengJ9 commented Aug 7, 2024

Failure link

From an internal build(sles15s390x-svl-rt4-1):

java version "21.0.5-beta" 2024-10-15
IBM Semeru Runtime Certified Edition 21.0.5+1-202408031503 (build 21.0.5-beta+1-202408031503)
Eclipse OpenJ9 VM 21.0.5+1-202408031503 (build master-27dac39d2c, JRE 21 Linux s390x-64-Bit Compressed References 20240803_244 (JIT enabled, AOT enabled)
OpenJ9   - 27dac39d2c
OMR      - 9ccff3cf2
JCL      - fbac205a7 based on jdk-21.0.5+1)

Rerun in Grinder - Change TARGET to run only the failed test targets.

Optional info

Failure output (captured from console output)

[2024-08-03T17:27:55.872Z] variation: Mode150
[2024-08-03T17:27:55.872Z] JVM_OPTIONS:  -XX:+UseCompressedOops -Xverbosegclog 

[2024-08-03T17:38:54.587Z] TEST: java/nio/file/attribute/BasicFileAttributeView/CreationTime.java#tmp

[2024-08-03T17:38:54.590Z] STDERR:
[2024-08-03T17:38:54.590Z] java.lang.UnsatisfiedLinkError: Native Library /home/jenkins/workspace/Test_openjdk21_j9_extended.openjdk_s390x_linux_testList_1/jdkbinary/openjdk-test-image/jdk/jtreg/native/libCreationTimeHelper.so already loaded in another classloader
[2024-08-03T17:38:54.590Z] 	at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:186)
[2024-08-03T17:38:54.590Z] 	at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:158)
[2024-08-03T17:38:54.590Z] 	at java.base/jdk.internal.loader.NativeLibraries.findFromPaths(NativeLibraries.java:278)
[2024-08-03T17:38:54.590Z] 	at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:270)
[2024-08-03T17:38:54.590Z] 	at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:1821)
[2024-08-03T17:38:54.590Z] 	at java.base/java.lang.System.loadLibrary(System.java:813)
[2024-08-03T17:38:54.590Z] 	at CreationTimeHelper.<clinit>(CreationTimeHelper.java:26)
[2024-08-03T17:38:54.590Z] 	at CreationTime.test(CreationTime.java:109)
[2024-08-03T17:38:54.590Z] 	at CreationTime.main(CreationTime.java:152)
[2024-08-03T17:38:54.590Z] 	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
[2024-08-03T17:38:54.590Z] 	at java.base/java.lang.reflect.Method.invoke(Method.java:586)
[2024-08-03T17:38:54.590Z] 	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:333)
[2024-08-03T17:38:54.590Z] 	at java.base/java.lang.Thread.run(Thread.java:1595)
[2024-08-03T17:38:54.590Z] 
[2024-08-03T17:38:54.590Z] JavaTest Message: Test threw exception: java.lang.UnsatisfiedLinkError
[2024-08-03T17:38:54.590Z] JavaTest Message: shutting down test
[2024-08-03T17:38:54.590Z] 
[2024-08-03T17:38:54.590Z] 
[2024-08-03T17:38:54.590Z] TEST RESULT: Failed. Execution failed: `main' threw exception: java.lang.UnsatisfiedLinkError: Native Library /home/jenkins/workspace/Test_openjdk21_j9_extended.openjdk_s390x_linux_testList_1/jdkbinary/openjdk-test-image/jdk/jtreg/native/libCreationTimeHelper.so already loaded in another classloader
[2024-08-03T17:38:54.590Z] --------------------------------------------------
[2024-08-03T17:48:19.943Z] Test results: passed: 408; failed: 1
[2024-08-03T17:48:57.295Z] Report written to /home/jenkins/workspace/Test_openjdk21_j9_extended.openjdk_s390x_linux_testList_1/aqa-tests/TKG/output_17227044527420/jdk_nio_0/report/html/report.html
[2024-08-03T17:48:57.295Z] Results written to /home/jenkins/workspace/Test_openjdk21_j9_extended.openjdk_s390x_linux_testList_1/aqa-tests/TKG/output_17227044527420/jdk_nio_0/work
[2024-08-03T17:48:57.295Z] Error: Some tests failed or other problems occurred.
[2024-08-03T17:48:57.295Z] -----------------------------------
[2024-08-03T17:48:57.295Z] jdk_nio_0_FAILED

50x internal grinder - 25/50 failed

Also seen at JDK21 x86-64_linux
JDK17 ppc64le_linux

@gacholio
Copy link
Contributor

gacholio commented Aug 9, 2024

This kind of failure usually means that the test expected the class loader to be unloaded so that the subsequent loader could load the library. Class loader unloading is non-deterministic, so if this is the case, the test is simply invalid.

@JasonFengJ9
Copy link
Member Author

This seems a new test behaviour introduced via ibmruntimes/openj9-openjdk-jdk21@2d5b7d5
Tried an earlier openj9 build which failed as well.

18:54:04  java version "21.0.4-beta" 2024-07-16
18:54:04  IBM Semeru Runtime Certified Edition 21.0.4+7-202407240348 (build 21.0.4-beta+7-202407240348)
18:54:04  Eclipse OpenJ9 VM 21.0.4+7-202407240348 (build master-9d60105111, JRE 21 Linux s390x-64-Bit Compressed References 20240724_236 (JIT enabled, AOT enabled)
18:54:04  OpenJ9   - 9d60105111
18:54:04  OMR      - 56cb81f5e
18:54:04  JCL      - b473f9fdf based on jdk-21.0.4+7)

RI passed however RI might have different class loader unloading implementations.

Removing this from 0.48 milestone plan.

@gacholio
Copy link
Contributor

gacholio commented Aug 9, 2024

I thought maybe we had implemented a workaround for this (GC if we fail to load a library for this reason), but maybe not. It's certainly something we could consider.

@pshipton
Copy link
Member

@tajila fyi a deficiency exposed by a new test.

@JasonFengJ9
Copy link
Member Author

This kind of failure usually means that the test expected the class loader to be unloaded so that the subsequent loader could load the library. Class loader unloading is non-deterministic, so if this is the case, the test is simply invalid.

This test doesn't intend to test System.loadLibrary() behaviour for the same native library. The UnsatisfiedLinkError was because the classloader wasn't unloaded in time before the second System.loadLibrary().

It is not a VM issue.
Do we consider this a GC issue, or a test not applying to OpenJ9?

@pshipton
Copy link
Member

If it can be fixed as suggested in #19978 (comment) then it's VM.

@JasonFengJ9
Copy link
Member Author

Okay, I see what GAC meant.

@JasonFengJ9 JasonFengJ9 self-assigned this Aug 12, 2024
@babsingh
Copy link
Contributor

@JasonFengJ9 For 0.48, this issue will need to be resolved by the end of this week. What's the current state of this issue? Based on this issue's impact, do we need it to be fixed in 0.48 or can it be pushed to 0.49?

@JasonFengJ9
Copy link
Member Author

This is a long-existing issue, it isn't required for 0.48.

Moving to 0.49.

Copy link

github-actions bot commented Oct 3, 2024

Issue Number: 19978
Status: Closed
Actual Components: comp:vm, test failure
Actual Assignees: No one :(
PR Assignees: JasonFengJ9

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