When a young collection is in the "concurrent mark" phase and is scanning remembered sets (remsets) to find roots into the young gen it "consumes" the remset when it is finished by clearing it (using memset).
At the same time, an old collection might find a completely empty/garbage page that it will insert into the page cache. Before inserting into the page cache, the page's remset is cleared (using memset).
These two operations might interfere, resulting in both threads clearing the memory simultaneously.
This race was found in connection to https://bugs.openjdk.org/browse/JDK-8339161 where I experimented replacing some clears of remsets with free's and got a crash on Windows from memset when operating on free'd memory.
At the same time, an old collection might find a completely empty/garbage page that it will insert into the page cache. Before inserting into the page cache, the page's remset is cleared (using memset).
These two operations might interfere, resulting in both threads clearing the memory simultaneously.
This race was found in connection to https://bugs.openjdk.org/browse/JDK-8339161 where I experimented replacing some clears of remsets with free's and got a crash on Windows from memset when operating on free'd memory.
- relates to
-
JDK-8339579 ZGC: Race results in only one of two remembered sets being cleared
-
- Closed
-
-
JDK-8339161 ZGC: Remove unused remembered sets
-
- Resolved
-
- links to
-
Commit(master) openjdk/jdk/7ad61605
-
Review(master) openjdk/jdk/20821