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

Unattached thread can cause crash during VM exit if it calls wait_if_vm_exited

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • 25
    • hotspot
    • b03

      This was discovered in a round-about way with AWT shutdown code that uses JVM RawMonitors. The RawMonitor code checks for VM exit and calls VM_Exit::wait_if_vm_exited, which checks if the current thread is the shutdown-thread else it blocks it by locking the Threads_lock. However, if the current thread is not attached (which RawMonitors allow) then we can't use the Threads_lock (current thread is null). In such a situation we should not attempt to block the unattached thread.

      Credit to [~ihse] for identifying the problem.

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

              Created:
              Updated:
              Resolved: