liuis / leveldb

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

Crash on a simple load test (ubuntu, freebsd, gcc47). #142

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run the test.

What is the expected output? What do you see instead?
Test will likely crash when getting values back or when destroying DB instance.

What version of the product are you using? On what operating system?
leveldb 1.7.0, leveldb 1.9.0. Ubuntu 12.10, Freebsd. gcc47.

Please provide any additional information below.
Test has a very simple scenario:
1. Put 100000 unique records with random values. Where a value size varies from 
32 to 4096 bytes.
2. Get all keys one by one.

leveldb::Options and leveldb::ReadOptions are default except cache. Cache size 
is 128 mb.
Crashes are different every run, sometimes test works normally and not crash at 
all. But more often it crashes.
Crash probability increases with increasing records count.

Original issue reported on code.google.com by vladimir...@gmail.com on 25 Jan 2013 at 1:16

Attachments:

GoogleCodeExporter commented 9 years ago
You have:
    std::auto_ptr<leveldb::DB> m_db;
    std::auto_ptr<leveldb::Cache> m_cache;
This means m_cache will be deleted before the db object is deleted.  This is 
not allowed.  The cache passed to db must remain live until the db has been 
deleted.

Original comment by san...@google.com on 25 Jan 2013 at 7:35