< prev index next >

src/share/vm/gc_implementation/g1/heapRegion.cpp

Print this page
rev 7819 : 8150002: Check for the validity of oop before printing it in verify_remembered_set
Summary: Adding missing check for valid oop.
Reviewed-by: dcubed
Contributed-by: Shafi Ahmad <shafi.s.ahmad@oracle.com>


 777                              : cv_obj == dirty || cv_field == dirty));
 778         if (is_bad) {
 779           MutexLockerEx x(ParGCRareEvent_lock,
 780                           Mutex::_no_safepoint_check_flag);
 781 
 782           if (!_failures) {
 783             gclog_or_tty->cr();
 784             gclog_or_tty->print_cr("----------");
 785           }
 786           gclog_or_tty->print_cr("Missing rem set entry:");
 787           gclog_or_tty->print_cr("Field "PTR_FORMAT" "
 788                                  "of obj "PTR_FORMAT", "
 789                                  "in region "HR_FORMAT,
 790                                  p, (void*) _containing_obj,
 791                                  HR_FORMAT_PARAMS(from));
 792           _containing_obj->print_on(gclog_or_tty);
 793           gclog_or_tty->print_cr("points to obj "PTR_FORMAT" "
 794                                  "in region "HR_FORMAT,
 795                                  (void*) obj,
 796                                  HR_FORMAT_PARAMS(to));

 797           obj->print_on(gclog_or_tty);

 798           gclog_or_tty->print_cr("Obj head CTE = %d, field CTE = %d.",
 799                         cv_obj, cv_field);
 800           gclog_or_tty->print_cr("----------");
 801           gclog_or_tty->flush();
 802           _failures = true;
 803           if (!failed) _n_failures++;
 804         }
 805       }
 806     }
 807   }
 808 };
 809 
 810 // This really ought to be commoned up into OffsetTableContigSpace somehow.
 811 // We would need a mechanism to make that code skip dead objects.
 812 
 813 void HeapRegion::verify(VerifyOption vo,
 814                         bool* failures) const {
 815   G1CollectedHeap* g1 = G1CollectedHeap::heap();
 816   *failures = false;
 817   HeapWord* p = bottom();




 777                              : cv_obj == dirty || cv_field == dirty));
 778         if (is_bad) {
 779           MutexLockerEx x(ParGCRareEvent_lock,
 780                           Mutex::_no_safepoint_check_flag);
 781 
 782           if (!_failures) {
 783             gclog_or_tty->cr();
 784             gclog_or_tty->print_cr("----------");
 785           }
 786           gclog_or_tty->print_cr("Missing rem set entry:");
 787           gclog_or_tty->print_cr("Field "PTR_FORMAT" "
 788                                  "of obj "PTR_FORMAT", "
 789                                  "in region "HR_FORMAT,
 790                                  p, (void*) _containing_obj,
 791                                  HR_FORMAT_PARAMS(from));
 792           _containing_obj->print_on(gclog_or_tty);
 793           gclog_or_tty->print_cr("points to obj "PTR_FORMAT" "
 794                                  "in region "HR_FORMAT,
 795                                  (void*) obj,
 796                                  HR_FORMAT_PARAMS(to));
 797           if (obj->is_oop()) {
 798             obj->print_on(gclog_or_tty);
 799           }
 800           gclog_or_tty->print_cr("Obj head CTE = %d, field CTE = %d.",
 801                         cv_obj, cv_field);
 802           gclog_or_tty->print_cr("----------");
 803           gclog_or_tty->flush();
 804           _failures = true;
 805           if (!failed) _n_failures++;
 806         }
 807       }
 808     }
 809   }
 810 };
 811 
 812 // This really ought to be commoned up into OffsetTableContigSpace somehow.
 813 // We would need a mechanism to make that code skip dead objects.
 814 
 815 void HeapRegion::verify(VerifyOption vo,
 816                         bool* failures) const {
 817   G1CollectedHeap* g1 = G1CollectedHeap::heap();
 818   *failures = false;
 819   HeapWord* p = bottom();


< prev index next >