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

Assess and remedy any unsafe usage of the Semaphore used by the ZipLibraryLoaderLock

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 22
    • hotspot
    • 22

      As discussed in JDK-8361462, static Semaphores are potentially unsafe if accessed during VM termination. The ZipLibrary code has a static semaphore for the ZipLibraryLoaderLock. This lock guards the initialization of the platform zip library which is done lazily when a classloader needs to open a zipped enity. The ZipLibraryLoaderLock code explicitly transitions the current JavaThread to be _thread_in_native and so it appears safepoint-safe. Consequently if a (daemon) thread happened to initiate such loading whilst termination was in process, it could access the Semaphore after it has been destroyed.

      Unfortunately due to the lazy initialization, placement of the `init` call for a `DeferredStatic` is problematic.

            Unassigned Unassigned
            dholmes David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: