[SERVER-59856] Hang analyzer gdb script raises gdb.error Created: 09/Sep/21  Updated: 22/May/23

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Richard Samuels (Inactive) Assignee: Backlog - Service Architecture
Resolution: Unresolved Votes: 0
Labels: sa-remove-fv-backlog-22
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File debugger_mongod.log    
Issue Links:
Related
related to SERVER-60985 include WT_SESSION pointer in GDB pre... Closed
is related to SERVER-77355 GDB pretty printer must gracefully sk... Closed
is related to SERVER-71098 Create additional gdb tests Open
is related to SERVER-62074 Have gdb decorable pretty printers in... In Code Review
Assigned Teams:
Service Arch
Operating System: ALL
Participants:
Linked BF Score: 0
Story Points: 2

 Description   

When the hang analyzer is run on master, it raises the following error when the gdb scripts are run:

gdb.error: No type named std::unique_ptr<mongo::transport::(anonymous namespace)::Handle>.
Error occurred in Python: No type named std::unique_ptr<mongo::transport::(anonymous namespace)::Handle>.
Detaching from program: /data/mci/be35e53bd57ac9eb97a70660bb5a62a0/src/dist-test/bin/mongod, process 21266
[Inferior 1 (process 21266) detached]
Done logging to debugger_mongod_21266.log.

To avoid this error, perhaps a comment could be added to the C++ code to reference its use in the gdb python scripts



 Comments   
Comment by Max Hirschhorn [ 08/Apr/22 ]

The "gdb.error: No type named std::unique_ptr<mongo::transport::(anonymous namespace)::Handle>" error is caused by the change from ServiceContext::declareDecoration<Handle>() to ServiceContext::declareDecoration<std::unique_ptr<Handle>>() in e4df9de as part of SERVER-57445. This line is the problematic part of DecorablePrinter for how it gets the type name of the decoration.

Copying some notes I had put together elsewhere:

While gdb.Type.__str__() also consults the minimal symbol table, its formatting for the type name may prohibit resolving the underlying decoration type and seemingly cannot be configured. The result from `str(function)` would omit any default template arguments. Types such as std::unique_ptr<mongo::AuthorizationManager> must explicitly include std::default_delete<mongo::AuthorizationManager> as a second template argument to always be recognized by GDB.

https://github.com/visemet/gdb-mongodb-server/blob/v0.3.0/gdbmongo/decorable_printer.py#L97-L112

I believe schwerin may already have some plans to already address this GDB issue around decorations with default template arguments in SERVER-62074 (along with make some other nice enhancements).

Comment by Githook User [ 26/Oct/21 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-60985 SERVER-59856 gdb helper logs decoration type lookup error
Branch: master
https://github.com/mongodb/mongo/commit/09406264978c13ef748769e3f0a870ce85873e19

Comment by Blake Oler [ 14/Sep/21 ]

It looks like what’s going on is that gdb couldn’t find the type info for that type in the symbol table. gdb is trying to look up all the c++ decorations that exist on the ServiceContext, and when it attempts to look up the type info for Handle it fails.

This type has existed for a while, but the way it’s declared decorable has changed recently. Will triage at our next team meeting.

Generated at Thu Feb 08 05:48:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.