G1: Race in G1BarrierSet::write_ref_field_post()

XMLWordPrintable

    • gc
    • b07

        Current code in G1BarrierSet::write_ref_field_post() seems racy:

        inline void G1BarrierSet::write_ref_field_post(T* field) {
          volatile CardValue* byte = _card_table->byte_for(field);
          if (*byte == G1CardTable::clean_card_val()) {
            *byte = G1CardTable::dirty_card_val();
          }
        }

        That attempts to make sure that _card_table is not potentially read twice, because if it were, we might get a card mark in the wrong card table, potentially causing crashes.

        Could be the cause for JDK-8373944, at least it would show the same symptom.

              Assignee:
              Thomas Schatzl
              Reporter:
              Thomas Schatzl
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: