RFR: 8325372: C2 compilation event causes SIGSEV crash (unnecessary_acquire(Node const*)) in JDK 17.0.x

Roland Westrelin roland at openjdk.org
Tue Feb 20 09:58:03 UTC 2024


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.

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

Commit messages:
 - test clean up
 - fix
 - test

Changes: https://git.openjdk.org/jdk/pull/17926/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17926&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8325372
  Stats: 102 lines in 4 files changed: 101 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/17926.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/17926/head:pull/17926

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


More information about the shenandoah-dev mailing list