-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
P4
-
Affects Version/s: 20
-
Component/s: hotspot
As the summary mentions, Concurrent Undo does not set G1CollectorState::clear_bitmap_in_progress(), which means that old gen region's mark bitmap may not be properly cleared before doing GC.
(G1PrepareRegionsForEvacFailClosure::should_clear() always evaluates to false, which means that the bitmap is not cleared during the concurrent clear bitmap phase. Note that actually there is an assert that in that case checks that the bitmap is empty, which never occurred so far)
I *think* these extra marks are benign (in product builds):
- in case this is a mark to an object that has actually experienced an evacuation failure, g1 will handle it correctly (although there is an assert that will fail in debug mode)
- in case this is not an object that actually experienced an evacuation failure, references to it will be forwarded. G1 will just count it as live during statistics (and I think its forwarding pointer is not cleared correctly, but since there should be no more reference to it, it should be fine; note that the phase to remove self-forwards would fire another assert)
In debug mode there should be at least one other assert that checks whether the mark bitmap is empty before passing this bitmap clearing in G1PrepareRegionsForEvacFailClosure::do_heap_region()
- the marks will be cleared anyway concurrently later
Found by code inspection during changes for JDK-8371720.
Given that there are multiple asserts that should fire, but did not, I might overlook something in my evaluation.
(G1PrepareRegionsForEvacFailClosure::should_clear() always evaluates to false, which means that the bitmap is not cleared during the concurrent clear bitmap phase. Note that actually there is an assert that in that case checks that the bitmap is empty, which never occurred so far)
I *think* these extra marks are benign (in product builds):
- in case this is a mark to an object that has actually experienced an evacuation failure, g1 will handle it correctly (although there is an assert that will fail in debug mode)
- in case this is not an object that actually experienced an evacuation failure, references to it will be forwarded. G1 will just count it as live during statistics (and I think its forwarding pointer is not cleared correctly, but since there should be no more reference to it, it should be fine; note that the phase to remove self-forwards would fire another assert)
In debug mode there should be at least one other assert that checks whether the mark bitmap is empty before passing this bitmap clearing in G1PrepareRegionsForEvacFailClosure::do_heap_region()
- the marks will be cleared anyway concurrently later
Found by code inspection during changes for JDK-8371720.
Given that there are multiple asserts that should fire, but did not, I might overlook something in my evaluation.
- relates to
-
JDK-8210708 Use single mark bitmap in G1
-
- Resolved
-
- links to
-
Review(master)
openjdk/jdk/30031