[jdk17] RFR: 8268591: a few runtime/jni tests don't need `/othervm`

Igor Ignatyev iignatyev at openjdk.java.net
Fri Jun 11 12:49:51 UTC 2021


On Fri, 11 Jun 2021 12:10:38 GMT, David Holmes <dholmes at openjdk.org> wrote:

> The test classes, run by jtreg, load native libraries (though they could possibly be refactored so that is not necessary) so I would expect we would want othervm here because we do not want to load multiple unrelated libraries in the shared VM implied by "main".

`jtreg` uses a separate classloader for each test, and native libraries are to be unloaded when CL is GC'ed, so there should be no unrelated libraries in shared VMs.

> I also don't understand why you now need to set java.library.path explicitly in some of the tests ??

frankly, I don't fully understand why it's needed, but these tests started to fail w/ `UnsatisfiedLinkError` when I removed `/othervm` and setting `java.library.path` fixed the problem. I assumed it's because we don't set/propagate `LD_LIBRARY_PATH` (or its equivalent), yet all my attempts to reproduce this behavior and the problem w/ a small test case failed, I'll dig deeper next week.

Thanks,
-- Igor

-------------

PR: https://git.openjdk.java.net/jdk17/pull/18


More information about the hotspot-runtime-dev mailing list