-
Notifications
You must be signed in to change notification settings - Fork 729
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
Attempt to reload the library in case of UnsatisfiedLinkError #20265
Conversation
19ff2a3
to
5d5b4d9
Compare
jenkins test sanity amac jdk11,jdk17 |
java/lang/Runtime/loadLibrary/LoadLibraryTest.java
|
Looking into it. |
J9vmTest
|
jdk17 java/lang/ClassLoader/nativeLibrary/NativeLibraryTest.java
|
Ah, if there is an UnsatisfiedLinkError, and it doesn't match the condition, the original UnsatisfiedLinkError needs to be re-thrown. |
When an UnsatisfiedLinkError is thrown because the library was already loaded in another classloader, run gc() to unload the unreachable classloaders, and reload the library again. Signed-off-by: Jason Feng <[email protected]>
Re-throwing the
The test depends on GC behaviour.
The test need to be modified or excluded after this PR. |
Opened an extension PR to modify the test |
jenkins compile amac jdknext |
The test changes have been merged in extension repos. |
jenkins test sanity amac jdk11,jdk17 |
Attempt to reload the library in case of
UnsatisfiedLinkError
When an
UnsatisfiedLinkError
is thrown because the library was already loaded in another classloader, rungc()
to unload the unreachable classloaders, and reload the library again.Java 8/11
UnsatisfiedLinkError
messagealready loaded in another classloader
is fromopenj9/runtime/vm/vmbootlib.c
Lines 518 to 519 in 0027b81
Java 17+ is from https://github.com/ibmruntimes/openj9-openjdk-jdk17/blob/4a311794a42998359c859814c645398be928e19a/src/java.base/share/classes/jdk/internal/loader/NativeLibraries.java#L206-L209
closes #19978
Signed-off-by: Jason Feng [email protected]