RFR: 8370198: Test gc/arguments/TestShrinkHeapInSteps.java crashed: assert(left >= right) failed: avoid underflow [v2]

Albert Mingkun Yang ayang at openjdk.org
Thu Dec 4 10:10:44 UTC 2025


> Add an early-return for outside-heap address in `CollectedHeap::is_in` API.
> 
> While investigating this failure (JDK-8370198), I realized that some java-threads (compiler-threads) in `native` state can invoke `CollectedHeap` APIs. Since heap-resizing occurs inside safepoint but java-threads in `native` state just ignore safepoint, I have added some assert to catch such dangerous uses, where the return value might not be stable.
> 
> Test: tie1-5; can't reproduce the JDK-8370198 with or without this patch for >8000 runs.

Albert Mingkun Yang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:

 - review
 - Merge branch 'master' into sgc-is-in-early-return
 - sgc-is-in-early-return

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/28393/files
  - new: https://git.openjdk.org/jdk/pull/28393/files/6f435555..515c739e

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28393&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28393&range=00-01

  Stats: 71805 lines in 1278 files changed: 47297 ins; 17182 del; 7326 mod
  Patch: https://git.openjdk.org/jdk/pull/28393.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28393/head:pull/28393

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


More information about the hotspot-dev mailing list