Skip to content

Commit

Permalink
Merge pull request #643 from mikem8361/release/stable
Browse files Browse the repository at this point in the history
Snapshot master for 3.1 stable build
  • Loading branch information
mikem8361 authored Nov 25, 2019
2 parents 0adfc03 + 5c1337d commit 75e9a0a
Show file tree
Hide file tree
Showing 161 changed files with 13,545 additions and 1,511 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,7 @@ StressLog.txt
*.etlx
*.netperf
*.nettrace
*.speedscope.json
*.csv
*.gcdump
*.binlog
2 changes: 1 addition & 1 deletion .vsts-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ jobs:
displayName: Publish Symbols
inputs:
filePath: eng\common\sdk-task.ps1
arguments: -task PublishToSymbolServers -restore -msbuildEngine dotnet -configuration Release -verbosity detailed
arguments: -task PublishToSymbolServers -restore -msbuildEngine dotnet -configuration Release -verbosity normal
/p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat)
/p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)
/p:PDBArtifactsDirectory='$(Build.SourcesDirectory)/artifacts/SymStore/**'
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ the build is simply a matter of invoking the 'build' script (`build.cmd` or `bui
repository.

The details of installing the components differ depending on the operating system. See the following
pages based on your OS. There is no cross-building across OS (only for ARM, which is built on X64).
pages based on your OS. There is no cross-building across OS (only for ARM, which is built on x64).
You have to be on the particular platform to build that platform.

To install the platform's prerequisites and build:
Expand Down Expand Up @@ -56,6 +56,14 @@ Getting a version of lldb that works for your platform can be a problem sometime

## New Features

The `bpmd` command can now be used before the runtime is loaded. You can load SOS or the sos plugin on Linux and execute bpmd. Always add the module extension for the first parameter.

bpmd SymbolTestApp.dll SymbolTestApp.Program.Main

You can set a source file/line number breakpoint like this (the fully qualified source file path is usually not necessary):

bpmd SymbolTestApp.cs:24

Symbol server support - The `setsymbolserver` command enables downloading the symbol files (portable PDBs) for managed assemblies during commands like `clrstack`, etc. See `soshelp setsymbolserver` for more details.

(lldb) setsymbolserver -ms
Expand Down
26 changes: 26 additions & 0 deletions THIRD-PARTY-NOTICES.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,29 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

License notice for code from Microsoft/PerfView:
-------------------------------------------------
The MIT License (MIT)

Copyright (c) .NET Foundation and Contributors

All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
606 changes: 606 additions & 0 deletions debuggees.sln

Large diffs are not rendered by default.

219 changes: 175 additions & 44 deletions diagnostics.sln

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion documentation/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Frequently Asked Questions

* If SOS or dotnet-dump analyze commands display "UNKNOWN" for types or functions names, your core dump may not have all the managed state. Dumps created with gdb or gcore have this problem. Linux system generated core dumps need the `coredump_filter` for the process to be set to at least 0x3f. See [core](http://man7.org/linux/man-pages/man5/core.5.html) for more information.

* If dump collection (`dotnet-dump collect` or `createdump`) doesn't work in a docker container, try adding the SYS\_TRACE capablity with --cap-add=SYS\_PTRACE or --privileged.
* If dump collection (`dotnet-dump collect` or `createdump`) doesn't work in a docker container, try adding the SYS\_TRACE capability with --cap-add=SYS\_PTRACE or --privileged.

* If dump analysis (`dotnet-dump analyze`) on Microsoft .NET Core SDK Linux docker images fails with an`Unhandled exception: System.DllNotFoundException: Unable to load shared library 'libdl.so' or one of its dependencies` exception. Try installing the "libc6-dev" package.

Expand Down
2 changes: 1 addition & 1 deletion documentation/building/official-build-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ WARNING: These instructions will only work internally at Microsoft.

To kick off an official build, go to this build definition: https://dev.azure.com/dnceng/internal/_build?definitionId=528.

This signs and publishes dotnet-dump, dotnet-sos, dotnet-trace, dotnet-counters and Microsoft.Diagnostic.TestHepers packages to https://dotnetfeed.blob.core.windows.net/dotnet-core feed.
This signs and publishes dotnet-dump, dotnet-sos, dotnet-trace, dotnet-counters and Microsoft.Diagnostic.TestHelpers packages to https://dotnetfeed.blob.core.windows.net/dotnet-core feed.

To release the latest tools:

Expand Down
25 changes: 21 additions & 4 deletions documentation/debugging-coredump.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,31 @@ Dumps created with gdb or gcore do not have all the managed state so various SOS

### Getting symbols ###

Because SOS now has symbol download support, this step can be skipped if the matching version of the "host" program is available on the machine loading the dump. Usually the host program is "dotnet" but each .NET Core SDK has a different version.
Because SOS now has symbol download support (both managed PDBs and native symbols via `loadsymbols`) all that lldb requires is the host program. The host is usually `dotnet` but for self-contained applications it the .NET Core `apphost` renamed to the program/project name. These steps will handle either case and download the host lldb needs to properly diagnose a core dump.

First install the dotnet CLI symbol tool. This only needs to be down once. See this [link](https://github.com/dotnet/symstore/tree/master/src/dotnet-symbol#install) for more details.
First install or update the dotnet CLI symbol tool. This only needs to be done once. See this [link](https://github.com/dotnet/symstore/tree/master/src/dotnet-symbol#install) for more details. We need version 1.0.52901 or greater of dotnet-symbol installed.

~$ dotnet tool install -g dotnet-symbol
You can invoke the tool using the following command: dotnet-symbol
Tool 'dotnet-symbol' (version '1.0.52901') was successfully installed.

Or update if already installed:

~$ dotnet tool update -g dotnet-symbol
Tool 'dotnet-symbol' was successfully updated from version '1.0.51501' to version '1.0.52901'.

Copy the core dump to a tmp directory.

~$ mkdir /tmp/dump
~$ cp ~/coredump.32232 /tmp/dump

Download the modules and symbols for the core dump:
Download the host program for the core dump:

~$ dotnet-symbol --host-only /tmp/dump/coredump.32232

If the `--host-only` option is not found, update dotnet-symbol to the latest with the above step.

~$ dotnet-symbol /tmp/dump/coredump.32232
If your project/program binaries are not on the machine the core dump is being loaded on, copy them to a temporary directory. You can use the lldb/SOS command `setsymbolserver -directory <temp-dir>` to add this directory to the search path.

### Install lldb ###

Expand All @@ -44,13 +55,19 @@ Add the directory with the core dump and symbols to the symbol search path:
Added symbol directory path: /tmp/dump
(lldb)

Optionally load the native symbols. The managed PDBs will be loaded on demand when needed:

(lldb) loadsymbols

Even if the core dump was not generated on this machine, the native and managed .NET Core symbols should be available along with all the SOS commands.

### Launch lldb under MacOS ###

~$ lldb --core /cores/core.32232 <host-program>
(lldb)

Follow the rest of the above Linux steps to set the symbol server and load native symbols.

The MacOS lldb has a bug that prevents SOS clrstack from properly working. Because of this bug SOS can't properly match the lldb native with with the managed thread OSID displayed by `clrthreads`. The `setsostid` command is a work around for this lldb bug. This command maps the OSID from this command:

```
Expand Down
Loading

0 comments on commit 75e9a0a

Please sign in to comment.