< prev index next >
src/share/vm/gc/g1/heapRegion.cpp
Print this page
*** 477,487 ****
// current region. We only look at those which are.
if (_hr->is_in(obj)) {
// Object is in the region. Check that its less than top
if (_hr->top() <= (HeapWord*)obj) {
// Object is above top
! log_info(gc, verify)("Object " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ") is above top " PTR_FORMAT,
p2i(obj), p2i(_hr->bottom()), p2i(_hr->end()), p2i(_hr->top()));
_failures = true;
return;
}
// Nmethod has at least one oop in the current region
--- 477,487 ----
// current region. We only look at those which are.
if (_hr->is_in(obj)) {
// Object is in the region. Check that its less than top
if (_hr->top() <= (HeapWord*)obj) {
// Object is above top
! log_error(gc, verify)("Object " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ") is above top " PTR_FORMAT,
p2i(obj), p2i(_hr->bottom()), p2i(_hr->end()), p2i(_hr->top()));
_failures = true;
return;
}
// Nmethod has at least one oop in the current region
*** 511,532 ****
void do_code_blob(CodeBlob* cb) {
nmethod* nm = (cb == NULL) ? NULL : cb->as_nmethod_or_null();
if (nm != NULL) {
// Verify that the nemthod is live
if (!nm->is_alive()) {
! log_info(gc, verify)("region [" PTR_FORMAT "," PTR_FORMAT "] has dead nmethod " PTR_FORMAT " in its strong code roots",
p2i(_hr->bottom()), p2i(_hr->end()), p2i(nm));
_failures = true;
} else {
VerifyStrongCodeRootOopClosure oop_cl(_hr, nm);
nm->oops_do(&oop_cl);
if (!oop_cl.has_oops_in_region()) {
! log_info(gc, verify)("region [" PTR_FORMAT "," PTR_FORMAT "] has nmethod " PTR_FORMAT " in its strong code roots with no pointers into region",
p2i(_hr->bottom()), p2i(_hr->end()), p2i(nm));
_failures = true;
} else if (oop_cl.failures()) {
! log_info(gc, verify)("region [" PTR_FORMAT "," PTR_FORMAT "] has other failures for nmethod " PTR_FORMAT,
p2i(_hr->bottom()), p2i(_hr->end()), p2i(nm));
_failures = true;
}
}
}
--- 511,532 ----
void do_code_blob(CodeBlob* cb) {
nmethod* nm = (cb == NULL) ? NULL : cb->as_nmethod_or_null();
if (nm != NULL) {
// Verify that the nemthod is live
if (!nm->is_alive()) {
! log_error(gc, verify)("region [" PTR_FORMAT "," PTR_FORMAT "] has dead nmethod " PTR_FORMAT " in its strong code roots",
p2i(_hr->bottom()), p2i(_hr->end()), p2i(nm));
_failures = true;
} else {
VerifyStrongCodeRootOopClosure oop_cl(_hr, nm);
nm->oops_do(&oop_cl);
if (!oop_cl.has_oops_in_region()) {
! log_error(gc, verify)("region [" PTR_FORMAT "," PTR_FORMAT "] has nmethod " PTR_FORMAT " in its strong code roots with no pointers into region",
p2i(_hr->bottom()), p2i(_hr->end()), p2i(nm));
_failures = true;
} else if (oop_cl.failures()) {
! log_error(gc, verify)("region [" PTR_FORMAT "," PTR_FORMAT "] has other failures for nmethod " PTR_FORMAT,
p2i(_hr->bottom()), p2i(_hr->end()), p2i(nm));
_failures = true;
}
}
}
*** 556,575 ****
// if this region is empty then there should be no entries
// on its strong code root list
if (is_empty()) {
if (strong_code_roots_length > 0) {
! log_info(gc, verify)("region [" PTR_FORMAT "," PTR_FORMAT "] is empty but has " SIZE_FORMAT " code root entries",
p2i(bottom()), p2i(end()), strong_code_roots_length);
*failures = true;
}
return;
}
if (is_continues_humongous()) {
if (strong_code_roots_length > 0) {
! log_info(gc, verify)("region " HR_FORMAT " is a continuation of a humongous region but has " SIZE_FORMAT " code root entries",
HR_FORMAT_PARAMS(this), strong_code_roots_length);
*failures = true;
}
return;
}
--- 556,575 ----
// if this region is empty then there should be no entries
// on its strong code root list
if (is_empty()) {
if (strong_code_roots_length > 0) {
! log_error(gc, verify)("region [" PTR_FORMAT "," PTR_FORMAT "] is empty but has " SIZE_FORMAT " code root entries",
p2i(bottom()), p2i(end()), strong_code_roots_length);
*failures = true;
}
return;
}
if (is_continues_humongous()) {
if (strong_code_roots_length > 0) {
! log_error(gc, verify)("region " HR_FORMAT " is a continuation of a humongous region but has " SIZE_FORMAT " code root entries",
HR_FORMAT_PARAMS(this), strong_code_roots_length);
*failures = true;
}
return;
}
*** 659,688 ****
if (!_g1h->is_in_closed_subset(obj) || _g1h->is_obj_dead_cond(obj, _vo)) {
MutexLockerEx x(ParGCRareEvent_lock,
Mutex::_no_safepoint_check_flag);
if (!_failures) {
! log.info("----------");
}
ResourceMark rm;
if (!_g1h->is_in_closed_subset(obj)) {
HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
! log.info("Field " PTR_FORMAT " of live obj " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ")",
p2i(p), p2i(_containing_obj), p2i(from->bottom()), p2i(from->end()));
! print_object(log.info_stream(), _containing_obj);
! log.info("points to obj " PTR_FORMAT " not in the heap", p2i(obj));
} else {
HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
HeapRegion* to = _g1h->heap_region_containing((HeapWord*)obj);
! log.info("Field " PTR_FORMAT " of live obj " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ")",
p2i(p), p2i(_containing_obj), p2i(from->bottom()), p2i(from->end()));
! print_object(log.info_stream(), _containing_obj);
! log.info("points to dead obj " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ")",
p2i(obj), p2i(to->bottom()), p2i(to->end()));
! print_object(log.info_stream(), obj);
}
! log.info("----------");
_failures = true;
failed = true;
_n_failures++;
}
}
--- 659,688 ----
if (!_g1h->is_in_closed_subset(obj) || _g1h->is_obj_dead_cond(obj, _vo)) {
MutexLockerEx x(ParGCRareEvent_lock,
Mutex::_no_safepoint_check_flag);
if (!_failures) {
! log.error("----------");
}
ResourceMark rm;
if (!_g1h->is_in_closed_subset(obj)) {
HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
! log.error("Field " PTR_FORMAT " of live obj " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ")",
p2i(p), p2i(_containing_obj), p2i(from->bottom()), p2i(from->end()));
! print_object(log.error_stream(), _containing_obj);
! log.error("points to obj " PTR_FORMAT " not in the heap", p2i(obj));
} else {
HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
HeapRegion* to = _g1h->heap_region_containing((HeapWord*)obj);
! log.error("Field " PTR_FORMAT " of live obj " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ")",
p2i(p), p2i(_containing_obj), p2i(from->bottom()), p2i(from->end()));
! print_object(log.error_stream(), _containing_obj);
! log.error("points to dead obj " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ")",
p2i(obj), p2i(to->bottom()), p2i(to->end()));
! print_object(log.error_stream(), obj);
}
! log.error("----------");
_failures = true;
failed = true;
_n_failures++;
}
}
*** 728,748 ****
if (is_bad) {
MutexLockerEx x(ParGCRareEvent_lock,
Mutex::_no_safepoint_check_flag);
if (!_failures) {
! log.info("----------");
}
! log.info("Missing rem set entry:");
! log.info("Field " PTR_FORMAT " of obj " PTR_FORMAT ", in region " HR_FORMAT,
p2i(p), p2i(_containing_obj), HR_FORMAT_PARAMS(from));
ResourceMark rm;
! _containing_obj->print_on(log.info_stream());
! log.info("points to obj " PTR_FORMAT " in region " HR_FORMAT, p2i(obj), HR_FORMAT_PARAMS(to));
! obj->print_on(log.info_stream());
! log.info("Obj head CTE = %d, field CTE = %d.", cv_obj, cv_field);
! log.info("----------");
_failures = true;
if (!failed) _n_failures++;
}
}
}
--- 728,748 ----
if (is_bad) {
MutexLockerEx x(ParGCRareEvent_lock,
Mutex::_no_safepoint_check_flag);
if (!_failures) {
! log.error("----------");
}
! log.error("Missing rem set entry:");
! log.error("Field " PTR_FORMAT " of obj " PTR_FORMAT ", in region " HR_FORMAT,
p2i(p), p2i(_containing_obj), HR_FORMAT_PARAMS(from));
ResourceMark rm;
! _containing_obj->print_on(log.error_stream());
! log.error("points to obj " PTR_FORMAT " in region " HR_FORMAT, p2i(obj), HR_FORMAT_PARAMS(to));
! obj->print_on(log.error_stream());
! log.error("Obj head CTE = %d, field CTE = %d.", cv_obj, cv_field);
! log.error("----------");
_failures = true;
if (!failed) _n_failures++;
}
}
}
*** 772,787 ****
Klass* klass = obj->klass();
bool is_metaspace_object = Metaspace::contains(klass) ||
(vo == VerifyOption_G1UsePrevMarking &&
ClassLoaderDataGraph::unload_list_contains(klass));
if (!is_metaspace_object) {
! log_info(gc, verify)("klass " PTR_FORMAT " of object " PTR_FORMAT " "
"not metadata", p2i(klass), p2i(obj));
*failures = true;
return;
} else if (!klass->is_klass()) {
! log_info(gc, verify)("klass " PTR_FORMAT " of object " PTR_FORMAT " "
"not a klass", p2i(klass), p2i(obj));
*failures = true;
return;
} else {
vl_cl.set_containing_obj(obj);
--- 772,787 ----
Klass* klass = obj->klass();
bool is_metaspace_object = Metaspace::contains(klass) ||
(vo == VerifyOption_G1UsePrevMarking &&
ClassLoaderDataGraph::unload_list_contains(klass));
if (!is_metaspace_object) {
! log_error(gc, verify)("klass " PTR_FORMAT " of object " PTR_FORMAT " "
"not metadata", p2i(klass), p2i(obj));
*failures = true;
return;
} else if (!klass->is_klass()) {
! log_error(gc, verify)("klass " PTR_FORMAT " of object " PTR_FORMAT " "
"not a klass", p2i(klass), p2i(obj));
*failures = true;
return;
} else {
vl_cl.set_containing_obj(obj);
*** 809,819 ****
vl_cl.n_failures() >= G1MaxVerifyFailures) {
return;
}
}
} else {
! log_info(gc, verify)(PTR_FORMAT " not an oop", p2i(obj));
*failures = true;
return;
}
}
prev_p = p;
--- 809,819 ----
vl_cl.n_failures() >= G1MaxVerifyFailures) {
return;
}
}
} else {
! log_error(gc, verify)(PTR_FORMAT " not an oop", p2i(obj));
*failures = true;
return;
}
}
prev_p = p;
*** 825,840 ****
}
if (is_region_humongous) {
oop obj = oop(this->humongous_start_region()->bottom());
if ((HeapWord*)obj > bottom() || (HeapWord*)obj + obj->size() < bottom()) {
! log_info(gc, verify)("this humongous region is not part of its' humongous object " PTR_FORMAT, p2i(obj));
}
}
if (!is_region_humongous && p != top()) {
! log_info(gc, verify)("end of last object " PTR_FORMAT " "
"does not match top " PTR_FORMAT, p2i(p), p2i(top()));
*failures = true;
return;
}
--- 825,840 ----
}
if (is_region_humongous) {
oop obj = oop(this->humongous_start_region()->bottom());
if ((HeapWord*)obj > bottom() || (HeapWord*)obj + obj->size() < bottom()) {
! log_error(gc, verify)("this humongous region is not part of its' humongous object " PTR_FORMAT, p2i(obj));
}
}
if (!is_region_humongous && p != top()) {
! log_error(gc, verify)("end of last object " PTR_FORMAT " "
"does not match top " PTR_FORMAT, p2i(p), p2i(top()));
*failures = true;
return;
}
*** 845,855 ****
if (p < the_end) {
// Look up top
HeapWord* addr_1 = p;
HeapWord* b_start_1 = _bot_part.block_start_const(addr_1);
if (b_start_1 != p) {
! log_info(gc, verify)("BOT look up for top: " PTR_FORMAT " "
" yielded " PTR_FORMAT ", expecting " PTR_FORMAT,
p2i(addr_1), p2i(b_start_1), p2i(p));
*failures = true;
return;
}
--- 845,855 ----
if (p < the_end) {
// Look up top
HeapWord* addr_1 = p;
HeapWord* b_start_1 = _bot_part.block_start_const(addr_1);
if (b_start_1 != p) {
! log_error(gc, verify)("BOT look up for top: " PTR_FORMAT " "
" yielded " PTR_FORMAT ", expecting " PTR_FORMAT,
p2i(addr_1), p2i(b_start_1), p2i(p));
*failures = true;
return;
}
*** 857,867 ****
// Look up top + 1
HeapWord* addr_2 = p + 1;
if (addr_2 < the_end) {
HeapWord* b_start_2 = _bot_part.block_start_const(addr_2);
if (b_start_2 != p) {
! log_info(gc, verify)("BOT look up for top + 1: " PTR_FORMAT " "
" yielded " PTR_FORMAT ", expecting " PTR_FORMAT,
p2i(addr_2), p2i(b_start_2), p2i(p));
*failures = true;
return;
}
--- 857,867 ----
// Look up top + 1
HeapWord* addr_2 = p + 1;
if (addr_2 < the_end) {
HeapWord* b_start_2 = _bot_part.block_start_const(addr_2);
if (b_start_2 != p) {
! log_error(gc, verify)("BOT look up for top + 1: " PTR_FORMAT " "
" yielded " PTR_FORMAT ", expecting " PTR_FORMAT,
p2i(addr_2), p2i(b_start_2), p2i(p));
*failures = true;
return;
}
*** 871,881 ****
size_t diff = pointer_delta(the_end, p) / 2;
HeapWord* addr_3 = p + diff;
if (addr_3 < the_end) {
HeapWord* b_start_3 = _bot_part.block_start_const(addr_3);
if (b_start_3 != p) {
! log_info(gc, verify)("BOT look up for top + diff: " PTR_FORMAT " "
" yielded " PTR_FORMAT ", expecting " PTR_FORMAT,
p2i(addr_3), p2i(b_start_3), p2i(p));
*failures = true;
return;
}
--- 871,881 ----
size_t diff = pointer_delta(the_end, p) / 2;
HeapWord* addr_3 = p + diff;
if (addr_3 < the_end) {
HeapWord* b_start_3 = _bot_part.block_start_const(addr_3);
if (b_start_3 != p) {
! log_error(gc, verify)("BOT look up for top + diff: " PTR_FORMAT " "
" yielded " PTR_FORMAT ", expecting " PTR_FORMAT,
p2i(addr_3), p2i(b_start_3), p2i(p));
*failures = true;
return;
}
*** 883,893 ****
// Look up end - 1
HeapWord* addr_4 = the_end - 1;
HeapWord* b_start_4 = _bot_part.block_start_const(addr_4);
if (b_start_4 != p) {
! log_info(gc, verify)("BOT look up for end - 1: " PTR_FORMAT " "
" yielded " PTR_FORMAT ", expecting " PTR_FORMAT,
p2i(addr_4), p2i(b_start_4), p2i(p));
*failures = true;
return;
}
--- 883,893 ----
// Look up end - 1
HeapWord* addr_4 = the_end - 1;
HeapWord* b_start_4 = _bot_part.block_start_const(addr_4);
if (b_start_4 != p) {
! log_error(gc, verify)("BOT look up for end - 1: " PTR_FORMAT " "
" yielded " PTR_FORMAT ", expecting " PTR_FORMAT,
p2i(addr_4), p2i(b_start_4), p2i(p));
*failures = true;
return;
}
*** 922,932 ****
if (G1MaxVerifyFailures >= 0 &&
vr_cl.n_failures() >= G1MaxVerifyFailures) {
return;
}
} else {
! log_info(gc, verify)(PTR_FORMAT " not an oop", p2i(obj));
*failures = true;
return;
}
}
--- 922,932 ----
if (G1MaxVerifyFailures >= 0 &&
vr_cl.n_failures() >= G1MaxVerifyFailures) {
return;
}
} else {
! log_error(gc, verify)(PTR_FORMAT " not an oop", p2i(obj));
*failures = true;
return;
}
}
< prev index next >