The !object command is very slow

Hey :slight_smile:

I have a problem with the !object command - it runs very slow when I’m debugging the kernel with windbg.
The listing and entry finding process is slow. If I try to use the command with a specific object address it works fine. (unless it’s a directory object)
It eventually finds and displays the object but it takes 1 second to process one object directory entry.

For example:

"!object " - 1 second for each entry in the list.
“!object \PendingRenameMutex” - PendingRenameMutex is the first entry in the directory '', so it takes 1 second to find the entry and another second to display it’s information - a total of 2 seconds.
“!object \Driver” - This entry is one of the last entries in the directory - so it takes it 1 second for each entry before this entry - ~30 seconds to find “\Driver” than it takes 1 second for each entry in \Driver.

Thank you for your help!

kd> version
Windows 10 Kernel Version 17763 MP (1 procs) Free x64
Product: WinNt, suite: TerminalServer SingleUserTS
Built by: 17763.1.amd64fre.rs5_release.180914-1434
Machine Name:
Kernel base = 0xfffff807`2401e000 PsLoadedModuleList = 0xfffff807`24439610
Debug session time: Mon Oct 21 14:08:26.367 2019 (UTC + 3:00)
System Uptime: 0 days 0:03:53.135
Remote KD: KdSrv:Server=@{<Local>},Trans=@{COM:Port=\\.\pipe\kd_Windows_10_x64,Baud=19200,Pipe,Timeout=4000}

Microsoft (R) Windows Debugger Version 10.0.18362.1 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.

command line: '"C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\windbg.exe" -b -k com:pipe,resets=0,reconnect,port=\\.\pipe\kd_Windows_10_x64'  Debugger Process 0x744 
dbgeng:  image 10.0.18362.1, 
        [path: C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\dbgeng.dll]
dbghelp: image 10.0.18362.1, 
        [path: C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\dbghelp.dll]
        DIA version: 26213
Extension DLL search Path:
    <removed>
Extension DLL chain:
    dbghelp: image 10.0.18362.1, API 10.0.6, 
        [path: C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\dbghelp.dll]
    ext: image 10.0.18362.1, API 1.0.0, 
        [path: C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\winext\ext.dll]
    exts: image 10.0.18362.1, API 1.0.0, 
        [path: C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\WINXP\exts.dll]
    kext: image 10.0.18362.1, API 1.0.0, 
        [path: C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\winext\kext.dll]
    kdexts: image 10.0.18362.1, API 1.0.0, 
        [path: C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\WINXP\kdexts.dll]

For whatever reason this command has always been very slow and it’s made worse by a slow KD connection. Using VirtualKD or network debugging instead of a virtual COM port will help, but even then don’t expect it to be particularly quick. For example, I’m using VirtualKD and it still took 28 seconds to run !object \Driver.

If you frequently need your driver object address I recommend putting it in a global variable in your driver so you can easily grab it while debugging (e.g. dt mydrv!MyDriverObject).

1 Like

You can try !ms_object command from SwishDbgExt WinDBG plugin (https://github.com/comaeio/SwishDbgExt/releases). In some cases that command gives fast results.
And you can add issue to WinDBG Preview (https://github.com/microsoftfeedback/WinDbg-Feedback/issues). It will be good, if Microsoft can fix this problem in release build.

Use !dbgkit.ob (Andrey Bazhan - Web Solutions Tailored to your needs) command to quickly get, search and display objects in Object Manager’s namespace. If you will use network debugging, it’ll only take a few seconds.

Thank you, it works great! :smiley: