Log moving-space end of previous compaction when corruption detected If an object's class is found to be null past this pointer then the corruption must have happened elsewhere. Test: ATP test-infra Change-Id: I9e8819ceaf99f3d6117115ddf7ef0aed0b774b0d
diff --git a/runtime/gc/collector/mark_compact.cc b/runtime/gc/collector/mark_compact.cc index 021d8ba..9e98d7e 100644 --- a/runtime/gc/collector/mark_compact.cc +++ b/runtime/gc/collector/mark_compact.cc
@@ -500,7 +500,8 @@ uffd_(kFdUnused), marking_done_(false), uffd_initialized_(false), - clamp_info_map_status_(ClampInfoStatus::kClampInfoNotDone) { + clamp_info_map_status_(ClampInfoStatus::kClampInfoNotDone), + prev_moving_space_end_at_compaction_(moving_space_begin_) { if (kIsDebugBuild) { updated_roots_.reset(new std::unordered_set<void*>()); } @@ -2985,6 +2986,7 @@ bump_pointer_space_->SetBlockSizes(thread_running_gc_, post_compact_end_ - begin, consumed_blocks_count); + prev_moving_space_end_at_compaction_ = static_cast<void*>(bump_pointer_space_->End()); if (kIsDebugBuild) { size_t moving_space_size = bump_pointer_space_->Size(); size_t los_size = 0; @@ -4724,6 +4726,8 @@ << " prev_post_compact_end: " << prev_post_compact_end_ << " prev_black_allocations_begin: " << prev_black_allocations_begin_ << " prev_black_dense_end: " << prev_black_dense_end_ + << " prev_moving_space_end_at_compaction: " + << prev_moving_space_end_at_compaction_ << " prev_gc_young: " << prev_gc_young_ << " prev_gc_performed_compaction: " << prev_gc_performed_compaction_;
diff --git a/runtime/gc/collector/mark_compact.h b/runtime/gc/collector/mark_compact.h index 24f2b8f..717ac5f 100644 --- a/runtime/gc/collector/mark_compact.h +++ b/runtime/gc/collector/mark_compact.h
@@ -958,6 +958,7 @@ void* prev_post_compact_end_; void* prev_black_dense_end_; void* prev_black_allocations_begin_; + void* prev_moving_space_end_at_compaction_; bool prev_gc_young_; bool prev_gc_performed_compaction_; // Timestamp when the read-barrier is enabled