Skip to content

Improve generated dump debugging instructions - #46493

Merged
danmoseley merged 11 commits into
dotnet:masterfrom
danmoseley:improvetemplate
Jan 5, 2021
Merged

danmoseley merged 11 commits into
dotnet:masterfrom
danmoseley:improvetemplate

Conversation

@danmoseley

@danmoseley danmoseley commented Jan 1, 2021 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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 mikem8361 and safern January 1, 2021 03:34
@danmoseley

Copy link
Copy Markdown
Contributor 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

ghost commented Jan 1, 2021

Copy link
Copy Markdown

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: -

Comment thread eng/testing/debug-dump-template.md Resolved
Comment thread eng/testing/debug-dump-template.md Resolved
Comment thread eng/testing/debug-dump-template.md Resolved
Comment thread eng/testing/debug-dump-template.md Resolved
Comment thread eng/testing/debug-dump-template.md Resolved
@dotnet dotnet deleted a comment from danmoseley Jan 3, 2021
you want to dump. For example:

```cmd
```bat

Copy link
Copy Markdown
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
Copy Markdown
Contributor 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

ghost commented Jan 4, 2021

Copy link
Copy Markdown

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.

Comment thread eng/testing/gen-debug-dump-docs.py Resolved
Comment thread eng/testing/gen-debug-dump-docs.py Resolved

@safern safern left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@danmoseley

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
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
Copy Markdown
Contributor 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
Copy Markdown
Contributor 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
Copy Markdown
Contributor 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
Copy Markdown
Contributor

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
Copy Markdown
Contributor 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.

Comment thread eng/testing/debug-dump-template.md Outdated
## If it's a macOS dump

## 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
Copy Markdown
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