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

JNI DestroyJavaVM can start shutdown when one non-daemon thread remains

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 20
    • 8, 11, 17, 20
    • hotspot
    • b11

      DestroyJavaVM is supposed to wait until all non-daemon threads have exited before starting the shutdown sequence. The logic in Threads::destroy_vm seems to assume that the caller is a non-daemon thread. If the caller is a daemon thread, shutdown will start when one non-daemon thread is still running. See reproducer in attached Main.java and start.c files.

        1. Main.java
          0.7 kB
        2. start.c
          1 kB

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

              Created:
              Updated:
              Resolved: