Integrated: 8357550: GenShen crashes during freeze: assert(!chunk->requires_barriers()) failed

William Kemper wkemper at openjdk.org
Fri Jun 20 17:10:34 UTC 2025


On Thu, 19 Jun 2025 20:21:35 GMT, William Kemper <wkemper at openjdk.org> wrote:

> Shenandoah captures a preliminary top-at-mark-start (TAMS) concurrently. Once concurrent marking has begun, any object beneath TAMS requires a barrier when accessed. The implementation of `ShenandoahHeap::requires_barrier` does not distinguish between _old_ and _young_ marking. This could lead to a race between freezing the stack and capturing TAMS:
> 
> 1. Collector is marking old
> 2. Allocate stack chunk in young
> 3. Barrier is not needed, begin fast freeze path
> 4. Collector concurrently updates TAMS (young marking will start once init-mark safepoint is reached)
> 5. ShenandoahHeap now thinks the barrier is needed (because TAMS changed, and we are marking old)
> 6. Fast freeze asserts out
> 
> This fix has the generational mode check the appropriate generation and its marking state. It also enforces barriers for stackChunks in the old generation (for card marking).

This pull request has now been integrated.

Changeset: 17cf4974
Author:    William Kemper <wkemper at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/17cf49746d0c289bdf779c974cdc84a3ab32ab4b
Stats:     25 lines in 2 files changed: 25 ins; 0 del; 0 mod

8357550: GenShen crashes during freeze: assert(!chunk->requires_barriers()) failed

Reviewed-by: kdnilsen, shade

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

PR: https://git.openjdk.org/jdk/pull/25905


More information about the shenandoah-dev mailing list