[jdk17] RFR: 8271160: runtime/jni/checked/TestCheckedJniExceptionCheck.java doesn't set -Djava.library.path
David Holmes
dholmes at openjdk.java.net
Thu Jul 22 21:49:14 UTC 2021
On Thu, 22 Jul 2021 20:07:09 GMT, Igor Ignatyev <iignatyev at openjdk.org> wrote:
> Hi all,
>
> could you please review this small patch that sets `-Djava.library.path` to ` test.nativepath` for `TestCheckedJniExceptionCheck`'s child JVM so it will be able to locate the library?
>
> from JBS:
>> TestCheckedJniExceptionCheck spawns a child JVM that uses a test native library, TestCheckedJniExceptionCheck, but it doesn't add/set test.nativepath value to -Djava.library.path, so the child JVM can't find the library and fails.
>>
>> this issue hasn't been noticed early b/c TestCheckedJniExceptionCheck doesn't check the exit code of the child JVM.
>
> Thanks,
> -- Igor
I don't have any issues with the change, but I will point out that this is another case of being bitten by jtreg's differing behaviour in agent mode and non-agent mode. Default execution locally works perfectly fine because the default mode will also set LD_LIBRARY_PATH in the environment and so the child VM works correctly. Whereas the jtreg mode used in our CI testing doesn't.
I also don't think the lack of checking for a zero exit code would cause this to spuriously pass either as there is expected output that would not be found if the test failed with UnsatisfiedLinkException due to the native library.
Thanks,
David
-------------
Marked as reviewed by dholmes (Reviewer).
PR: https://git.openjdk.java.net/jdk17/pull/273
More information about the hotspot-runtime-dev
mailing list