Repository navigation
JDK17+ : Try BootLoader if bootstrapClassLoader didn't find the native - #12981
Conversation
This is because the loading of Lines 3677 to 3690 in 4462d50 |
|
This seems like a hack, not a proper fix. The JCL code requests the BootLoader to load the library. |
|
The native library loading approach has been changed for Lines 3633 to 3653 in 620b0ca |
|
How does it work on Hotspot? Maybe the JCL causes/forces a load of KeyChainStore earlier? Pls check -verbose output. |
Attached from a standalone testcase run. |
This class is not required by most tests (that's why it only shows up in a specific internal test). So I think it shouldn't tax each JVM for the cost of loading this class and its associates (yeah, this PR always loads the native library in question which is a minimum cost). |
|
I think JVM_LoadLibrary() should check the calling ClassLoader rather than having to preload libraries. |
|
Even if JVM_LoadLibrary() is only called from BootLoader.loadLibrary(), we can check the caller of BootLoader.loadLibrary(). |
Assuming here check if the caller classloader is |
|
@pshipton Have your concerns been addressed? |
No. This change is a hack, preloading libosxsecurity.dylib when this should not be necessary. I expect the OpenJ9 implementation for loading libraries in jdk16+ is wrong somehow. I believe Jason is investigating. I'll set this as draft for now. |
This is correct that I requested permission to investigate
Alternatively I think this PR can serve as an intermediate fix for the internal test failure which technically is required for |
|
I don't see a reason we need to fix the internal test immediately, I'd prefer to wait for the proper fix. |
|
Update: |
de99cd4 to
a711b96
Compare
|
Updated the PR to try There are two potential future improvements (more investigation still required):
Edit: This will be backport to |
|
@pshipton ping |
a711b96 to
1c4bc39
Compare
|
jenkins test sanity osx,win,zlinux jdk17 |
1c4bc39 to
7378d0b
Compare
Try BootLoader.getNativeLibraries().find(entryName) if bootstrapClassLoader.nativelibs.find(entryName) didn't succeed; Add trace points; Refactoring methods affected. Signed-off-by: Jason Feng <fengj@ca.ibm.com>
7378d0b to
42d763c
Compare
|
jenkins compile win jdk17 |
Try
BootLoader.getNativeLibraries().find(entryName)ifbootstrapClassLoader.nativelibs.find(entryName)didn't succeed;Add trace points;
Refactoring methods affected.
This fixes an internal test failure with following stack trace
Signed-off-by: Jason Feng fengj@ca.ibm.com