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

DcpProducer::addTakeoverStats warning: ‘this’ pointer is null [-Wnonnull]

    XMLWordPrintable

Details

    • Untriaged
    • 0
    • Unknown
    • KV 2023-4

    Description

      Spotted in a server build log

      15:35:03 /home/couchbase/jenkins/workspace/toy-unix-simple/kv_engine/engines/ep/src/dcp/producer.cc:1654:46: warning: ‘this’ pointer is null [-Wnonnull]
      15:35:03  1654 |                     stream->getStreamTypeName());
      

      And correct, we have code accessing a null pointer as part of a warning log message.

                  if (stream) {  
                      stream->addTakeoverStats(add_stat, c, vb);
                      return;
                  } 
      ... else stream is nullptr ...
                  logger->warn(
                          "({}) "
                          "DcpProducer::addTakeoverStats Stream type is {} and not "
                          "the expected Active",
                          vb.getId(),
                          stream->getStreamTypeName());  <----
      

      Attachments

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

        Activity

          People

            jwalker Jim Walker
            jwalker Jim Walker
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty