-
Type:
Bug
-
Resolution: Fixed
-
Priority:
P3
-
Affects Version/s: 26
-
Component/s: hotspot
-
b02
| Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
|---|---|---|---|---|---|---|
| JDK-8373444 | 26 | Xiaolong Peng | P3 | Resolved | Fixed | b28 |
Chasing down the root cause of JDK-8372498, I have narrowed down the root cause to the commit https://github.com/openjdk/jdk/commit/f8cf9ca69cfef286c80559bfe1d147b6303d10d2
It is caused by the behavior change from follow code:
Original:
```
if (ShenandoahSATBBarrier) {
T* array = dst;
HeapWord* array_addr = reinterpret_cast<HeapWord*>(array);
ShenandoahHeapRegion* r = _heap->heap_region_containing(array_addr);
if (is_old_marking) {
// Generational, old marking
assert(_heap->mode()->is_generational(), "Invariant");
if (r->is_old() && (array_addr < _heap->marking_context()->top_at_mark_start(r))) {
arraycopy_work<T, false, false, true>(array, count);
}
} else if (_heap->mode()->is_generational()) {
// Generational, young marking
if (r->is_old() || (array_addr < _heap->marking_context()->top_at_mark_start(r))) {
arraycopy_work<T, false, false, true>(array, count);
}
} else if (array_addr < _heap->marking_context()->top_at_mark_start(r)) {
// Non-generational, marking
arraycopy_work<T, false, false, true>(array, count);
}
}
```
New:
```
if (ShenandoahSATBBarrier) {
if (!_heap->marking_context()->allocated_after_mark_start(reinterpret_cast<HeapWord*>(dst))) {
arraycopy_work<T, false, false, true>(dst, count);
}
}
```
With the new STAB barrier code for arraycopy_marking, if is it young GC and the array is in old region, but array is above TAMS(Old GC may not be started, TAMS of old region is not captured), arraycopy_work won't be applied anymore, so we may have missed some pointers in SATB in such case during concurrent young GC.
It is caused by the behavior change from follow code:
Original:
```
if (ShenandoahSATBBarrier) {
T* array = dst;
HeapWord* array_addr = reinterpret_cast<HeapWord*>(array);
ShenandoahHeapRegion* r = _heap->heap_region_containing(array_addr);
if (is_old_marking) {
// Generational, old marking
assert(_heap->mode()->is_generational(), "Invariant");
if (r->is_old() && (array_addr < _heap->marking_context()->top_at_mark_start(r))) {
arraycopy_work<T, false, false, true>(array, count);
}
} else if (_heap->mode()->is_generational()) {
// Generational, young marking
if (r->is_old() || (array_addr < _heap->marking_context()->top_at_mark_start(r))) {
arraycopy_work<T, false, false, true>(array, count);
}
} else if (array_addr < _heap->marking_context()->top_at_mark_start(r)) {
// Non-generational, marking
arraycopy_work<T, false, false, true>(array, count);
}
}
```
New:
```
if (ShenandoahSATBBarrier) {
if (!_heap->marking_context()->allocated_after_mark_start(reinterpret_cast<HeapWord*>(dst))) {
arraycopy_work<T, false, false, true>(dst, count);
}
}
```
With the new STAB barrier code for arraycopy_marking, if is it young GC and the array is in old region, but array is above TAMS(Old GC may not be started, TAMS of old region is not captured), arraycopy_work won't be applied anymore, so we may have missed some pointers in SATB in such case during concurrent young GC.
- backported by
-
JDK-8373444 Genshen: arraycopy_work should be always done for arrays in old gen during young concurrent marking
-
- Resolved
-
- caused by
-
JDK-8370039 GenShen: array copy SATB barrier improvements
-
- Resolved
-
- relates to
-
JDK-8372498 [genshen] gc/TestAllocHumongousFragment.java#generational causes intermittent SIGSEGV crashes
-
- Resolved
-
- links to
-
Commit(jdk26)
openjdk/jdk/15b5789f
-
Commit(master)
openjdk/jdk/c9ab330b
-
Review(jdk26)
openjdk/jdk/28751
-
Review(master)
openjdk/jdk/28669
(2 links to)