• D
    Segfault in DoCompactionWork caused by buffer overflow · bb2dcd24
    Dhruba Borthakur 提交于
    Summary:
    The code was allocating 200 bytes on the stack but it
    writes 256 bytes into the array.
    
    x8a8ea5 std::_Rb_tree<>::erase()
        @     0x7f134bee7eb0 (unknown)
        @           0x8a8ea5 std::_Rb_tree<>::erase()
        @           0x8a35d6 leveldb::DBImpl::CleanupCompaction()
        @           0x8a7810 leveldb::DBImpl::BackgroundCompaction()
        @           0x8a804d leveldb::DBImpl::BackgroundCall()
        @           0x8c4eff leveldb::(anonymous namespace)::PosixEnv::BGThreadWrapper()
        @     0x7f134b3c010d start_thread
        @     0x7f134bf9f10d clone
    
    Test Plan: run db_bench with overwrite option
    
    Reviewers: heyongqiang
    
    Reviewed By: heyongqiang
    
    Differential Revision: https://reviews.facebook.net/D5595
    bb2dcd24
version_set.cc 50.6 KB