RFR: 8375046: C2: Assertion failed in GrowableArray::remove_till(0) [v3]
Aleksey Shipilev
shade at openjdk.org
Mon Jan 12 15:55:47 UTC 2026
> Seen this assert in stress CTW runs:
>
>
> # Internal Error (/home/shade/trunks/jdk/src/hotspot/share/utilities/growableArray.hpp:498), pid=2972347, tid=2973775
> # assert(start < end && end <= this->_len) failed: erase called with invalid range (0, 0) for length 0
>
> Stack: [0x00007fd660bea000,0x00007fd660cea000], sp=0x00007fd660ce4fc0, free space=1003k
> Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
> V [libjvm.so+0xc00a41] Compile::inline_incrementally_one()+0x801 (growableArray.hpp:498)
> V [libjvm.so+0xc01650] Compile::inline_incrementally(PhaseIterGVN&)+0x2f0 (compile.cpp:2212)
> V [libjvm.so+0xc04581] Compile::Optimize()+0x7d1 (compile.cpp:2357)
>
>
> It looks innocuous, as `GrowableArray::remove_range` does nothing real on `[0, 0)`. It is still IMO a bug to call it with `[0, 0)`, as it is not clear whether to trust inclusive or exclusive boundary. But for `remove_till`, it looks plausible that `remove_till(0)` should work and be a no-op. Looks like it readily happens in C2 CTW when `_late_inlines` is empty.
>
> Additional testing:
> - [x] Linux x86_64 server fastdebug, additional new gtest to verify `remove_range` works
> - [ ] Linux x86_64 server fastdebug, `all`
Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
Only clear pos when needed
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/29171/files
- new: https://git.openjdk.org/jdk/pull/29171/files/b32262de..3f687702
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=29171&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=29171&range=01-02
Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/29171.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/29171/head:pull/29171
PR: https://git.openjdk.org/jdk/pull/29171
More information about the hotspot-dev
mailing list