diff --git a/db/db_test_util.cc b/db/db_test_util.cc index 68f58b705..3091d77c2 100644 --- a/db/db_test_util.cc +++ b/db/db_test_util.cc @@ -1157,11 +1157,13 @@ UpdateStatus DBTestBase::updateInPlaceNoAction(char* prevValue, // Utility method to test InplaceUpdate void DBTestBase::validateNumberOfEntries(int numValues, int cf) { - ScopedArenaIterator iter; Arena arena; auto options = CurrentOptions(); InternalKeyComparator icmp(options.comparator); RangeDelAggregator range_del_agg(icmp, {} /* snapshots */); + // This should be defined after range_del_agg so that it destructs the + // assigned iterator before it range_del_agg is already destructed. + ScopedArenaIterator iter; if (cf != 0) { iter.set( dbfull()->NewInternalIterator(&arena, &range_del_agg, handles_[cf]));