Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve generated dump debugging instructions #46493

Merged
merged 11 commits into from
Jan 5, 2021

Conversation

danmoseley
Copy link
Member

@danmoseley danmoseley commented Jan 1, 2021

In the process of debugging a test crash, I used the new instructions and workflow -- which was great!

I have tried to improve the instructions more

  • Clean up formatting/clarify text
  • Improve the generation script to add the output path to the commands, so they can just be copy/pasted
  • Add steps to extract the files as well
  • Ensure tools are updated

The only commands that can't be copied/pasted are where you need to type in the path to the dump you downloaded: as things are, the generator script doesn't know where the dumps will go, unfortunately.

Example of new output: https://gist.github.com/danmosemsft/81023ec112f3c6d4db0e75a7b8a3b56a .. hopefully much quicker and easier to use. (@mikem8361 maybe you can scan it)

I have tested the Windows steps. I need to find a Linux dump to test those instructions.

@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@danmoseley danmoseley requested review from safern and mikem8361 January 1, 2021 03:34
@danmoseley
Copy link
Member Author

These instructions assume that binaries and symbols are all in <outdir>\shared\Microsoft.NETCore.App\6.0.0. That is the case at least for dotnet/runtime jobs (or at least libraries ones?). To genericise this for other repos in future, we will need to add another parameter or step.

@ghost
Copy link

ghost commented Jan 1, 2021

Tagging subscribers to this area: @ViktorHofer
See info in area-owners.md if you want to be subscribed.

Issue Details

In the process of debugging a test crash, I used the new instructions and workflow -- which was great!

I have tried to improve the instructions more

  • Clean up formatting/clarify text
  • Improve the generation script to add the output path to the commands, so they can just be copy/pasted
  • Add steps to extract the files as well
  • Ensure tools are updated

The only commands that can't be copied/pasted are where you need to type in the path to the dump you downloaded: as things are, the generator script doesn't know where the dumps will go, unfortunately.

Example of new output: https://gist.github.com/danmosemsft/81023ec112f3c6d4db0e75a7b8a3b56a .. hopefully much quicker and easier to use. (@mikem8361 maybe you can scan it)

I have tested the Windows steps. I need to find a Linux dump to test those instructions.

Author: danmosemsft
Assignees: -
Labels:

area-Infrastructure

Milestone: -

danmoseley and others added 4 commits December 31, 2020 22:34
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
@dotnet dotnet deleted a comment from danmoseley Jan 3, 2021
@@ -759,7 +759,7 @@ phase-specific information by searching for the phase name. Some useful points f
You can enable dumps by setting the `COMPlus_JitDump` environment variable to a space-separated list of the method(s)
you want to dump. For example:

```cmd
```bat
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI both cmd and bat are correct. this change is not needed.

:: with ```cmd

setx FOO=BAR
echo %FOO%

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fine I'll make them cmd consistently.

@ghost
Copy link

ghost commented Jan 4, 2021

Hello @danmosemsft!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

Copy link
Member

@safern safern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@danmoseley
Copy link
Member Author

```
If prompted, open a new command prompt to pick up the updated PATH.
```sh
dotnet sos install --architecture Arm
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last one will override the others, at least on Linux (not sure about windows, haven't seen if it is conditional on the bitness of the extension host, but given the errors I've seen I'd say no). Users should only install the one they are going to use.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh - I didn't notice that because I was testing with x64, which is last!

Could we imagine installing them all, and picking the right one - eliminate another decision point? cc @mikem8361

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix the text meantime

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like it defaults silently to the bitness of the dotnet.exe you're running it with (?)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it does default to the architecture of the dotnet.exe you are running (the most common case).

As far as installing all the of the architectures, there would have to be a rid named subdirectory to separate them so the decision point would be postponed a little to the .load command in windbg.

This manual dotnet-sos install/load on Windows was really meant as a fallback while we wait for the public debugger to include SOS (all architectures) like the internal one does now. The internal Windows debugger automatically loads the correct architecture and latest version of SOS from the extension gallery.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh perfect then it will go away.


## MacOS dumps
Instructions for debugging dumps on macOS are essentially the same as [Linux](#If-it's-a-Linux-dump-on-Linux...) with one exception: `dotnet-dump` cannot analyze macOS system dumps: you must use `lldb` for those. `dotnet-dump` can only analyze dumps created by `dotnet-dump` or `createdump` or by the runtime on hangs.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Instructions for debugging dumps on macOS are essentially the same as [Linux](#If-it's-a-Linux-dump-on-Linux...) with one exception: `dotnet-dump` cannot analyze macOS system dumps: you must use `lldb` for those. `dotnet-dump` can only analyze dumps created by `dotnet-dump` or `createdump` or by the runtime on hangs.
Instructions for debugging dumps on macOS are essentially the same as [Linux](#If-it's-a-Linux-dump-on-Linux...) with one exception: `dotnet-dump` cannot analyze macOS system dumps: you must use `lldb` for those. `dotnet-dump` can only analyze dumps created by `dotnet-dump` or `createdump`, by the runtime on crashes when the appropriate environment variables are set, or the [`blame-hang` setting of `dotnet test`](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test).

@danmoseley danmoseley merged commit d4d50db into dotnet:master Jan 5, 2021
@danmoseley danmoseley deleted the improvetemplate branch January 5, 2021 15:57
@ghost ghost locked as resolved and limited conversation to collaborators Feb 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants