Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-77355

GDB pretty printer must gracefully skip unknown decoration types

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Service Arch
    • Fully Compatible
    • ALL
    • Service Arch 2023-07-24

      When finding an unknown decoration type while scanning through the service context's decorations, the GDB pretty printer halts printing and shows the "No type named" error.

      A possible way to solve this would be to add the equivalent try/except logic that is here in this point too.

      (Thanks max.hirschhorn@mongodb.com)

      Example from a recent core dump:

      (gdb) mongodb-service-context
      $1 = {
        <mongo::Decorable<mongo::ServiceContext>> = Decorable<mongo::ServiceContext> with 166 elems  = {
          [0:0xaaaaf1f23008:mongo::PeriodicThreadToAbortExpiredTransactions] = {
            _mutex = {
              <std::__mutex_base> = {
                _M_mutex = {
                  __data = {
                    __lock = 0,
                    __count = 0,
                    __owner = 0,
                    __nusers = 0,
                    __kind = 0,
                    __spins = 0,
                    __list = {
                      __prev = 0x0,
                      __next = 0x0
                    }
                  },
                  __size = '\000' <repeats 47 times>,
                  __align = 0
                }
              }, <No data fields>},
            _anchor = std::shared_ptr<mongo::PeriodicJobAnchor> (use count 2, weak count 0) = {
              get() = 0xaaaaf7274090
            }
          },
          [1:0xaaaaf1f23048:mongo::ClusterServerParameterInitializer] = {
            <mongo::ReplicaSetAwareService<mongo::ClusterServerParameterInitializer>> = {
              <mongo::ReplicaSetAwareInterface> = {
                _vptr.ReplicaSetAwareInterface = 0xaaaaede354b0 <vtable for mongo::ClusterServerParameterInitializer+16>
              }, <No data fields>}, <No data fields>},
          [2:0xaaaaf1f23050:mongo::DiskSpaceMonitor] = {
            _job = {
              _handle = std::shared_ptr<mongo::PeriodicRunner::ControllableJob> (empty) = {
                get() = 0x0
              }
            },
            _mutex = {
              <std::__mutex_base> = {
                _M_mutex = {
                  __data = {
                    __lock = 0,
                    __count = 0,
                    __owner = 0,
                    __nusers = 0,
                    __kind = 0,
                    __spins = 0,
                    __list = {
                      __prev = 0x0,
                      __next = 0x0
                    }
                  },
                  __size = '\000' <repeats 47 times>,
                  __align = 0
                }
              }, <No data fields>},
            _actions = std::vector of length 1, capacity 1 = {std::unique_ptr<mongo::DiskSpaceMonitor::Action> = {
                get() = 0xaaaaf1fe9980
              }}
          }Traceback (most recent call last):
        File "buildscripts/gdb/mongo_printers.py", line 356, in children
          type_t = gdb.lookup_type(type_name)
      gdb.error: No type named std::unique_ptr<mongo::(anonymous namespace)::ChangeStreamExpiredPreImagesRemover>.
      
          ...
        }, 
      

            Assignee:
            billy.donahue@mongodb.com Billy Donahue
            Reporter:
            pierlauro.sciarelli@mongodb.com Pierlauro Sciarelli
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: