From f0841d4fafbadac02c673711b8220de598d6a4cf Mon Sep 17 00:00:00 2001 From: Giuseppe Ottaviano Date: Mon, 18 Oct 2021 21:23:28 -0700 Subject: [PATCH] Fix out-of-bounds access in MultiDBParallelOpenTest (#9046) Summary: `dbs` should not be cleared, as it is reused later when reopening the DBs, so we have an out-of-bounds access with `dbnames[dbnum]`. The values left in the vector don't need to be reset, as the db pointer is an out parameter for `DB::Open`. Pull Request resolved: https://github.com/facebook/rocksdb/pull/9046 Reviewed By: pdillinger Differential Revision: D31738263 Pulled By: ot fbshipit-source-id: c619e947b8d3dbc3d896f29971f093d3e3c794d3 --- db/db_test2.cc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/db/db_test2.cc b/db/db_test2.cc index b8e55f522..765019c1b 100644 --- a/db/db_test2.cc +++ b/db/db_test2.cc @@ -5537,8 +5537,6 @@ TEST_F(DBTest2, TestCompactFiles) { } #endif // ROCKSDB_LITE -// TODO: figure out why this test fails in appveyor -#ifndef OS_WIN TEST_F(DBTest2, MultiDBParallelOpenTest) { const int kNumDbs = 2; Options options = CurrentOptions(); @@ -5569,7 +5567,6 @@ TEST_F(DBTest2, MultiDBParallelOpenTest) { } // Verify non-empty DBs can be recovered in parallel - dbs.clear(); open_threads.clear(); for (int i = 0; i < kNumDbs; ++i) { open_threads.emplace_back( @@ -5586,7 +5583,6 @@ TEST_F(DBTest2, MultiDBParallelOpenTest) { ASSERT_OK(DestroyDB(dbnames[i], options)); } } -#endif // OS_WIN namespace { class DummyOldStats : public Statistics {