Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8194653

Deadlock involving FileSystems.getDefault and System.loadLibrary call

    XMLWordPrintable

Details

    • b01

    Backports

      Description

        See http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-January/050819.html

        Thread A has called FileSystems.getDefault() which is doing <clinit> of DefaultFileSystemHolder, which in turn leads to Runtime.loadLibrary0 which needs to lock the Runtime instance.

        Thread B is already doing a loadLibrary and holds the Runtime lock, the loadLibrary code then needs to do FileSystems.getDefault() which has to load and initialize DefaultFileSystemHolder, but that initialization is already in progress so internally the thread does a wait().

        So Thread B is waiting for Thread A to finish initialization, but holds the monitor lock that Thread A needs to finish the initialization. Deadlock.

        Attachments

          Issue Links

            Activity

              People

                robm Robert Mckenna
                mchung Mandy Chung
                Votes:
                2 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: