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

Howl Full CardSet container iteration marks too many cards

XMLWordPrintable

    • gc
    • b23
    • Verified

      When iterating over a Howl "Full" card set to mark these cards, the current code iterates over too many cards, the number of cards in a (card) region, not the number of cards the bucket of the Howl card set the partition actually covers.

      I.e.

          case G1CardSet::CardSetHowl: { // actually FullCardSet
            if (found.start_iterate(G1GCPhaseTimes::MergeRSHowlFull)) {
              assert(card_set == G1CardSet::FullCardSet, "Must be");
              uint offset = index << config->log2_num_cards_in_howl_bitmap();
              for (uint i = 0; i < config->max_cards_in_region(); i++) {
                found((offset | (uint)i));
              }
            }
            return;
          }


      The config->max_cards_in_region() should be config->num_cards_in_howl_bitmap(). Also we should probably call the found() method with the range parameters.

      This problem can cause crashes/memory overwrites.

            tschatzl Thomas Schatzl
            tschatzl Thomas Schatzl
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: