-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
24, 25
During the test of https://bugs.openjdk.org/browse/JDK-8338737, crashes cause by remembered set violation happens very often in stress test:
```
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (/codebuild/output/src48/src/s3/00/src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp:1270), pid=1578, tid=1595
# Error: Remembered set violation at init-update-references; clean card should be dirty
Referenced from:
interior location: 0x00000007f8000008
inside Java heap
not in collection set
region: | 2528|R |O|BTE 7f8000000, 7f8400000, 7f8400000|TAMS 7f8400000|UWM 7f8400000|U 4096K|T 0B|G 4096K|P 0B|S 0B|L 672B|CP 0
Object:
0x00000007f5dc8b58 - klass 0x0000078000249400 java.lang.invoke.MethodType
not allocated after mark start
not after update watermark
marked strong
not marked weak
not in collection set
age: 8
mark: mark(is_unlocked no_hash age=8)
region: | 2519|R |Y|BTE 7f5c00000, 7f6000000, 7f6000000|TAMS 7f6000000|UWM 7f6000000|U 4096K|T 0B|G 4096K|P 0B|S 0B|L 4091K|CP 0
```
After digging into the issue, we found that if we don't do bitmap reset after cycle for old GC bootstrapping or concurrent old mark is in progress, the crash disappears.
Assuming bitmap of young regions is already stale after cycle and won't be used at all, it should be safe to reset bitmap after young cycle even it is bootstrap cycle, but looks like it is not true, it seems to be a bug in remembered set scan, resetting young region bitmaps somehow tickles the bug.
```
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (/codebuild/output/src48/src/s3/00/src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp:1270), pid=1578, tid=1595
# Error: Remembered set violation at init-update-references; clean card should be dirty
Referenced from:
interior location: 0x00000007f8000008
inside Java heap
not in collection set
region: | 2528|R |O|BTE 7f8000000, 7f8400000, 7f8400000|TAMS 7f8400000|UWM 7f8400000|U 4096K|T 0B|G 4096K|P 0B|S 0B|L 672B|CP 0
Object:
0x00000007f5dc8b58 - klass 0x0000078000249400 java.lang.invoke.MethodType
not allocated after mark start
not after update watermark
marked strong
not marked weak
not in collection set
age: 8
mark: mark(is_unlocked no_hash age=8)
region: | 2519|R |Y|BTE 7f5c00000, 7f6000000, 7f6000000|TAMS 7f6000000|UWM 7f6000000|U 4096K|T 0B|G 4096K|P 0B|S 0B|L 4091K|CP 0
```
After digging into the issue, we found that if we don't do bitmap reset after cycle for old GC bootstrapping or concurrent old mark is in progress, the crash disappears.
Assuming bitmap of young regions is already stale after cycle and won't be used at all, it should be safe to reset bitmap after young cycle even it is bootstrap cycle, but looks like it is not true, it seems to be a bug in remembered set scan, resetting young region bitmaps somehow tickles the bug.