Crash in rocksdb::FileSystemWrapper::NewLogger
- Dominant language
- C++
- Stars
- 32.1k
- Forks
- 6.9k
- Avg merge
- 32m
- Merged PRs (30d)
- 1
Description
We recently updated RocksDB from v6.29 to v8.5.4.
We noticed a crash when NewLogger is called. I'm not sure if we might be doing something to contribute to the crash. It's a very rare crash I don't think we saw that before.
```
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x000000000000005b
0 rocksdb 0x28b4555 rocksdb::FileSystemWrapper::NewLogger(std::__1::basic_string, std::__1::allocator > const&, rocksdb::IOOptions const&, std::__1::shared_ptr*, rocksdb::IODebugContext*) + 1342 (file_system.h:1342)
1 rocksdb 0x2830624 rocksdb::InternalKeyComparator::FindShortestSeparator(std::__1::basic_string, std::__1::allocator >*, rocksdb::Slice const&) const + 153 (dbformat.cc:153)
2 rocksdb 0x29158c8 rocksdb::ShortenedIndexBuilder::AddIndexEntry(std::__1::basic_string, std::__1::allocator >*, rocksdb::Slice const*, rocksdb::BlockHandle const&) + 158 (index_builder.h:158)
3 rocksdb 0x28e38af rocksdb::BlockBasedTableBuilder::Add(rocksdb::Slice const&, rocksdb::Slice const&) + 960 (block_based_table_builder.cc:960)
4 rocksdb 0x27d3e8c rocksdb::CompactionJob::SubcompactionState::AddToBuilder(rocksdb::Slice const&, rocksdb::Slice const&) + 37 (status.h:37)
5 rocksdb 0x27d06e1 rocksdb::CompactionJob::ProcessKeyValueCompaction(rocksdb::CompactionJob::SubcompactionState*) + 521 (status.h:521)
6 rocksdb 0x27ce8f8 rocksdb::CompactionJob::Run() + 722 (compaction_job.cc:722)
7 rocksdb 0x2802c6e rocksdb::DBImpl::BackgroundCompaction(bool*, rocksdb::JobContext*, rocksdb::LogBuffer*, rocksdb::DBImpl::PrepickedCompaction*, rocksdb::Env::Priority) + 46 (status.h:46)
8 rocksdb 0x2801046 rocksdb::DBImpl::BackgroundCallCompaction(rocksdb::DBImpl::PrepickedCompaction*, rocksdb::Env::Priority) + 98 (status.h:98)
9 rocksdb 0x27ff407 rocksdb::DBImpl::BGWorkCompaction(void*) + 2660 (db_impl_compaction_flush.cc:2660)
10 rocksdb 0x2943699 rocksdb::ThreadPoolImpl::Impl::BGThread(unsigned long) + 470 (function.h:470)
11 rocksdb 0x2944baf void* std::__1::__thread_proxy[abi:v15006] >, void (*)(void*), rocksdb::BGThreadMetadata*> >(void*) + 259 (unique_ptr.h:259)
12 libsystem_pthread.dylib 0x61d3 _pthread_start + 125
13 libsystem_pthread.dylib 0x1bd3 thread_start + 15
```
Contributor guide
Research direction
Start at file_system.h:1342 and trace the NewLogger call through the stack frames in dbformat.cc, index_builder.h, block_based_table_builder.cc, and compaction_job.cc. Compare the RocksDB v6.29 and v8.5.4 behavior and investigate the reported EXC_BAD_ACCESS during compaction. Done means the crash cause is identified and a reproducible test or validated fix is provided.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100