Skip to content

Commit

Permalink
8210373: Deadlock in libj2gss.so when loading "j2gss" and "net" libra…
Browse files Browse the repository at this point in the history
…ries in parallel.

Backport-of: 991f7c1
  • Loading branch information
GoeLin committed Jan 4, 2023
1 parent 62191cd commit d2c8326
Showing 1 changed file with 6 additions and 2 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -73,8 +73,12 @@ public HashMap<String, String> run() {
DEBUG = Boolean.parseBoolean
(System.getProperty(DEBUG_PROP));
try {
// Ensure the InetAddress class is loaded before
// loading j2gss. The library will access this class
// and a deadlock might happen. See JDK-8210373.
Class.forName("java.net.InetAddress");
System.loadLibrary("j2gss");
} catch (Error err) {
} catch (ClassNotFoundException | Error err) {
debug("No j2gss library found!");
if (DEBUG) err.printStackTrace();
return null;
Expand Down

1 comment on commit d2c8326

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.