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

thread resume logic doesn't expect external and internal suspend at the same tim

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.4.0
    • vm-legacy
    • None
    • rc1
    • generic
    • generic
    • Verified



        Name: dd4877 Date: 10/12/2001


        daniel.daugherty@Sun 2001-10-12

        While working on the following bug:

        4510838 3/2 self-suspend race with GetCallTrace

        I ran into a case where both the _external_suspend and _internal_suspend
        fields were set but no internal suspension was taking place. The VMThread
        was not doing a safepoint, we were not shutting down the VM, and the flat
        profiler was not running.

        There is a problem with the flag resetting logic during a resume:

                if (java_thread->is_external_suspend()) {
                  // external request can only clear pending external suspend
                  if (ext_req) {
                    java_thread->clear_external_suspend();
                    return 0;
                  }
                } else if (java_thread->is_internal_suspend()) {
                  // internal request can only clear pending internal suspend
                  if (!ext_req) {
                    java_thread->clear_internal_suspend();
                    return 0;
                  }
                }

        when both _external_suspend and _internal_suspend are true, the
        _internal_suspend flag will never get cleared by this logic.

        I believe this logic problem appears in two places in thread.cpp.

        ======================================================================

              dcubed Daniel Daugherty
              dcubed Daniel Daugherty
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: