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>
--- a/hotspot/src/share/vm/gc/g1/heapRegion.cpp Wed Mar 02 17:08:40 2016 +0100
+++ b/hotspot/src/share/vm/gc/g1/heapRegion.cpp Thu Feb 25 11:27:13 2016 +0530
@@ -781,7 +781,9 @@
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());
+ if (obj->is_oop()) {
+ obj->print_on(log.error_stream());
+ }
log.error("Obj head CTE = %d, field CTE = %d.", cv_obj, cv_field);
log.error("----------");
_failures = true;