JDK-8276540 : Howl Full CardSet container iteration marks too many cards
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 18
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2021-11-03
  • Updated: 2022-02-10
  • Resolved: 2021-11-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 18
18 b23Fixed
Related Reports
Blocks :  
Relates :  
Description
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.
Comments
Changeset: ff6863c9 Author: Thomas Schatzl <tschatzl@openjdk.org> Date: 2021-11-08 12:59:00 +0000 URL: https://git.openjdk.java.net/jdk/commit/ff6863c98dbd15c4f3920402eb0991727d1a380c
08-11-2021