提交 f0841d4f 编写于 作者: G Giuseppe Ottaviano 提交者: Facebook GitHub Bot

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
上级 314de7e7
......@@ -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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册