Skip to content

Commit 991f7c1

Browse files
committedFeb 23, 2021
8210373: Deadlock in libj2gss.so when loading "j2gss" and "net" libraries in parallel.
Reviewed-by: xuelei
1 parent 0217d69 commit 991f7c1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎src/java.security.jgss/share/classes/sun/security/jgss/wrapper/SunNativeProvider.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -71,8 +71,12 @@ public HashMap<String, String> run() {
7171
DEBUG = Boolean.parseBoolean(
7272
System.getProperty("sun.security.nativegss.debug"));
7373
try {
74+
// Ensure the InetAddress class is loaded before
75+
// loading j2gss. The library will access this class
76+
// and a deadlock might happen. See JDK-8210373.
77+
Class.forName("java.net.InetAddress");
7478
System.loadLibrary("j2gss");
75-
} catch (Error err) {
79+
} catch (ClassNotFoundException | Error err) {
7680
debug("No j2gss library found!");
7781
if (DEBUG) err.printStackTrace();
7882
return null;

0 commit comments

Comments
 (0)
Please sign in to comment.