Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core dump in DB#close/DB#reopen after DB#each/DB#range #19

Open
ogibayashi opened this issue Oct 16, 2014 · 0 comments
Open

Core dump in DB#close/DB#reopen after DB#each/DB#range #19

ogibayashi opened this issue Oct 16, 2014 · 0 comments

Comments

@ogibayashi
Copy link

Invoking DB#close or DB#reopen after using iterator (DB#each, DB#range) causes core dump.

2.1.2 :001 > require 'leveldb'
 => true 
2.1.2 :002 > db = LevelDB::DB.new('/disks/disk6/leveldb/range_test')   # If I does not use iterator, its OK.
 => #<LevelDB::DB:0x798290> 
2.1.2 :003 > db.reopen
 => nil 
2.1.2 :004 > db.close
 => true 
2.1.2 :005 > db = LevelDB::DB.new('/disks/disk6/leveldb/range_test')   # DB#reopen after interating, core dumped.
 => #<LevelDB::DB:0x78b900> 
2.1.2 :006 > db.each{|k,v|  break}
 => #<LevelDB::Iterator:0x7839a8> 
2.1.2 :007 > db.reopen
irb: version_set.cc:715: leveldb::VersionSet::~VersionSet(): Assertion `dummy_versions_.next_ == &dummy_versions_' failed.
Aborted (core dumped)

If I close iterator explicitly, it worked.

2.1.2 :001 > require 'leveldb'
 => true 
2.1.2 :002 > db = LevelDB::DB.new('/disks/disk6/leveldb/range_test')
 => #<LevelDB::DB:0x4be060> 
2.1.2 :003 > it = db.each
 => #<LevelDB::Iterator:0x4ba2bc> 
2.1.2 :004 > it.each{|k,v|   break }
 => nil 
2.1.2 :005 > it.instance_eval{ LevelDB::C.iter_destroy(@_iterator) }
 => nil 
2.1.2 :006 > db.close
 => true 

Relating to this LevelDB Issue?
https://code.google.com/p/leveldb/issues/detail?id=136

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant