RFR: 8376287: Crash in G1CMTask::start_partial_array_processing(oop) when using invalid value for -XX:ObjArrayMarkingStride

Thomas Schatzl tschatzl at openjdk.org
Thu Jan 29 08:30:42 UTC 2026


On Thu, 29 Jan 2026 03:46:29 GMT, Guanqiang Han <ghan at openjdk.org> wrote:

> Please review this change, it addresses a trivial issue. Thanks!
> 
> **Description:**
> 
> This is a trivial issue caused by the invalid value of -XX:ObjArrayMarkingStride=0, which results in a division by zero in the PartialArrayTaskStepper::start() method.
> https://github.com/openjdk/jdk/blob/2529e2fe8dfe9685033bb0ae558266b8bc3cf95c/src/hotspot/share/gc/shared/partialArrayTaskStepper.inline.hpp#L39-L40
> 
> **Fix:**
> 
> Restrict the ObjArrayMarkingStride to positive values.
> 
> **Test:**
> 
> GHA

Looks good, but the corresponding sanity assert (ObjArrayMarkingStride > 0) could be removed in Shenandoah now.

After some investigation we found that not only G1 is affected, but also Serial and Parallel GC to a varying degree, so the summary of the CR changed.

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

Marked as reviewed by tschatzl (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/29479#pullrequestreview-3721321325


More information about the hotspot-gc-dev mailing list