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

UBSan: signed integer overflow in LSMTreeStats::Merge

    XMLWordPrintable

Details

    • Untriaged
    • 0
    • Unknown

    Description

      As seen during CV run (http://cv.jenkins.couchbase.com/job/kv_engine.ASan-UBSan/job/neo/1237/):

      /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/chrono:564:34: runtime error: signed integer overflow: 9160456080802071500 - -4702111234474983746 cannot be represented in type 'long'
          #0 0xb645a4 in std::common_type<std::chrono::duration<long, std::ratio<1l, 1l> >, std::chrono::duration<long, std::ratio<1l, 1l> > >::type std::chrono::operator-<long, std::ratio<1l, 1l>, long, std::ratio<1l, 1l> >(std::chrono::duration<long, std::ratio<1l, 1l> > const&, std::chrono::duration<long, std::ratio<1l, 1l> > const&) /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/chrono:564:34
          #1 0x3883fe5 in magma::LSMTreeStats::Merge(magma::LSMTreeStats&) magma/magma/db_stats.cc:865:48
          #2 0x3b1622c in magma::KVStore::GetKVStoreStats() magma/magma/kvstore/stats.cc:47:14
          #3 0x3884c22 in magma::Magma::GetKVStoreStats(unsigned short) magma/magma/db_stats.cc:470:24
          #4 0x84efd7 in MagmaMemoryTrackingProxy::GetKVStoreStats(unsigned short) kv_engine/engines/ep/src/kvstore/magma-kvstore/magma-memory-tracking-proxy.cc:292:19
          #5 0x84eb98 in MagmaKVStore::getDbFileInfo(Vbid) kv_engine/engines/ep/src/kvstore/magma-kvstore/magma-kvstore.cc:3561:37
          #6 0xf0c1eb in EPBucket::getPerVBucketDiskStats(CookieIface const*, std::function<void (std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >, void const*)> const&)::DiskStatVisitor::visitBucket(VBucket&) kv_engine/engines/ep/src/ep_bucket.cc:1561:59
          #7 0xc57c79 in KVBucket::visit(VBucketVisitor&) kv_engine/engines/ep/src/kv_bucket.cc:2353:21
          #8 0xeea734 in EPBucket::getPerVBucketDiskStats(CookieIface const*, std::function<void (std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >, void const*)> const&) kv_engine/engines/ep/src/ep_bucket.cc:1598:5
          #9 0x31ca915 in KVBucketParamTest_VBucketDiskStatsENOENT_Test::TestBody() build/../kv_engine/engines/ep/tests/module_tests/kv_bucket_test.cc:1970:5
          #10 0x36d20d9 in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) googletest/googletest-prefix/src/googletest/googletest/src/gtest.cc:2607
          #11 0x36d20d9 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) googletest/googletest-prefix/src/googletest/googletest/src/gtest.cc:2643
          #12 0x36c6f1f in testing::Test::Run() (.part.647) googletest/googletest-prefix/src/googletest/googletest/src/gtest.cc:2682
          #13 0x36c7151 in testing::Test::Run() googletest/googletest-prefix/src/googletest/googletest/src/gtest.cc:2673
          #14 0x36c7151 in testing::TestInfo::Run() (.part.648) googletest/googletest-prefix/src/googletest/googletest/src/gtest.cc:2861
          #15 0x36c781e in testing::TestInfo::Run() googletest/googletest-prefix/src/googletest/googletest/src/gtest.cc:2834
          #16 0x36c781e in testing::TestSuite::Run() (.part.649) googletest/googletest-prefix/src/googletest/googletest/src/gtest.cc:3015
          #17 0x36c9024 in testing::TestSuite::Run() googletest/googletest-prefix/src/googletest/googletest/src/gtest.cc:3041
          #18 0x36c9024 in testing::internal::UnitTestImpl::RunAllTests() googletest/googletest-prefix/src/googletest/googletest/src/gtest.cc:5855
          #19 0x36d2589 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) googletest/googletest-prefix/src/googletest/googletest/src/gtest.cc:2607
          #20 0x36d2589 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) googletest/googletest-prefix/src/googletest/googletest/src/gtest.cc:2643
          #21 0x36c7251 in testing::UnitTest::Run() googletest/googletest-prefix/src/googletest/googletest/src/gtest.cc:5438
          #22 0x268f323 in main build/../kv_engine/engines/ep/tests/module_tests/ep_unit_tests_main.cc:172:16
          #23 0x7f233a83cc86 in __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:310
          #24 0x5ed5e9 in _start (build/kv_engine/ep-engine_ep_unit_tests+0x5ed5e9)
       
      SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /opt/gcc-10.2.0/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/chrono:564:34 in 
      

      Attachments

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

        Activity

          People

            apaar.gupta Apaar Gupta
            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