Hi Scott, thanks for answer.
Crash happens not exactly in leveldb::DBImpl::BackgroundCompaction but in the functions called by it, I forgot to attach partial stack, here it is:
base::`anonymous namespace'::OnNoMemory
malloc
operator new(unsigned int)
std::_Allocate(unsigned int, unsigned int, bool)
std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Reallocate_grow_by<<lambda_ab246b20b9526e2ef7792587e4298a77>, char const*, unsigned int>
std::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(char const* const, unsigned int)
leveldb::BlockBuilder::Add(leveldb::Slice const&, leveldb::Slice const&)
leveldb::TableBuilder::Add(leveldb::Slice const&, leveldb::Slice const&)
leveldb::DBImpl::DoCompactionWork(leveldb::DBImpl::CompactionState*)