db/version_set.cc:593: leveldb::VersionSet::~VersionSet(): Assertion `dummy_versions_.next_ == &dummy_versions_' failed.

473 views
Skip to first unread message

王元涛

unread,
Aug 30, 2011, 5:18:37 AM8/30/11
to lev...@googlegroups.com, 于冰
I run into another assertion failure and isolated it in a test.cc  (attached)
tar xzf leveldb_test.tar.gz
./test
or "sh build.sh" and then "./test"

The application can read thru the leveldb instance correctly but failed in the deconstruction.
Is that assertion necessary?
{{{
VersionSet::~VersionSet() {
  current_->Unref();
  assert(dummy_versions_.next_ == &dummy_versions_);  // List must be empty
  delete descriptor_log_;
  delete descriptor_file_;
}
}}}
or something goes wrong in version set?

leveldb_test.tar.gz

panmenghan

unread,
Aug 30, 2011, 2:31:13 PM8/30/11
to leveldb
// Caller should delete the iterator when it is no longer needed.
// The returned iterator should be deleted before this db is deleted.
virtual Iterator* NewIterator(const ReadOptions& options) = 0;

{{{ // in test.cc
std::cout << "end iterating" << std::endl;
+ delete it;
delete db;

return 0;
}}}

After added it, I tested and no assertion failure :)

王元涛

unread,
Aug 30, 2011, 10:13:30 PM8/30/11
to leveldb
Thank you panmenghan for your help! It works!
Sorry I missed the that interface convention.
Reply all
Reply to author
Forward
0 new messages