RFR: JDK-8293659: Improve UnsatisfiedLinkError error message to include dlopen error details [v2]
Matthias Baesken
mbaesken at openjdk.org
Tue Sep 20 07:36:18 UTC 2022
On Fri, 16 Sep 2022 07:27:44 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:
>> When trying to load a x64 lib on macOS aarch64 one got previously this detailed message before [JDK-8275703](https://bugs.openjdk.org/browse/JDK-8275703):
>>
>> java.lang.UnsatisfiedLinkError: /testing/jco3/macOsx64/libsapjco3.dylib: dlopen(/testing/jco3/macOsx64/libsapjco3.dylib, 1): no suitable image found. Did find:
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
>
> Adjust throwExceptionIfFail
Hi Thomas, I think previously (before supporting the macOS dl-cache) we did not even attempted to call JVM_LoadLibrary when the file was not present. I asked myself the same think you mentioned , Mandy had this remark on the topic :
"System::loadLibrary attempts to load library found from "java.library.path" (and also from the system library path). For each path given in "java.library.path", it constructs the filepath of the library and checks if that exists. If exists, it loads the library using dlopen. In that case, throw exception by VM makes sense. If the filepath of that library does not exist, it could be in the dynamic cache or it could be just non-existent - at this point, we can't throw exception because we can't tell until all paths in "java.library.path" are searched. "
-------------
PR: https://git.openjdk.org/jdk/pull/10286
More information about the core-libs-dev
mailing list