Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-42170

UBSan: member call on address X which does not point to an object of type 'EPBucket' during ep_testsuite_basis.value_eviction.magma

    XMLWordPrintable

Details

    • Triaged
    • 1
    • Unknown

    Description

      During CV testing for http://review.couchbase.org/c/kv_engine/+/138373, the following undefined behaviour was reported in ep_testsuite_basic.value_eviction.magma relating to compaction context:

         1/393 Test #244: ep_testsuite_basic.value_eviction.magma .....................................................................Child aborted***Exception:  20.65 sec
       Running [0000/0047]: test alloc limit...(446 ms) OK
       Running [0001/0047]: test_memory_tracking...Memory tracker not enabled ...(168 ms) SKIPPED
       Running [0002/0047]: test max_size - water_mark changes...(556 ms) OK
       Running [0003/0047]: test whitespace dbname...(364 ms) OK
       Running [0004/0047]: get miss...(106 ms) OK
       Running [0005/0047]: set...(138 ms) OK
       Running [0006/0047]: concurrent set.../usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/invoke.h:73:14: runtime error: member call on address 0x61700000a180 which does not point to an object of type 'EPBucket'
       0x61700000a180: note: object is of type 'KVBucket'
        0d 00 00 08  30 a7 60 68 40 7f 00 00  80 82 05 00 d0 61 00 00  98 82 05 00 d0 61 00 00  d0 ba 30 00
                     ^~~~~~~~~~~~~~~~~~~~~~~
                     vptr for 'KVBucket'
           #0 0x7f4066401e9e in std::shared_ptr<CompactionContext> std::__invoke_impl<std::shared_ptr<CompactionContext>, std::shared_ptr<CompactionContext> (EPBucket::*&)(CompactionConfig&, unsigned long), EPBucket*&, CompactionConfig&, unsigned long>(std::__invoke_memfun_deref, std::shared_ptr<CompactionContext> (EPBucket::*&)(CompactionConfig&, unsigned long), EPBucket*&, CompactionConfig&, unsigned long&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/invoke.h:73:14
           #1 0x7f4066401c70 in std::__invoke_result<std::shared_ptr<CompactionContext> (EPBucket::*&)(CompactionConfig&, unsigned long), EPBucket*&, CompactionConfig&, unsigned long>::type std::__invoke<std::shared_ptr<CompactionContext> (EPBucket::*&)(CompactionConfig&, unsigned long), EPBucket*&, CompactionConfig&, unsigned long>(std::shared_ptr<CompactionContext> (EPBucket::*&)(CompactionConfig&, unsigned long), EPBucket*&, CompactionConfig&, unsigned long&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/invoke.h:95:14
           #2 0x7f4066401b11 in std::shared_ptr<CompactionContext> std::_Bind<std::shared_ptr<CompactionContext> (EPBucket::* (EPBucket*, std::_Placeholder<1>, std::_Placeholder<2>))(CompactionConfig&, unsigned long)>::__call<std::shared_ptr<CompactionContext>, CompactionConfig&, unsigned long&&, 0ul, 1ul, 2ul>(std::tuple<CompactionConfig&, unsigned long&&>&&, std::_Index_tuple<0ul, 1ul, 2ul>) /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/functional:467:11
           #3 0x7f406640191b in std::shared_ptr<CompactionContext> std::_Bind<std::shared_ptr<CompactionContext> (EPBucket::* (EPBucket*, std::_Placeholder<1>, std::_Placeholder<2>))(CompactionConfig&, unsigned long)>::operator()<CompactionConfig&, unsigned long, std::shared_ptr<CompactionContext> >(CompactionConfig&, unsigned long&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/functional:549:17
           #4 0x7f406640137f in std::_Function_handler<std::shared_ptr<CompactionContext> (CompactionConfig&, unsigned long), std::_Bind<std::shared_ptr<CompactionContext> (EPBucket::* (EPBucket*, std::_Placeholder<1>, std::_Placeholder<2>))(CompactionConfig&, unsigned long)> >::_M_invoke(std::_Any_data const&, CompactionConfig&, unsigned long&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/std_function.h:301:9
           #5 0x7f406694daca in std::function<std::shared_ptr<CompactionContext> (CompactionConfig&, unsigned long)>::operator()(CompactionConfig&, unsigned long) const /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/std_function.h:706:14
           #6 0x7f4066918937 in MagmaKVStore::makeCompactionContext(Vbid) /home/couchbase/jenkins/workspace/kv_engine.ASan-UBSan_master/build/../kv_engine/engines/ep/src/magma-kvstore/magma-kvstore.cc:2320:16
           #7 0x7f40669163ff in MagmaKVStore::compactionCallBack(MagmaKVStore::MagmaCompactionCB&, magma::Slice const&, magma::Slice const&, magma::Slice const&) /home/couchbase/jenkins/workspace/kv_engine.ASan-UBSan_master/build/../kv_engine/engines/ep/src/magma-kvstore/magma-kvstore.cc:282:21
           #8 0x7f40619c4141 in magma::DocSeqGCContext::Transform(magma::Slice const&, magma::Slice const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, magma::Slice*) /home/couchbase/jenkins/workspace/kv_engine.ASan-UBSan_master/build/../magma/magma/kvstore/lsd.cc:134:16
           #9 0x7f40618d2ad2 in magma::ItemGCFilter::Process(std::vector<std::pair<magma::Slice, magma::Slice>, std::allocator<std::pair<magma::Slice, magma::Slice> > >&, std::vector<std::pair<magma::Slice, magma::Slice>, std::allocator<std::pair<magma::Slice, magma::Slice> > >*) /home/couchbase/jenkins/workspace/kv_engine.ASan-UBSan_master/build/../magma/lsm/mvcc.cc:116:43
           #10 0x7f40619e66e4 in magma::LSMTree::mergeSSTables(std::vector<std::shared_ptr<magma::Table>, std::allocator<std::shared_ptr<magma::Table> > >&, magma::ItemGCFilter&, unsigned long, double, std::vector<std::shared_ptr<magma::Table>, std::allocator<std::shared_ptr<magma::Table> > >*) /home/couchbase/jenkins/workspace/kv_engine.ASan-UBSan_master/build/../magma/lsm/lsm_tree.cc:633:12
           #11 0x7f40618abd01 in magma::LSMTree::compactLevelForInputs(int, int, std::unique_lock<std::mutex>&, std::vector<std::shared_ptr<magma::Table>, std::allocator<std::shared_ptr<magma::Table> > >&, std::vector<std::shared_ptr<magma::Table>, std::allocator<std::shared_ptr<magma::Table> > >&, bool, std::function<std::unique_ptr<magma::GCContext, std::default_delete<magma::GCContext> > (bool)>) /home/couchbase/jenkins/workspace/kv_engine.ASan-UBSan_master/build/../magma/lsm/compaction.cc:168:18
           #12 0x7f40618aa30a in magma::LSMTree::compactLevel(int, std::unique_lock<std::mutex>&, bool, std::function<std::unique_ptr<magma::GCContext, std::default_delete<magma::GCContext> > (bool)>) /home/couchbase/jenkins/workspace/kv_engine.ASan-UBSan_master/build/../magma/lsm/compaction.cc:73:12
           #13 0x7f40618b1157 in magma::LSMTree::compact(std::unique_lock<std::mutex>&) /home/couchbase/jenkins/workspace/kv_engine.ASan-UBSan_master/build/../magma/lsm/compaction.cc:339:23
           #14 0x7f40619e13b5 in magma::LSMTree::doCompactionWork() /home/couchbase/jenkins/workspace/kv_engine.ASan-UBSan_master/build/../magma/lsm/lsm_tree.cc:286:13
           #15 0x7f4061ac00cb in magma::Task::Run() /home/couchbase/jenkins/workspace/kv_engine.ASan-UBSan_master/build/../magma/util/worker.h:48:13
           #16 0x7f4061abe615 in magma::TaskWorker::loop(void*) /home/couchbase/jenkins/workspace/kv_engine.ASan-UBSan_master/build/../magma/util/worker.cc:145:18
           #17 0x7f405f1a67a9 in CouchbaseThread::run() /home/couchbase/jenkins/workspace/kv_engine.ASan-UBSan_master/build/../platform/src/cb_pthreads.cc:58:9
           #18 0x7f405f1a4317 in platform_thread_wrap(void*) /home/couchbase/jenkins/workspace/kv_engine.ASan-UBSan_master/build/../platform/src/cb_pthreads.cc:71:14
           #19 0x7f405ddf06b9 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76b9)
           #20 0x7f405d70841c in clone /build/glibc-LK5gWL/glibc-2.23/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:109
       
       SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/invoke.h:73:14 in 
      

      This may or may not be legitimate, certainly for UBSan to correct determine the runtime type of an object being called via virtual function requires correct RTTI information to be present and there's been issues with symbol visibility in the past.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              drigby Dave Rigby (Inactive)
              drigby Dave Rigby (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty