G1: Race in G1BarrierSet::write_ref_field_post()

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P2
    • 27
    • Affects Version/s: None
    • Component/s: hotspot
    • gc

      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:
            1 Start watching this issue

              Created:
              Updated: