Hi,

Matthias Klose a écrit le 20/04/2020 à 12:49 :
> On 4/20/20 11:52 AM, Gilles Filippini wrote:
>> I'd like to do a bisect between openjdk-11 11.0.6+10-2 and 11.0.7+9-1 to
>> better understand the problem but I can't find the corresponding branch
>> on the openjdk Mercurial repo.
> 
> http://hg.openjdk.java.net/jdk-updates/jdk11u/
> 

This commit is the culprit:
http://hg.openjdk.java.net/jdk-updates/jdk11u/rev/21710e014d7f

It makes sense since it is related to System.loadLibrary().

Because Scilab loads Java from C++ code I guess moving usr_paths ans
sys_paths initialization out of System.loadLibrary might have some
consequences.

Applying the attached patch to openjdk-11 solves the problem. Not sure
this is the right thing to do, but it keeps the deadlock fix brought by
the jdk changeset and allows for sys_paths and usr_paths initialization
in System.loadLibrary() when needed.

@doko, please consider adding this patch to the openjdk-11 source
package until a proper fix is found for Scilab.

Thanks,

_g.
Index: openjdk-11-11.0.7+10/src/java.base/share/classes/java/lang/ClassLoader.java
===================================================================
--- openjdk-11-11.0.7+10.orig/src/java.base/share/classes/java/lang/ClassLoader.java
+++ openjdk-11-11.0.7+10/src/java.base/share/classes/java/lang/ClassLoader.java
@@ -2620,9 +2620,10 @@ public abstract class ClassLoader {
                             boolean isAbsolute) {
         ClassLoader loader =
             (fromClass == null) ? null : fromClass.getClassLoader();
-        assert sys_paths != null : "should be initialized at this point";
-        assert usr_paths != null : "should be initialized at this point";
-
+        if (sys_paths == null) {
+            usr_paths = initializePath("java.library.path");
+            sys_paths = initializePath("sun.boot.library.path");
+        }
         if (isAbsolute) {
             if (loadLibrary0(fromClass, new File(name))) {
                 return;

Reply via email to