RFR: 8283555: G1: Concurrent mark accesses uninitialized BOT of closed archive regions

Albert Mingkun Yang ayang at openjdk.java.net
Wed Mar 23 16:12:26 UTC 2022


On Wed, 23 Mar 2022 15:29:39 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

> Hi all,
> 
>   please review this change that fixes crashes occurring in the Loom repo because of missing initialization in the BOT of closed archive regions. This is a bug here too, just typically not occurring.
> 
> So during marking through the closed archive regions (for statistics mainly) it can happen that there are objects in these closed archive regions that are split into chunks. To get the start of the object that contains this chunk, we use the BOT.
> 
> Since it is not initialized for the closed archive regions G1 crashes as that call returns garbage.
> 
> The fix is to not only initialize open archive regions, but also closed archive regions.
> 
> The problem started with [JDK-8264908](https://bugs.openjdk.java.net/browse/JDK-8264908) which means that there will be a JDK 18 backport.
> 
> Testing: failing test with Loom, GHA
> 
> Thanks,
>   Thomas

Marked as reviewed by ayang (Reviewer).

src/hotspot/share/cds/filemap.cpp line 2333:

> 2331:     G1CollectedHeap::heap()->fill_archive_regions(closed_heap_regions,
> 2332:                                                   num_closed_heap_regions);
> 2333:     // G1 marking uses the BOT for object chunking; for this reason we need to

It would be good to have a reference to the actual method/class name performing "object chunking" in the comment.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7923



More information about the hotspot-gc-dev mailing list