[SERVER-77355] GDB pretty printer must gracefully skip unknown decoration types Created: 22/May/23  Updated: 29/Oct/23  Resolved: 21/Jul/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Pierlauro Sciarelli Assignee: Billy Donahue
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-78390 Decorable subsystem refactoring Closed
Related
related to SERVER-59856 Hang analyzer gdb script raises gdb.e... Backlog
Assigned Teams:
Service Arch
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Service Arch 2023-07-24
Participants:

 Description   

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>.
 
    ...
  }, 



 Comments   
Comment by Billy Donahue [ 21/Jul/23 ]

fixed by SERVER-78390

Generated at Thu Feb 08 06:35:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.