RFR: 8325372: Shenandoah: SIGSEGV crash in unnecessary_acquire due to LoadStore split through phi [v2]
Roland Westrelin
roland at openjdk.org
Tue Feb 20 15:17:10 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.
Roland Westrelin has updated the pull request incrementally with one additional commit since the last revision:
Update test/hotspot/jtreg/gc/shenandoah/compiler/TestUnsafeLoadStoreMergedHeapStableTests.java
Co-authored-by: Aleksey Shipilëv <shipilev at amazon.de>
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/17926/files
- new: https://git.openjdk.org/jdk/pull/17926/files/6866a5ee..cb1ace1b
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=17926&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=17926&range=00-01
Stats: 2 lines in 1 file changed: 0 ins; 2 del; 0 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