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

Add missing check in VTMS_transition_disable_for_all() for suspend mode

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 21
    • 21
    • hotspot
    • b14

      A suspender is a JvmtiVTMSTransitionDisabler monopolist, meaning VTMS_transition_disable_for_all() should not return while there is any active jvmtiVTMSTransitionDisabler. The code though is checking for active "all-disablers" but it's missing the check for active "single disablers":

      if (_is_SR) {
            _SR_mode = true;
            while (_VTMS_transition_disable_for_all_count > 0) {
              ml.wait(10); // Wait while there is any active jvmtiVTMSTransitionDisabler.
            }
      }

      Before 8298853, since there was only one counter we were doing the correct thing:

      if (_is_SR) {
            _SR_mode = true;
            while (_VTMS_transition_disable_count > 0) {
             ml.wait(10); // Wait while there is any active jvmtiVTMSTransitionDisabler.
            }
      }

      I attached a simple reproducer that crashes because of this.

            pchilanomate Patricio Chilano Mateo
            pchilanomate Patricio Chilano Mateo
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: