chrsmithdemos / leveldb

Automatically exported from code.google.com/p/leveldb
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

leveldb core dump #226

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
#0  leveldb::ReadBlock (file=0x8ba6420, options=@0x783124c0, 
handle=@0x78311fd0, result=0x78311f90) at table/format.cc:101
#1  0x0000000000b9f179 in leveldb::Table::BlockReader (arg=0x7f3b158a6c18, 
options=@0x783124c0, index_value=Variable "index_value" is not available.
)   
    at ./include/leveldb/status.h:95
#2  0x0000000000b9f4e6 in leveldb::Table::InternalGet (this=0x7f3b158a6c18, 
options=@0x783124c0, k=@0x783122a0,
    arg=0x783121b0, saver=0xba4940 <SaveValue>) at table/table.cc:232
#3  0x0000000000b9e76f in leveldb::TableCache::Get (this=0x8cf3640, 
options=@0x783124c0, file_number=Variable "file_number" is not available.
)   
    at ./include/leveldb/status.h:95
#4  0x0000000000baa4fd in leveldb::Version::Get (this=0x8c1d480, 
options=@0x783124c0, k=Variable "k" is not available.
) at ./include/leveldb/status.h:95
#5  0x0000000000b8b151 in leveldb::DBImpl::Get (this=0x8cf5dc0, 
options=@0x783124c0, key=@0x783125f0, value=0x78312610)
    at ./include/leveldb/status.h:95

Original issue reported on code.google.com by jovec...@gmail.com on 1 Mar 2014 at 3:26

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
in TableCache::FindTable
 *handle = cache_->Lookup(key);      
    ..............
    *handle = cache_->Insert(key, tf, 1, &DeleteEntry);  

if there are two threads  A, and B,they Get the same key, 
A lookup(key) failed ,but haven't Insert(key)in cache_, 
B lookup(key) failed also, but when B Insert(key) ,A has Insert(key) already.

so, when program free the memory ,there is an error。

does the time  between lookup(key)and insert(key) need a lock?

Original comment by veryd...@gmail.com on 27 Mar 2014 at 8:46