From 78c2eedb4fde8801922ad020061a7503070bf25c Mon Sep 17 00:00:00 2001 From: Maysam Yabandeh Date: Mon, 18 Dec 2017 14:13:45 -0800 Subject: [PATCH] fix release order in validateNumberOfEntries Summary: ScopedArenaIterator should be defined after range_del_agg so that it destructs the assigned iterator, which depends on range_del_agg, before it range_del_agg is already destructed. Closes https://github.com/facebook/rocksdb/pull/3281 Differential Revision: D6592332 Pulled By: maysamyabandeh fbshipit-source-id: 89a15d8ed13d0fc856b0c47dce3d91778738dbac --- db/db_test_util.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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]));