From ef43a7b596545602a8bfe47d7a2b27a8ab5516ae Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Thu, 16 Mar 2023 13:14:39 -0700 Subject: [PATCH] Use SOS to dump managed stack traces from a dump on Windows (#82867) --- eng/Versions.props | 2 ++ .../Coreclr.TestWrapper/CoreclrTestWrapperLib.cs | 7 +++++-- src/tests/Common/helixpublishwitharcade.proj | 10 ++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index d3eef3da279..2f5a874722f 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -183,6 +183,8 @@ $(MicrosoftBuildVersion) 6.2.2 6.2.2 + 7.0.412701 + 6.0 1.1.0 17.4.0-preview-20220707-01 diff --git a/src/tests/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs b/src/tests/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs index 7f11d0cf203..62eb196ce82 100644 --- a/src/tests/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs +++ b/src/tests/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs @@ -601,10 +601,13 @@ static bool TryPrintStackTraceFromDmp(string dmpFile, StreamWriter outputWriter) return false; } + string sosPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".dotnet", "sos", "sos.dll"); + var cdbScriptPath = Path.GetTempFileName(); - // TODO: Add SOS support once we can easily download SOS to install. - File.WriteAllText(cdbScriptPath, """ + File.WriteAllText(cdbScriptPath, $$""" + .load {{sosPath}} ~*k + !clrstack -f -all q """); diff --git a/src/tests/Common/helixpublishwitharcade.proj b/src/tests/Common/helixpublishwitharcade.proj index 247bd3c0179..1bacf4b9313 100644 --- a/src/tests/Common/helixpublishwitharcade.proj +++ b/src/tests/Common/helixpublishwitharcade.proj @@ -725,6 +725,10 @@ + + sos + https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/flat2/dotnet-sos/$(DotnetSosVersion)/dotnet-sos.$(DotnetSosVersion).nupkg + @@ -867,4 +871,10 @@ + + + + $(HelixPreCommands);dotnet %25HELIX_CORRELATION_PAYLOAD%25\sos\tools\net$(DotnetSosTargetFrameworkVersion)\any\dotnet-sos.dll install --architecture $(TargetArchitecture) + + -- GitLab