|
The constructor for ServerStatusSection calls a non-static method on the CmdServerStatus class. Depending on the order of construction of the different sections, this invocation may happen before CmdServerStatus has been constructed.
This was discovered through UBSAN:
src/mongo/db/commands/server_status.cpp:196:21: runtime error: member call on address 0x55555cfde1d8 which does not point to an object of type 'mongo::CmdServerStatus'
|
0x55555cfde1d8: note: object has invalid vptr
|
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
^~~~~~~~~~~~~~~~~~~~~~~
|
invalid vptr
|
Since CmdServerStatus::_sections is static it doesn't need to be accessed through a non-static function.
|