facebook / facebook/rocksdb

Segfault on v7.9.0 trying to open data created by v6.2.2

Open
#10,968 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
32.1k
Forks
6.9k
Avg merge
32m
Merged PRs (30d)
1

Description

We've been using RocksDb for years. There's a (.NET) process using RocksDbSharp to generate RocskDb data. There's a C++ library that reads them. Both from 2018 or so. Both use Snappy compression. The C++ library is compiled under C++ 11.

We're trying to upgrade to newer RocksDb now. In unit tests, the new C++ library can create new files and read them just fine. However, it crashes (segmentation fault) on the first ```rocksdb::DB::Open``` call when accessing the existing data. More specifically, the call stack goes to ```LoadTableHandlers```.

Here is the source code, nothing fancy:

```c++
rocksdb::DB* db;
rocksdb::Options options;
options.compression = rocksdb::CompressionType::kSnappyCompression;
options.create_if_missing = false;
rocksdb::Status status = rocksdb::DB::Open(options, myValidPath, &db);
```

See the call stack below.

ZwWaitForSingleObject 0x00007ffff97ad144
WaitForSingleObjectEx 0x00007ffff6ef306e
pthread_join 0x0000000064945edc
_ZNSt6thread4joinEv 0x000000006fce0577
rocksdb::VersionBuilder::Rep::LoadTableHandlers(rocksdb::InternalStats*, int, bool, bool, std::shared_ptr const&, unsigned long long) 0x00000000009747d8
rocksdb::VersionBuilder::LoadTableHandlers(rocksdb::InternalStats*, int, bool, bool, std::shared_ptr const&, unsigned long long) 0x00000000007e86fb
rocksdb::VersionEditHandler::LoadTables(rocksdb::ColumnFamilyData*, bool, bool) 0x00000000007ea471
rocksdb::VersionEditHandler::CheckIterationResult(rocksdb::log::Reader const&, rocksdb::Status*) 0x00000000007ec8c8
rocksdb::VersionEditHandlerBase::Iterate(rocksdb::log::Reader&, rocksdb::Status*) 0x00000000007ebe4c
rocksdb::VersionSet::Recover(std::vector > const&, bool, std::__cxx11::basic_string, std::allocator >*, bool) 0x00000000005bc135
rocksdb::DBImpl::Recover(std::vector > const&, bool, bool, bool, unsigned long long*, rocksdb::DBImpl::RecoveryContext*) 0x0000000000570caf
rocksdb::DBImpl::Open(rocksdb::DBOptions const&, std::__cxx11::basic_string, std::allocator > const&, std::vector > const&, std::vector >*, rocksdb::DB**, bool, bool) 0x00000000005698bb
rocksdb::DB::Open(rocksdb::Options const&, std::__cxx11::basic_string, std::allocator > const&, rocksdb::DB**) 0x000000000056b88f
main TestMain.cpp:131
__tmainCRTStartup 0x00000000004013c7
mainCRTStartup 0x00000000004014fb
BaseThreadInitThunk 0x00007ffff8a174b4
RtlUserThreadStart 0x00007ffff97626a1
0x0000000000000000

### Expected behavior
Expected to open the file.

### Actual behavior
Segmentation fault crash.

### Steps to reproduce the behavior
Try opening this file: [role.zip](https://github.com/facebook/rocksdb/files/10049351/role.zip)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.