RFR: 8325372: C2 compilation event causes SIGSEV crash (unnecessary_acquire(Node const*)) in JDK 17.0.x
Aleksey Shipilev
shade at openjdk.org
Tue Feb 20 11:58:54 UTC 2024
On Tue, 20 Feb 2024 09:46:31 GMT, Roland Westrelin <roland at openjdk.org> wrote:
> After shenandoah barrier expansion, a shenandoah specific pass looks
> for heap stable checks that are back to back:
>
>
> if (heap_stable) {
> // fast path 1
> } else {
> // slow path 1
> }
> if (heap_stable) {
> // fast path 2
> } else {
> // slow path 2
> }
>
>
> and fuse them:
>
>
> if (heap_stable) {
> // fast path 1
> // fast path 2
> } else {
> // slow path 1
> // slow path 2
> }
>
>
> In the case of the failure, a `GetAndSetP` (or `GetAndSetN`) node is
> between the 2 heap_stable checks. The fusion of the 2 tests is
> implemented by taking advantage of the split if c2 optimization. But
> split if doesn't support having a `GetAndSet` node at the region where
> split if happens (that can only happen with shenandoah late barrier
> expansion). That causes the `GetAndSet` node to lose its `SCMemProj`
> which can then result in the `GetAndSet` being entirely removed.
>
> The fix I propose is to not perform the heap_stable fusion in this
> particular case.
I suggest we rename the bug to:
`8325372: Shenandoah: SIGSEGV crash in unnecessary_acquire due to LoadStore split through phi`
src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp line 1737:
> 1735: }
> 1736:
> 1737: bool ShenandoahBarrierC2Support::merge_point_safe(Node* region) {
This should probably be `is_merge_point_safe`, since it answers `bool`?
test/hotspot/jtreg/gc/shenandoah/compiler/TestUnsafeLoadStoreMergedHeapStableTests.java line 33:
> 31: * @run main/othervm -XX:+UseShenandoahGC -XX:-BackgroundCompilation TestUnsafeLoadStoreMergedHeapStableTests
> 32: *
> 33: *
Superfluous:
Suggestion:
-------------
PR Review: https://git.openjdk.org/jdk/pull/17926#pullrequestreview-1890229258
PR Review Comment: https://git.openjdk.org/jdk/pull/17926#discussion_r1495688710
PR Review Comment: https://git.openjdk.org/jdk/pull/17926#discussion_r1495690169
More information about the shenandoah-dev
mailing list