`InetAddress` is loading native library `net` and at the same time `SunNativeProvider` is loading `j2gss`, and in the `OnLoad` function inside `j2gss` it is calling `FindClass(env, "java/net/InetAddress")` and thus a deadlock.
We can access `InetAddress` in `SunNativeProvider.<clinit>` before loading the jgss library. i.e. use `Class.forName` to ensure `InetAddress` is initialized. Thanks to @dholmes-ora for providing this workaround. No new regression test, hard to reproduce. ------------- Commit messages: - 8210373: Deadlock in libj2gss.so when loading "j2gss" and "net" libraries in parallel. Changes: https://git.openjdk.java.net/jdk/pull/2655/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2655&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8210373 Stats: 3 lines in 1 file changed: 1 ins; 0 del; 2 mod Patch: https://git.openjdk.java.net/jdk/pull/2655.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/2655/head:pull/2655 PR: https://git.openjdk.java.net/jdk/pull/2655