6723570: G1: assertion failure: p == current_top or oop(p)->is_oop(),"p is not a block start" (revisited!)
authoriveresov
Thu, 10 Jul 2008 09:29:54 -0700
changeset 1385 1751733b089b
parent 1384 163a4d4fa951
child 1386 e20a51f0d970
6723570: G1: assertion failure: p == current_top or oop(p)->is_oop(),"p is not a block start" (revisited!) Summary: Fixed the incorrect assigment to G1OffsetTableContigSpace::_gc_time_stamp. Also added a little more paranoia to operations on a global timestamp. Reviewed-by: tonyp
hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Thu Jul 03 03:17:29 2008 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Thu Jul 10 09:29:54 2008 -0700
@@ -2279,7 +2279,8 @@
   assert(Thread::current() == VMThread::vm_thread(), "should be in vm thread");
   guarantee(!is_gc_active(), "collection is not reentrant");
   assert(regions_accounted_for(), "Region leakage!");
-  ++_gc_time_stamp;
+
+  increment_gc_time_stamp();
 
   if (g1_policy()->in_young_gc_mode()) {
     assert(check_young_list_well_formed(),
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Thu Jul 03 03:17:29 2008 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Thu Jul 10 09:29:54 2008 -0700
@@ -247,7 +247,7 @@
   NumberSeq _pop_obj_rc_at_copy;
   void print_popularity_summary_info() const;
 
-  unsigned _gc_time_stamp;
+  volatile unsigned _gc_time_stamp;
 
   size_t* _surviving_young_words;
 
@@ -653,6 +653,12 @@
 
   void reset_gc_time_stamp() {
     _gc_time_stamp = 0;
+    OrderAccess::fence();
+  }
+
+  void increment_gc_time_stamp() {
+    ++_gc_time_stamp;
+    OrderAccess::fence();
   }
 
   void iterate_dirty_card_closure(bool concurrent, int worker_i);
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp	Thu Jul 03 03:17:29 2008 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp	Thu Jul 10 09:29:54 2008 -0700
@@ -793,8 +793,8 @@
     // will pick up the right saved_mark_word() as the high water mark
     // of the region. Either way, the behaviour will be correct.
     ContiguousSpace::set_saved_mark();
-    OrderAccess::release_store_ptr((volatile intptr_t*) &_gc_time_stamp,
-                                   (intptr_t) curr_gc_time_stamp);
+    _gc_time_stamp = curr_gc_time_stamp;
+    OrderAccess::fence();
   }
 }