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

destroy_vm and java_suspend race hangs VM

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 1.4.1
    • Fix Version/s: 1.4.0_01
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      01
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        VM hangs in shutdown under this scenario (thread 1 is main thread, thread 2
        could be any daemon thread but in this test it is the JVMPI sampler thread):

        1. Thread 2 tries to suspend thread 1, it marks _external_suspend for thread 1
           and queues up a VM_ThreadSuspend operation.
        2. At the same time, thread 1 is in destroy_vm. It calls thread->exit().
        3. VM_ThreadSuspend and then java_resume() are executed on thread 1. But they
           have no effect since thread 1 is "terminated".
        4. Thread 1 continues to execute in VMThread::execute(VM_SuspendDaemons). It
           needs to lock VMOperationRequest_lock. Because thread 1 is Java thread,
           this will eventually call Mutex::wait_for_lock_blocking_implementation.
        5. _external_suspend remains true, so thread 1 will loop forever in
           wait_for_lock_blocking_implementation (java_suspend_self does nothing
           because thread 1 is "terminated").

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                hhuangsunw Hui Huang (Inactive)
                Reporter:
                hhuangsunw Hui Huang (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: