United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6956639 G1: assert(cached_ptr != card_ptr) failed: shouldn't be, concurrentG1Refine.cpp:307
6956639 : G1: assert(cached_ptr != card_ptr) failed: shouldn't be, concurrentG1Refine.cpp:307

Details
Type:
Bug
Submit Date:
2010-05-28
Status:
Resolved
Updated Date:
2010-09-24
Project Name:
JDK
Resolved Date:
2010-08-04
Component:
hotspot
OS:
generic
Sub-Component:
gc
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
hs19

Related Reports
Backport:
Backport:
Backport:
Backport:

Sub Tasks

Description
Igor reported that he was seeing this assertion while testing tiered through JPRT - though this particular assert was seen when running on C1. Here's Igor's email:

This one appeared again in during my testing today:

#  Internal Error (/tmp/jprt/P1/B/150025.iv159533/source/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp:307),
  pid=19418, tid=3031919504
#  assert(cached_ptr != card_ptr) failed: shouldn't be

It's linux x86 c1.
It was preceded by the cleanup.

igor

                                    

Comments
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-rt/hotspot/rev/5cbac8938c4c
                                     
2010-07-25
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot/hotspot/rev/5cbac8938c4c
                                     
2010-07-23
SUGGESTED FIX

During concurrent refinement, defer the filtering of cards in young regions until during the iteration of the oops on the card. In the iteration code there is an intersection call with the MemRegion for the card and the used part of the HeapRegion. If the intersection is non-empty then we iterate over the card.

If this intersection is non-empty then we know that the region has been used to allocate from and so should have it's young type set. (When the region becomes the current allocation region, its young type is set before it is used to satisfy an allocation.)
                                     
2010-07-20
EVALUATION

There are couple reasons why we may see cards in a young region coming out of the card cache. One of this is that the while the card was in the cache, its region was freed during a cleanup pause, and subsequently re-used as the current allocation region.

Adding additional filters for young regions in the concurrent refine code was still problematic as the concurrent thread could see the region's young type change from NonYoung to Young at any time.

The better solution to this is to defer the filtering of cards in young regions until during the iteration of the oops on the card. In the iteration code there is an intersection call with the MemRegion for the card and the used part of the HeapRegion. If the intersection is non-empty then we iterate over the card.

If this intersection is non-empty then we know that the region has been used to allocate from and so should have it's young type set. (When the region becomes the current allocation region, its young type is set before it is used to satisfy an allocation.)
                                     
2010-07-19
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/5cbac8938c4c
                                     
2010-07-19
EVALUATION

This is an assert I added. I thought the "is_young" checks in the caller and in this routine would ensure that we had different cards. The card we got back from the cache is the same as the card we were adding to the cache and while we were checking the cache the region got freed and then allocated again.

The assert is too strong and if the card we get back is the same as the card we are inserting (and it's now young), then we can set the value of "defer" (while still returning NULL) so that the caller won't process the card.
                                     
2010-05-28



Hardware and Software, Engineered to Work Together