Skip to content

The "setsymbolserver -ms" added to the .lldbinit by dotnet-sos fails #3032

Closed

Description

@mikem8361

Description

The "setsymbolserver -ms" added to the .lldbinit by dotnet-sos fails because the symbol service wrapper class needed by the C++ setsymbolserver command is per target and the target hasn't been created yet when the .lldbinit file is processed.

The fix is to port the setsymbolserver command to C# which will use the global ISymbolService remove the target dependency.

Configuration

Any Linux or MacOS under lldb installed with dotnet-sos.

Regression?

No. This bug has always been there.

Activity

  1. added
    bug
    on Apr 26, 2022
  2. added this to the .NET 7.0 milestone on Apr 26, 2022
  3. self-assigned this
    on Apr 26, 2022
  4. SharryXu commented on Apr 26, 2022

    @SharryXu

    Hi @mikem8361 ,

    Is this bug cause the "setsymbolserver -directory /directory/to/the/symbols" failed on latest Ubuntu 22.04 (lldb-11 or plus) too? BTW, are there any diagnostic logs about this command?

  5. mikem8361 commented on Apr 26, 2022

    @mikem8361
    ContributorAuthor

    This bug only affects the command if it is in your .lldbinit or executed before a target (live session, attach or core dump) is created. The version of lldb or Linux distro should not matter.

  6. SharryXu commented on Apr 26, 2022

    @SharryXu

    Hi @mikem8361 ,

    Thanks for your response. But whenever I try to run the setsymbolserver command in lldbinit or lldb and despite the parameter I use (-directory,-ms or others), I always get this message: setsymbolserver xxxx -failed
    Do you know where I can find some logs or more information about this?
    BTW, sos command like clrstack works fine. But because of symbol missing, a lot of functions cannot be recognized when using commands like "thread btrace".

    I am very appreciated if you can provide me some tips. 😁

  7. mikem8361 commented on Apr 26, 2022

    @mikem8361
    ContributorAuthor

    It doesn't matter what the parameter or option if you run it in .lldbinit it will error. You need to run it at the lldb command line prompt. FYI, thread btrace is a lldb command not an SOS command. The only command that my help is loadsymbols which attempts to download the .NET Core native symbol files. But you will have to run setsymbolserver -ms first.

  8. SharryXu commented on Apr 27, 2022

    @SharryXu

    Hi @mikem8361 ,

    Thanks for your response and I did run the command directly from the lldb command line prompt too and every times, the setsymbolserver command return to me "setsymbolserver xxxx -failed" (before/after) I attached to the process. BTW, the command "thread btrace" can print the unmanged code too and that is what I want but without the symbols, I cannot know the function names for those unmanged code. Do you know what's wrong?

  9. mikem8361 commented on Apr 27, 2022

    @mikem8361
    ContributorAuthor

    You can turn on logging with logging enable before running the setsymbolserver -ms command. I have no idea what is wrong.

    Do you have a .NET Core runtime installed? You need to have 3.1 or greater installed. dotnet --info will display something like:

    .NET SDK (reflecting any global.json):
     Version:   6.0.202
     Commit:    f8a55617d2
    
    Runtime Environment:
     OS Name:     ubuntu
     OS Version:  16.04
     OS Platform: Linux
     RID:         ubuntu.16.04-x64
     Base Path:   /usr/share/dotnet/sdk/6.0.202/
    
    Host (useful for support):
      Version: 6.0.4
      Commit:  be98e88c76
    
    .NET SDKs installed:
      3.1.418 [/usr/share/dotnet/sdk]
      6.0.202 [/usr/share/dotnet/sdk]
    
    .NET runtimes installed:
      Microsoft.AspNetCore.App 3.1.24 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
      Microsoft.AspNetCore.App 6.0.4 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
      Microsoft.NETCore.App 3.1.24 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
      Microsoft.NETCore.App 6.0.4 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
    
    To install additional .NET runtimes or SDKs:
      https://aka.ms/dotnet-download
    
  10. SharryXu commented on Apr 27, 2022

    @SharryXu

    Hi @mikem8361 ,

    Very appreciated for your support and I think I found the root cause. It was caused by not specifying the architecture when I installed the dotnet-sos tool. Anyway, thanks so much for all your messages! 👍

  11. added a commit that references this issue on May 6, 2022
  12. linked a pull request that will close this issuePort setsymbolserver command to C# #3050on May 10, 2022
  13. added a commit that references this issue on May 10, 2022
  14. added a commit that references this issue on May 24, 2022
  15. added a commit that references this issue on Jun 1, 2022
  16. 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

bugdotnet-sossos

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions