Skip to content

Re-evaluate what SOS commands are supported on Linux/OS X #3169

Closed

Description

@leculver

There are a surprising number of commands that are only supported on Windows when (presumably) their implementation should be usable on Linux and OS X.

Here's a list of useful commands that are scoped to Windows, when they would be useful regardless of the platform:

  • DumpSig
  • DumpSigElem
  • DumpRuntimeTypes
  • VerifyHeap
  • AnalyzeOOM
  • VerifyObj
  • ListNearObj
  • GCHeapStat
  • ThreadPool - maybe this is desktop clr only?
  • EHInfo
  • GCInfo
  • FindRoots
  • ObjSize

I didn't deeply inspect why each of these methods are disallowed, some are probably not useful in .Net Core anymore (like !ThreadPool maybe?). However, some of these commands are actually very important. !gcinfo, !verifyheap, !objsize, !verifyobj are all commands I use regularly on windows.

This was reported by a partner team.

Edit: I forgot to mention, the scenario here is debugging Linux coredumps in WinDbg. It would be nice if all of these worked in lldb if possible as well, but specifically here we need to unblock commands that will work in windbg.

Activity

  1. added
    enhancement
    on Jul 6, 2022
  2. self-assigned this
    on Jul 6, 2022
  3. mikem8361 commented on Jul 6, 2022

    @mikem8361
    Contributor

    DumpSig, DumpSigElem, DumpRuntimeTypes, VerifyHeap are all available under lldb if you prefix the command with "sos ". Will add the needed lldb command alias so they can be invoked directly. They are not available under dotnet-dump analyze. Will fix that too.

    ThreadPool is already available everywhere. Under lldb/dotnet-dump it is lowercased as "threadpool". FYI, !thtreadpool (lower case) will also work under windbg. Most of the commands now under windbg have all lower case aliases to match lldb/dotnet-dump.

    The rest will take some work to enable.

  4. leculver commented on Jul 7, 2022

    @leculver
    ContributorAuthor

    ThreadPool doesn't seem to work. I was going by this line, which disables it on linux dumps:

    https://github.com/dotnet/diagnostics/blob/main/src/SOS/Strike/strike.cpp#L8028

    For example, loading a linux coredump with SOS and running !threadpool produces:

    0:000> !threadpool
    This command is only supported for Windows targets
  5. leculver commented on Jul 7, 2022

    @leculver
    ContributorAuthor

    Similar for the other commands you list, DumpSig, DumpSigElem, DumpRuntimeTypes:

    0:000> !verifyheap
    This command is only supported for Windows targets

    The scenario being reported here is WinDbg debugging linux coredumps.

  6. mikem8361 commented on Jul 7, 2022

    @mikem8361
    Contributor
  7. linked a pull request that will close this issueEnable more SOS commands for Linux/MacOS #3233on Jul 28, 2022
  8. added a commit that references this issue on Sep 21, 2022
  9. ghost locked as resolved and limited conversation to collaborators on Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions