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

[RocksDB] Call to 'std::stoi()' in 'RocksDBKVStore::getStatFromProperties()' throws 'std::out_of_range'

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • master
    • master
    • couchbase-bucket
    • None
    • Untriaged
    • Unknown

    Description

      From core-dumps at http://perf.jenkins.couchbase.com/job/hera-pl/13 :

      (gdb) bt
      #0  0x00007f5729ee91d7 in raise () from /usr/lib64/libc-2.17.so
      #1  0x00007f5729eea8c8 in abort () from /usr/lib64/libc-2.17.so
      #2  0x00007f572a7edac5 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib64/libstdc++.so.6.0.19
      #3  0x000000000043beca in backtrace_terminate_handler () at /home/couchbase/jenkins/workspace/couchbase-server-unix/kv_engine/utilities/terminate_handler.cc:103
      #4  0x00007f572a7eba36 in ?? () from /usr/lib64/libstdc++.so.6.0.19
      #5  0x00007f572a7eba63 in std::terminate() () from /usr/lib64/libstdc++.so.6.0.19
      #6  0x00007f572a7ebc83 in __cxa_throw () from /usr/lib64/libstdc++.so.6.0.19
      #7  0x00007f572a840a97 in std::__throw_out_of_range(char const*) () from /usr/lib64/libstdc++.so.6.0.19
      #8  0x00007f5725b61464 in __stoa<long, int, char, int> (__convf=<optimized out>, __name=0x7f5725b896ff "stoi", __idx=0x0, __str=0x7f54c6386fa8 <Address 0x7f54c6386fa8 out of bounds>) at /usr/include/c++/4.8.2/ext/string_conversions.h:70
      #9  stoi (__base=10, __idx=0x0, __str=<error reading variable: Cannot access memory at address 0x7f54c6386f90>) at /usr/include/c++/4.8.2/bits/basic_string.h:2825
      #10 RocksDBKVStore::getStatFromProperties (this=this@entry=0x7f569bff5c00, cf=cf@entry=RocksDBKVStore::Default, property=<error reading variable: Cannot access memory at address 0xffffffffffffffe8>, value=@0x7f54d2fec650: 140012354615536)
          at /home/couchbase/jenkins/workspace/couchbase-server-unix/kv_engine/engines/ep/src/rocksdb-kvstore/rocksdb-kvstore.cc:1457
      #11 0x00007f5725b665d6 in RocksDBKVStore::getStat (this=0x7f569bff5c00, name_=<optimized out>, value=@0x7f54d2fec650: 140012354615536) at /home/couchbase/jenkins/workspace/couchbase-server-unix/kv_engine/engines/ep/src/rocksdb-kvstore/rocksdb-kvstore.cc:690
      #12 0x00007f5725ae7b0a in KVBucket::getKVStoreStat (this=<optimized out>, name=0x7f5725b8a37c "default_kTotalSstFilesSize", value=@0x7f54d2fec6c0: 0, option=<optimized out>) at /home/couchbase/jenkins/workspace/couchbase-server-unix/kv_engine/engines/ep/src/kv_bucket.cc:2205
      #13 0x00007f5725aa2407 in EventuallyPersistentEngine::doEngineStats (this=0x7f569bff5000, cookie=0x7f54d2ffc950, add_stat=0x7f5725af1880 <add_stat(char const*, uint16_t, char const*, uint32_t, gsl::not_null<void const*>)>)
          at /home/couchbase/jenkins/workspace/couchbase-server-unix/kv_engine/engines/ep/src/ep_engine.cc:2828
      #14 0x00007f5725aa9f90 in EventuallyPersistentEngine::getStats (this=0x7f569bff5000, this@entry=<error reading variable: Cannot access memory at address 0x7f54d2ffc8e8>, cookie=0x7f54d2ffc950, stat_key=0x0, nkey=0, 
          add_stat=0x7f5725af1880 <add_stat(char const*, uint16_t, char const*, uint32_t, gsl::not_null<void const*>)>) at /home/couchbase/jenkins/workspace/couchbase-server-unix/kv_engine/engines/ep/src/ep_engine.cc:3741
      

      The following call to 'std::stoi()' in 'RocksDBKVStore::getStatFromProperties()' throws 'std::out_of_range' if the converted value falls out of the range of the result type:

      std::string out;
      if (!db->rdb->GetProperty(cfh, property, &out)) {
          return false;
      }
      value += std::stoi(out);
      

      Attachments

        Issue Links

          For Gerrit Dashboard: MB-27224
          # Subject Branch Project Status CR V

          Activity

            People

              paolo.cocchi Paolo Cocchi
              paolo.cocchi Paolo Cocchi
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty