From 5384225f8a09136cdb9526de8db6217453964594 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 10 Oct 2024 14:08:20 +0000 Subject: [PATCH 01/36] [main] Update dependencies from dotnet/aspnetcore (#4991) [main] Update dependencies from dotnet/aspnetcore --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index b756a6c5e5..77e3b46d4f 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -32,13 +32,13 @@ https://github.com/dotnet/sdk 6a7f86a90566a15439ae0332f17e50cf34c21c3a - + https://github.com/dotnet/aspnetcore - 9f57b1ed7a4adab022ec5d227723f23862aad0e3 + 5a4c466e076e8c55227068786d14d5b8b7750be8 - + https://github.com/dotnet/aspnetcore - 9f57b1ed7a4adab022ec5d227723f23862aad0e3 + 5a4c466e076e8c55227068786d14d5b8b7750be8 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 85efa375d1..d9584c46ab 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -19,8 +19,8 @@ 9.0.0-rtm.24508.17 9.0.0-rtm.24508.17 - 9.0.0-rtm.24508.22 - 9.0.0-rtm.24508.22 + 9.0.0-rtm.24509.6 + 9.0.0-rtm.24509.6 9.0.100-rc.1.24409.1 From 393936e750e768b001917b66d7dccd5a89377bb8 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 10 Oct 2024 18:38:01 +0000 Subject: [PATCH 02/36] [main] Update dependencies from dotnet/arcade (#4992) [main] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 12 ++--- eng/Versions.props | 2 +- eng/common/core-templates/job/job.yml | 54 ++++--------------- .../steps/cleanup-microbuild.yml | 28 ++++++++++ .../steps/install-microbuild.yml | 43 +++++++++++++++ global.json | 4 +- 6 files changed, 89 insertions(+), 54 deletions(-) create mode 100644 eng/common/core-templates/steps/cleanup-microbuild.yml create mode 100644 eng/common/core-templates/steps/install-microbuild.yml diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 77e3b46d4f..c8649c5237 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -10,19 +10,19 @@ - + https://github.com/dotnet/arcade - f209a925b15bc66ecb9a8825bd9595937bbe3aa1 + 380002a14775d7f68f098c7e6b7d1c3638bd4c5d - + https://github.com/dotnet/arcade - f209a925b15bc66ecb9a8825bd9595937bbe3aa1 + 380002a14775d7f68f098c7e6b7d1c3638bd4c5d - + https://github.com/dotnet/arcade - f209a925b15bc66ecb9a8825bd9595937bbe3aa1 + 380002a14775d7f68f098c7e6b7d1c3638bd4c5d https://github.com/dotnet/arcade diff --git a/eng/Versions.props b/eng/Versions.props index d9584c46ab..d8a98c3651 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -55,7 +55,7 @@ 8.0.0 8.0.5 2.0.3 - 10.0.0-beta.24504.4 + 10.0.0-beta.24510.1 1.2.0-beta.406 7.0.0-beta.22316.2 10.0.26100.1 diff --git a/eng/common/core-templates/job/job.yml b/eng/common/core-templates/job/job.yml index c37d16634d..295c9a2317 100644 --- a/eng/common/core-templates/job/job.yml +++ b/eng/common/core-templates/job/job.yml @@ -128,33 +128,11 @@ jobs: - ${{ preStep }} - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - ${{ if eq(parameters.enableMicrobuild, 'true') }}: - - task: MicroBuildSigningPlugin@4 - displayName: Install MicroBuild plugin - inputs: - signType: $(_SignType) - zipSources: false - feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json - ${{ if and(eq(parameters.enableMicrobuildForMacAndLinux, 'true'), ne(variables['Agent.Os'], 'Windows_NT')) }}: - azureSubscription: 'MicroBuild Signing Task (DevDiv)' - env: - TeamName: $(_TeamName) - MicroBuildOutputFolderOverride: '$(Agent.TempDirectory)' - SYSTEM_ACCESSTOKEN: $(System.AccessToken) + - template: /eng/common/core-templates/steps/install-microbuild.yml + parameters: + enableMicrobuild: ${{ parameters.enableMicrobuild }} + enableMicrobuildForMacAndLinux: ${{ parameters.enableMicrobuildForMacAndLinux }} continueOnError: ${{ parameters.continueOnError }} - condition: and( - succeeded(), - or( - and( - eq(variables['Agent.Os'], 'Windows_NT'), - in(variables['_SignType'], 'real', 'test') - ), - and( - ${{ eq(parameters.enableMicrobuildForMacAndLinux, true) }}, - ne(variables['Agent.Os'], 'Windows_NT'), - eq(variables['_SignType'], 'real') - ) - )) - ${{ if and(eq(parameters.runAsPublic, 'false'), eq(variables['System.TeamProject'], 'internal')) }}: - task: NuGetAuthenticate@1 @@ -183,26 +161,12 @@ jobs: - ${{ each step in parameters.componentGovernanceSteps }}: - ${{ step }} - - ${{ if eq(parameters.enableMicrobuild, 'true') }}: - - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - task: MicroBuildCleanup@1 - displayName: Execute Microbuild cleanup tasks - condition: and( - always(), - or( - and( - eq(variables['Agent.Os'], 'Windows_NT'), - in(variables['_SignType'], 'real', 'test') - ), - and( - ${{ eq(parameters.enableMicrobuildForMacAndLinux, true) }}, - ne(variables['Agent.Os'], 'Windows_NT'), - eq(variables['_SignType'], 'real') - ) - )) + - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + - template: /eng/common/core-templates/steps/cleanup-microbuild.yml + parameters: + enableMicrobuild: ${{ parameters.enableMicrobuild }} + enableMicrobuildForMacAndLinux: ${{ parameters.enableMicrobuildForMacAndLinux }} continueOnError: ${{ parameters.continueOnError }} - env: - TeamName: $(_TeamName) # Publish test results - ${{ if or(and(eq(parameters.enablePublishTestResults, 'true'), eq(parameters.testResultsFormat, '')), eq(parameters.testResultsFormat, 'xunit')) }}: diff --git a/eng/common/core-templates/steps/cleanup-microbuild.yml b/eng/common/core-templates/steps/cleanup-microbuild.yml new file mode 100644 index 0000000000..c0fdcd3379 --- /dev/null +++ b/eng/common/core-templates/steps/cleanup-microbuild.yml @@ -0,0 +1,28 @@ +parameters: + # Enable cleanup tasks for MicroBuild + enableMicrobuild: false + # Enable cleanup tasks for MicroBuild on Mac and Linux + # Will be ignored if 'enableMicrobuild' is false or 'Agent.Os' is 'Windows_NT' + enableMicrobuildForMacAndLinux: false + continueOnError: false + +steps: + - ${{ if eq(parameters.enableMicrobuild, 'true') }}: + - task: MicroBuildCleanup@1 + displayName: Execute Microbuild cleanup tasks + condition: and( + always(), + or( + and( + eq(variables['Agent.Os'], 'Windows_NT'), + in(variables['_SignType'], 'real', 'test') + ), + and( + ${{ eq(parameters.enableMicrobuildForMacAndLinux, true) }}, + ne(variables['Agent.Os'], 'Windows_NT'), + eq(variables['_SignType'], 'real') + ) + )) + continueOnError: ${{ parameters.continueOnError }} + env: + TeamName: $(_TeamName) diff --git a/eng/common/core-templates/steps/install-microbuild.yml b/eng/common/core-templates/steps/install-microbuild.yml new file mode 100644 index 0000000000..9abe726e54 --- /dev/null +++ b/eng/common/core-templates/steps/install-microbuild.yml @@ -0,0 +1,43 @@ +parameters: + # Enable cleanup tasks for MicroBuild + enableMicrobuild: false + # Enable cleanup tasks for MicroBuild on Mac and Linux + # Will be ignored if 'enableMicrobuild' is false or 'Agent.Os' is 'Windows_NT' + enableMicrobuildForMacAndLinux: false + continueOnError: false + +steps: + - ${{ if eq(parameters.enableMicrobuild, 'true') }}: + # Remove Python downgrade with https://github.com/dotnet/arcade/issues/15151 + - ${{ if and(eq(parameters.enableMicrobuildForMacAndLinux, 'true'), ne(variables['Agent.Os'], 'Windows_NT')) }}: + - task: UsePythonVersion@0 + displayName: 'Use Python 3.11.x' + inputs: + versionSpec: '3.11.x' + + - task: MicroBuildSigningPlugin@4 + displayName: Install MicroBuild plugin + inputs: + signType: $(_SignType) + zipSources: false + feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json + ${{ if and(eq(parameters.enableMicrobuildForMacAndLinux, 'true'), ne(variables['Agent.Os'], 'Windows_NT')) }}: + azureSubscription: 'MicroBuild Signing Task (DevDiv)' + env: + TeamName: $(_TeamName) + MicroBuildOutputFolderOverride: '$(Agent.TempDirectory)' + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + continueOnError: ${{ parameters.continueOnError }} + condition: and( + succeeded(), + or( + and( + eq(variables['Agent.Os'], 'Windows_NT'), + in(variables['_SignType'], 'real', 'test') + ), + and( + ${{ eq(parameters.enableMicrobuildForMacAndLinux, true) }}, + ne(variables['Agent.Os'], 'Windows_NT'), + eq(variables['_SignType'], 'real') + ) + )) diff --git a/global.json b/global.json index c1f99d9127..b821921227 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "tools": { - "dotnet": "9.0.100-rc.1.24452.12", + "dotnet": "9.0.100-rc.2.24474.11", "runtimes": { "dotnet": [ "$(MicrosoftNETCoreApp60Version)", @@ -14,6 +14,6 @@ }, "msbuild-sdks": { "Microsoft.Build.NoTargets": "3.5.0", - "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.24504.4" + "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.24510.1" } } From 8f27b61e3307fa4e3f0ab440ef97a765b0bcaa83 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 13:55:29 +0000 Subject: [PATCH 03/36] [main] Update dependencies from dotnet/source-build-reference-packages (#4994) [main] Update dependencies from dotnet/source-build-reference-packages --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index c8649c5237..7d7469bdea 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -49,9 +49,9 @@ 24cfc7cc9dabdbe8607a3bf81ffbedf7e2cbb97f - + https://github.com/dotnet/source-build-reference-packages - fd609e3b427601180d23633e2f1a4cdac6c42c20 + 8f20d0d678ac2817ad1d7e3830479829c2db31d0 diff --git a/eng/Versions.props b/eng/Versions.props index d8a98c3651..588f0c9dbf 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -60,7 +60,7 @@ 7.0.0-beta.22316.2 10.0.26100.1 13.0.1 - 10.0.0-alpha.1.24507.1 + 10.0.0-alpha.1.24510.2 diff --git a/eng/Versions.props b/eng/Versions.props index 588f0c9dbf..a6c786b5bf 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -16,8 +16,8 @@ - 9.0.0-rtm.24508.17 - 9.0.0-rtm.24508.17 + 9.0.0-rtm.24510.3 + 9.0.0-rtm.24510.3 9.0.0-rtm.24509.6 9.0.0-rtm.24509.6 From b86d096c33ecbeb7d76f47da2f8e1b1716cd9108 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 12 Oct 2024 13:47:45 +0000 Subject: [PATCH 05/36] [main] Update dependencies from dotnet/source-build-reference-packages (#4997) [main] Update dependencies from dotnet/source-build-reference-packages --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 0152af10fc..ae60c6021e 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -49,9 +49,9 @@ 226c0347b92c4f9649bcc7ad580f74cb0409580e - + https://github.com/dotnet/source-build-reference-packages - 8f20d0d678ac2817ad1d7e3830479829c2db31d0 + 76c417253f5b3890997a3ef4b0613c2eab73d156 diff --git a/eng/Versions.props b/eng/Versions.props index a6c786b5bf..471598e461 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -60,7 +60,7 @@ 7.0.0-beta.22316.2 10.0.26100.1 13.0.1 - 10.0.0-alpha.1.24510.2 + 10.0.0-alpha.1.24511.4 - 9.0.0-rtm.24509.6 - 9.0.0-rtm.24509.6 + 9.0.0-rtm.24511.11 + 9.0.0-rtm.24511.11 9.0.100-rc.1.24409.1 From 4254eaf4f250a6c3aeef911d87c4979bc28d2ec8 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 12 Oct 2024 13:52:29 +0000 Subject: [PATCH 07/36] [main] Update dependencies from dotnet/runtime (#4999) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index d89f14143f..b7c467afde 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -40,13 +40,13 @@ https://github.com/dotnet/aspnetcore 00eeceef992c85130b5137ceaba8b54c172b432d - + https://github.com/dotnet/runtime - 226c0347b92c4f9649bcc7ad580f74cb0409580e + b030c4dfdfa1bf287f10f96006619a06bc2000ae - + https://github.com/dotnet/runtime - 226c0347b92c4f9649bcc7ad580f74cb0409580e + b030c4dfdfa1bf287f10f96006619a06bc2000ae diff --git a/eng/Versions.props b/eng/Versions.props index af6e5d122a..05f034f26f 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -16,8 +16,8 @@ - 9.0.0-rtm.24510.3 - 9.0.0-rtm.24510.3 + 9.0.0-rtm.24511.16 + 9.0.0-rtm.24511.16 9.0.0-rtm.24511.11 9.0.0-rtm.24511.11 From b675b21fae756aa414c2d580b9c0b01e3f2459aa Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 13:24:42 +0000 Subject: [PATCH 08/36] [main] Update dependencies from dotnet/sdk (#5001) [main] Update dependencies from dotnet/sdk --- eng/Version.Details.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index b7c467afde..1f197427b8 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -28,9 +28,9 @@ https://github.com/dotnet/arcade ccfe6da198c5f05534863bbb1bff66e830e0c6ab - + https://github.com/dotnet/sdk - 6a7f86a90566a15439ae0332f17e50cf34c21c3a + 5b9d9d4677ea31d954533e9de2f95a3ea638135d https://github.com/dotnet/aspnetcore From 4a5a10d64fe94882a703450fd1c67f3c28db39ed Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 13:28:18 +0000 Subject: [PATCH 09/36] [main] Update dependencies from dotnet/arcade (#5000) [main] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 2 +- eng/common/build.sh | 1 - eng/common/core-templates/steps/source-build.yml | 1 - global.json | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 1f197427b8..8ad185e332 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -10,19 +10,19 @@ - + https://github.com/dotnet/arcade - 380002a14775d7f68f098c7e6b7d1c3638bd4c5d + 712dea25b14a59fe642f2d28e8a3f3c931c03759 - + https://github.com/dotnet/arcade - 380002a14775d7f68f098c7e6b7d1c3638bd4c5d + 712dea25b14a59fe642f2d28e8a3f3c931c03759 - + https://github.com/dotnet/arcade - 380002a14775d7f68f098c7e6b7d1c3638bd4c5d + 712dea25b14a59fe642f2d28e8a3f3c931c03759 https://github.com/dotnet/arcade diff --git a/eng/Versions.props b/eng/Versions.props index 05f034f26f..d64d0f4501 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -55,7 +55,7 @@ 8.0.0 8.0.5 2.0.3 - 10.0.0-beta.24510.1 + 10.0.0-beta.24511.1 1.2.0-beta.406 7.0.0-beta.22316.2 10.0.26100.1 diff --git a/eng/common/build.sh b/eng/common/build.sh index ac1ee8620c..483647daf1 100755 --- a/eng/common/build.sh +++ b/eng/common/build.sh @@ -231,7 +231,6 @@ function Build { /p:Restore=$restore \ /p:Build=$build \ /p:DotNetBuildRepo=$product_build \ - /p:ArcadeBuildFromSource=$source_build \ /p:DotNetBuildSourceOnly=$source_build \ /p:Rebuild=$rebuild \ /p:Test=$test \ diff --git a/eng/common/core-templates/steps/source-build.yml b/eng/common/core-templates/steps/source-build.yml index 2915d29bb7..c9271c0115 100644 --- a/eng/common/core-templates/steps/source-build.yml +++ b/eng/common/core-templates/steps/source-build.yml @@ -86,7 +86,6 @@ steps: $runtimeOsArgs \ $baseOsArgs \ /p:SourceBuildNonPortable=${{ parameters.platform.nonPortable }} \ - /p:ArcadeBuildFromSource=true \ /p:DotNetBuildSourceOnly=true \ /p:DotNetBuildRepo=true \ /p:AssetManifestFileName=$assetManifestFileName diff --git a/global.json b/global.json index b821921227..bde86ac363 100644 --- a/global.json +++ b/global.json @@ -14,6 +14,6 @@ }, "msbuild-sdks": { "Microsoft.Build.NoTargets": "3.5.0", - "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.24510.1" + "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.24511.1" } } From 5d515de41617781be12ae71b60bccd7982d34dbd Mon Sep 17 00:00:00 2001 From: Juan Hoyos <19413848+hoyosjs@users.noreply.github.com> Date: Mon, 14 Oct 2024 11:34:21 -0700 Subject: [PATCH 10/36] Update resource iteration (#4981) This changes resource iteration in `GetNextLevelResourceEntryRVA` to explicitly cast a potential overflow. It's safe since it will just not iterate any resources. --- src/shared/debug/dbgutil/dbgutil.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/shared/debug/dbgutil/dbgutil.cpp b/src/shared/debug/dbgutil/dbgutil.cpp index 91235f40e7..e9b6f6300a 100644 --- a/src/shared/debug/dbgutil/dbgutil.cpp +++ b/src/shared/debug/dbgutil/dbgutil.cpp @@ -271,18 +271,14 @@ HRESULT GetNextLevelResourceEntryRVA(ICorDebugDataTarget* pDataTarget, IMAGE_RESOURCE_DIRECTORY resourceDirectory; hr = ReadFromDataTarget(pDataTarget, moduleBaseAddress + resourceDirectoryRVA, (BYTE*)&resourceDirectory, sizeof(resourceDirectory)); - - - // The ith resource directory entry is at offset 16 + 8i from the beginning of the resource - // directory table - WORD numNameEntries; - WORD numIDEntries; if (SUCCEEDED(hr)) { - numNameEntries = resourceDirectory.NumberOfNamedEntries; - numIDEntries = resourceDirectory.NumberOfIdEntries; + // The ith resource directory entry is at offset 16 + 8i from the beginning of the resource + // directory table. First come named entries, followed by ID entries. We skip the former. + WORD beginIdEntries = resourceDirectory.NumberOfNamedEntries; + WORD endIdEntries = (WORD)(beginIdEntries + resourceDirectory.NumberOfIdEntries); - for (WORD i = numNameEntries; i < numNameEntries + numIDEntries; i++) + for (WORD i = beginIdEntries; i < endIdEntries; i++) { IMAGE_RESOURCE_DIRECTORY_ENTRY entry; hr = ReadFromDataTarget(pDataTarget, moduleBaseAddress + resourceDirectoryRVA + sizeof(resourceDirectory) + sizeof(entry)*i, From f2f7409843e433fd4448052a28647332f1026b92 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 14:01:25 +0000 Subject: [PATCH 11/36] [main] Update dependencies from dotnet/source-build-reference-packages (#5004) [main] Update dependencies from dotnet/source-build-reference-packages --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 8ad185e332..09b340a10e 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -49,9 +49,9 @@ b030c4dfdfa1bf287f10f96006619a06bc2000ae - + https://github.com/dotnet/source-build-reference-packages - 76c417253f5b3890997a3ef4b0613c2eab73d156 + f3889ab90d78377122a3e427fe9a74c03611a4bd diff --git a/eng/Versions.props b/eng/Versions.props index d64d0f4501..1843647dd6 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -60,7 +60,7 @@ 7.0.0-beta.22316.2 10.0.26100.1 13.0.1 - 10.0.0-alpha.1.24511.4 + 10.0.0-alpha.1.24514.1 diff --git a/eng/Versions.props b/eng/Versions.props index 1843647dd6..e92bde869c 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -16,8 +16,8 @@ - 9.0.0-rtm.24511.16 - 9.0.0-rtm.24511.16 + 9.0.0-rtm.24514.4 + 9.0.0-rtm.24514.4 9.0.0-rtm.24511.11 9.0.0-rtm.24511.11 From b2673828f66c3c3ecf3c5400b1bbbf45cc108bb3 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:57:42 -0700 Subject: [PATCH 13/36] [main] Update dependencies from dotnet/aspnetcore (#5005) This pull request updates the following dependencies [marker]: <> (Begin:e96c3e1a-afbc-49f7-37c9-08dc4e3803cb) ## From https://github.com/dotnet/aspnetcore - **Subscription**: e96c3e1a-afbc-49f7-37c9-08dc4e3803cb - **Build**: 20241014.7 - **Date Produced**: October 14, 2024 8:45:19 PM UTC - **Commit**: 228b9ea237f21b19647f11c98e342efdb9a1f3f1 - **Branch**: refs/heads/release/9.0 [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.AspNetCore.App.Ref**: [from 9.0.0-rtm.24511.11 to 9.0.0-rtm.24514.7][1] - **Microsoft.AspNetCore.App.Ref.Internal**: [from 9.0.0-rtm.24511.11 to 9.0.0-rtm.24514.7][1] [1]: https://github.com/dotnet/aspnetcore/compare/00eeceef99...228b9ea237 [DependencyUpdate]: <> (End) [marker]: <> (End:e96c3e1a-afbc-49f7-37c9-08dc4e3803cb) Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 1cfcfdd7aa..6c3539e420 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -32,13 +32,13 @@ https://github.com/dotnet/sdk 5b9d9d4677ea31d954533e9de2f95a3ea638135d - + https://github.com/dotnet/aspnetcore - 00eeceef992c85130b5137ceaba8b54c172b432d + 228b9ea237f21b19647f11c98e342efdb9a1f3f1 - + https://github.com/dotnet/aspnetcore - 00eeceef992c85130b5137ceaba8b54c172b432d + 228b9ea237f21b19647f11c98e342efdb9a1f3f1 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index e92bde869c..8ef7b0c7fa 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -19,8 +19,8 @@ 9.0.0-rtm.24514.4 9.0.0-rtm.24514.4 - 9.0.0-rtm.24511.11 - 9.0.0-rtm.24511.11 + 9.0.0-rtm.24514.7 + 9.0.0-rtm.24514.7 9.0.100-rc.1.24409.1 From 845230bad4ad6b6ff3d6dddecfa7185e2b304143 Mon Sep 17 00:00:00 2001 From: Noah Falk Date: Wed, 16 Oct 2024 01:13:53 -0700 Subject: [PATCH 14/36] Improve cancellation handling for dotnet-stack (#4996) Fixes https://github.com/dotnet/diagnostics/issues/4826 When running dotnet-stack against an unresponsive target process, there were various points where dotnet-stack wouldn't correctly cancel when Ctrl-C was pressed. There were several underlying issues: - Cancellation caused EventPipeSession.Dispose() to run which attempted to send a Stop IPC command that might block indefinitely - Several of the async operations dotnet-stack performed did not pass a cancellation token and so ignore when Ctrl-C is pressed - The calls to start and stop the session were still using the synchronous API which both ignored the cancellation token and create the standard async-over-sync issues. The change in behavior for EventPipeSession.Dispose() is strictly speaking a breaking change, although callers would need to emply some dubious code patterns to observe the difference. The most likely way code could observe the difference is if thread 1 is reading from the EventStream at the same time thread 2 called Dispose(). Previously this would have caused thread 1 to start receiving rundown events although it was also a race condition between thread 1 reading from the stream and thread 2 disposing the stream. Its possible some tool could have worked successfully if thread 1 always won the race in practice. If any code was doing that pattern then now thread 1 will observe the stream is disposed without seeing the rundown events first. The proper way to ensure seeing all the rundown events would be to explicitly call EventPipeSession.Stop(), then read all the remaining data and reach the end of stream marker, then Dispose() the session. I looked through all the usage of EventPipeSession in our existing tools and it looked like all of them were already using Stop() properly. --- .../DiagnosticsClient/EventPipeSession.cs | 11 ++--------- src/Tools/dotnet-stack/ReportCommand.cs | 13 +++++++++---- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsClient/EventPipeSession.cs b/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsClient/EventPipeSession.cs index 4de76a9896..fd7508c24a 100644 --- a/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsClient/EventPipeSession.cs +++ b/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsClient/EventPipeSession.cs @@ -164,15 +164,8 @@ private bool TryCreateStopMessage(out IpcMessage stopMessage) protected virtual void Dispose(bool disposing) { - // If session being disposed hasn't been stopped, attempt to stop it first - if (!_stopped) - { - try - { - Stop(); - } - catch { } // swallow any exceptions that may be thrown from Stop. - } + // Do not call Stop() here. Trying to do so now might block indefinitely if the runtime is unresponsive and we don't want blocking behavior in Dispose(). + // If the caller wants to ensure that all rundown events are captured they should call Stop() first, then process the EventStream until it is complete, then call Dispose(). if (!_disposedValue) { diff --git a/src/Tools/dotnet-stack/ReportCommand.cs b/src/Tools/dotnet-stack/ReportCommand.cs index 4684d58d0b..645de24def 100644 --- a/src/Tools/dotnet-stack/ReportCommand.cs +++ b/src/Tools/dotnet-stack/ReportCommand.cs @@ -78,12 +78,13 @@ private static async Task Report(CancellationToken ct, IConsole console, in // is too short in a given environment, e.g., resource constrained systems // N.B. - This trace INCLUDES rundown. For sufficiently large applications, it may take non-trivial time to collect // the symbol data in rundown. - using (EventPipeSession session = client.StartEventPipeSession(providers)) + EventPipeSession session = await client.StartEventPipeSessionAsync(providers, requestRundown:true, token:ct).ConfigureAwait(false); + using (session) using (FileStream fs = File.OpenWrite(tempNetTraceFilename)) { - Task copyTask = session.EventStream.CopyToAsync(fs); - await Task.Delay(duration).ConfigureAwait(false); - session.Stop(); + Task copyTask = session.EventStream.CopyToAsync(fs, ct); + await Task.Delay(duration, ct).ConfigureAwait(false); + await session.StopAsync(ct).ConfigureAwait(false); // check if rundown is taking more than 5 seconds and add comment to report Task timeoutTask = Task.Delay(TimeSpan.FromSeconds(5)); @@ -147,6 +148,10 @@ private static async Task Report(CancellationToken ct, IConsole console, in } } } + catch (OperationCanceledException) + { + return -1; + } catch (Exception ex) { Console.Error.WriteLine($"[ERROR] {ex}"); From 05865c975d7f055143c1863d6e91c8e1687d9f6a Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 16 Oct 2024 13:49:52 +0000 Subject: [PATCH 15/36] [main] Update dependencies from dotnet/source-build-reference-packages (#5007) [main] Update dependencies from dotnet/source-build-reference-packages --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 6c3539e420..dd88bf8eab 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -49,9 +49,9 @@ c2da91e256ebcb69f71040eb93b186b0985a2384 - + https://github.com/dotnet/source-build-reference-packages - f3889ab90d78377122a3e427fe9a74c03611a4bd + 4660d88cf953fbbd14192c787053a20246ce1aeb diff --git a/eng/Versions.props b/eng/Versions.props index 8ef7b0c7fa..d122bb585a 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -60,7 +60,7 @@ 7.0.0-beta.22316.2 10.0.26100.1 13.0.1 - 10.0.0-alpha.1.24514.1 + 10.0.0-alpha.1.24515.1 diff --git a/eng/Versions.props b/eng/Versions.props index d122bb585a..57d33d62bb 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -16,8 +16,8 @@ - 9.0.0-rtm.24514.4 - 9.0.0-rtm.24514.4 + 9.0.0-rtm.24515.15 + 9.0.0-rtm.24515.15 9.0.0-rtm.24514.7 9.0.0-rtm.24514.7 From 2c736aae9387f481959ff835e1401b655f897255 Mon Sep 17 00:00:00 2001 From: Michael Simons Date: Wed, 16 Oct 2024 10:15:27 -0500 Subject: [PATCH 17/36] Update source-build team references (#5002) The @dotnet/source-build-internal team is being deprecated. All references to it were updated. Included the renaming of SourceBuild.props to the new naming convention, DotNetBuild.props. Related to dotnet/source-build#4645 Repo admins, please grant write access to @dotnet/product-construction and @dotnet/source-build. This is needed for the CODEOWNERS changes. Write access can be removed for @dotnet/source-build-internal. --------- Co-authored-by: Matt Thalman --- .github/CODEOWNERS | 4 ++-- eng/{SourceBuild.props => DotNetBuild.props} | 2 +- eng/SourceBuildPrebuiltBaseline.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename eng/{SourceBuild.props => DotNetBuild.props} (73%) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index c57d36105c..6dcf5377e2 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -7,5 +7,5 @@ # have proper ownership. /src/ @dotnet/dotnet-diag /documentation/ @dotnet/dotnet-diag -/eng/SourceBuild.props @dotnet/source-build-internal -/eng/SourceBuildPrebuiltBaseline.xml @dotnet/source-build-internal +/eng/DotNetBuild.props @dotnet/product-construction +/eng/SourceBuildPrebuiltBaseline.xml @dotnet/source-build diff --git a/eng/SourceBuild.props b/eng/DotNetBuild.props similarity index 73% rename from eng/SourceBuild.props rename to eng/DotNetBuild.props index cd81671885..bf6e4287ba 100644 --- a/eng/SourceBuild.props +++ b/eng/DotNetBuild.props @@ -1,4 +1,4 @@ - + diff --git a/eng/SourceBuildPrebuiltBaseline.xml b/eng/SourceBuildPrebuiltBaseline.xml index 854ceff458..a26a34d85e 100644 --- a/eng/SourceBuildPrebuiltBaseline.xml +++ b/eng/SourceBuildPrebuiltBaseline.xml @@ -1,4 +1,4 @@ - + From 6a90923439dc43693f2a2fc8766b3cdb2c4dd366 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 17 Oct 2024 13:08:00 +0000 Subject: [PATCH 18/36] [main] Update dependencies from microsoft/clrmd (#5010) [main] Update dependencies from microsoft/clrmd --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 2d37b0b51d..3737b3a4f5 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,12 +1,12 @@ - + https://github.com/microsoft/clrmd - 898339503a4f9d877be46826b5814c1813808ac5 + b5f9dbac8e49315c9efa72b878359844112cce55 - + https://github.com/microsoft/clrmd - 898339503a4f9d877be46826b5814c1813808ac5 + b5f9dbac8e49315c9efa72b878359844112cce55 diff --git a/eng/Versions.props b/eng/Versions.props index 57d33d62bb..568fa6a571 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -37,7 +37,7 @@ 8.0.0 6.0.0 - 4.0.0-beta.24480.1 + 4.0.0-beta.24516.1 17.10.0-beta1.24272.1 3.0.7 6.0.0 From 335c0c013c3a761792bfa83c0dbaadd1f0545f07 Mon Sep 17 00:00:00 2001 From: Sainath Reddy G N V <144475740+sainath-reddy-gnv@users.noreply.github.com> Date: Sun, 20 Oct 2024 16:56:57 +0000 Subject: [PATCH 19/36] Fix error in dump requests command (#5012) Fixed an issue with the `!dumprequests` command that was causing an error when reading dumps from a Kestrel host. ``` 0:000> !dumprequests Field 'Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2Stream.k__BackingField' is not of type 'string'. ``` In Kestrel host dumps, the `k__BackingField` field in the `HttpContext` object is of `Enum` type, whereas in IIS host dumps, it is of `String` type. To address this, the `_methodText` field in the `HttpContext` object is now read if the `k__BackingField` field is not of `String` type. Also added min width for each column for better readability. --------- Co-authored-by: Sainath Reddy G N V --- .../DumpRequestsCommand.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/Microsoft.Diagnostics.ExtensionCommands/DumpRequestsCommand.cs b/src/Microsoft.Diagnostics.ExtensionCommands/DumpRequestsCommand.cs index 660a619a91..b1e684fc03 100644 --- a/src/Microsoft.Diagnostics.ExtensionCommands/DumpRequestsCommand.cs +++ b/src/Microsoft.Diagnostics.ExtensionCommands/DumpRequestsCommand.cs @@ -30,9 +30,13 @@ public override void Invoke() if (obj.Type?.Name?.Equals("Microsoft.AspNetCore.Http.DefaultHttpContext") ?? false) { ClrObject collection = obj.ReadValueTypeField("_features").ReadObjectField("k__BackingField"); - if (!collection.IsNull) + if (!collection.IsNull && collection.IsValid) { - string method = collection.ReadStringField("k__BackingField") ?? ""; + if (!collection.TryReadStringField("k__BackingField", default, out string method)) + { + method = collection.ReadStringField("_methodText") ?? ""; + } + string scheme = collection.ReadStringField("k__BackingField") ?? ""; string path = collection.ReadStringField("k__BackingField") ?? ""; string query = collection.ReadStringField("k__BackingField") ?? ""; @@ -59,10 +63,11 @@ public override void Invoke() public void PrintRequests(List<(ulong Address, string Method, string scheme, string Url)> requests) { - Column methodColumn = Text.GetAppropriateWidth(requests.Select(r => r.Method)).WithAlignment(Align.Left); - Column schemeColumn = Text.GetAppropriateWidth(requests.Select(r => r.scheme)).WithAlignment(Align.Left); - Column urlColumn = Text.GetAppropriateWidth(requests.Select(r => r.Url)).WithAlignment(Align.Left); - Table output = new(Console, DumpObj.WithAlignment(Align.Left), methodColumn, schemeColumn, urlColumn); ; + Column addressColumn = DumpObj.GetAppropriateWidth(requests.Select(r => r.Address), 7).WithAlignment(Align.Left); + Column methodColumn = Text.GetAppropriateWidth(requests.Select(r => r.Method), 6).WithAlignment(Align.Left); + Column schemeColumn = Text.GetAppropriateWidth(requests.Select(r => r.scheme), 6).WithAlignment(Align.Left); + Column urlColumn = Text.GetAppropriateWidth(requests.Select(r => r.Url), 3).WithAlignment(Align.Left); + Table output = new(Console, addressColumn, methodColumn, schemeColumn, urlColumn); ; output.WriteHeader("Address", "Method", "Scheme", "Url"); foreach ((ulong address, string method, string scheme, string url) in requests) From acbe21827748ecb681709327f48bb8afbc5bda5b Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 13:24:54 +0000 Subject: [PATCH 20/36] [main] Update dependencies from dotnet/sdk (#5015) [main] Update dependencies from dotnet/sdk --- eng/Version.Details.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 3737b3a4f5..efc0823531 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -28,9 +28,9 @@ https://github.com/dotnet/arcade ccfe6da198c5f05534863bbb1bff66e830e0c6ab - + https://github.com/dotnet/sdk - 5b9d9d4677ea31d954533e9de2f95a3ea638135d + 95bea787c14e3402b47311007dba6b3f503b34e7 https://github.com/dotnet/aspnetcore From 0de74cbde5d88b1a416d046405515196fe3a6793 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 11:57:57 -0700 Subject: [PATCH 21/36] [main] Update dependencies from dotnet/arcade (#5014) This pull request updates the following dependencies [marker]: <> (Begin:6d3f346d-45bf-4275-0e83-08d8e40a189f) ## From https://github.com/dotnet/arcade - **Subscription**: 6d3f346d-45bf-4275-0e83-08d8e40a189f - **Build**: 20241015.3 - **Date Produced**: October 15, 2024 11:31:33 PM UTC - **Commit**: 31624193093a13f765ab5382509e693911264509 - **Branch**: refs/heads/main [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.SourceBuild.Intermediate.arcade**: [from 10.0.0-beta.24511.1 to 10.0.0-beta.24515.3][1] - **Microsoft.DotNet.Arcade.Sdk**: [from 10.0.0-beta.24511.1 to 10.0.0-beta.24515.3][1] - **Microsoft.DotNet.CodeAnalysis**: [from 10.0.0-beta.24511.1 to 10.0.0-beta.24515.3][1] [1]: https://github.com/dotnet/arcade/compare/712dea25b1...3162419309 [DependencyUpdate]: <> (End) [marker]: <> (End:6d3f346d-45bf-4275-0e83-08d8e40a189f) --------- Co-authored-by: dotnet-maestro[bot] Co-authored-by: Mike McLaughlin --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 2 +- global.json | 2 +- .../Minidump/Tests.cs | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index efc0823531..531fcdd97d 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -10,19 +10,19 @@ - + https://github.com/dotnet/arcade - 712dea25b14a59fe642f2d28e8a3f3c931c03759 + 31624193093a13f765ab5382509e693911264509 - + https://github.com/dotnet/arcade - 712dea25b14a59fe642f2d28e8a3f3c931c03759 + 31624193093a13f765ab5382509e693911264509 - + https://github.com/dotnet/arcade - 712dea25b14a59fe642f2d28e8a3f3c931c03759 + 31624193093a13f765ab5382509e693911264509 https://github.com/dotnet/arcade diff --git a/eng/Versions.props b/eng/Versions.props index 568fa6a571..8f4d6a362b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -55,7 +55,7 @@ 8.0.0 8.0.5 2.0.3 - 10.0.0-beta.24511.1 + 10.0.0-beta.24515.3 1.2.0-beta.406 7.0.0-beta.22316.2 10.0.26100.1 diff --git a/global.json b/global.json index bde86ac363..4aba35f1d3 100644 --- a/global.json +++ b/global.json @@ -14,6 +14,6 @@ }, "msbuild-sdks": { "Microsoft.Build.NoTargets": "3.5.0", - "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.24511.1" + "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.24515.3" } } diff --git a/src/tests/Microsoft.FileFormats.UnitTests/Minidump/Tests.cs b/src/tests/Microsoft.FileFormats.UnitTests/Minidump/Tests.cs index b44fba2a5d..ae557118d2 100644 --- a/src/tests/Microsoft.FileFormats.UnitTests/Minidump/Tests.cs +++ b/src/tests/Microsoft.FileFormats.UnitTests/Minidump/Tests.cs @@ -84,7 +84,7 @@ public void CheckModuleNames() private void CheckModuleNamesInternal(Minidump minidump) { - Assert.Single(minidump.LoadedImages.Where(i => i.ModuleName.EndsWith(@"\clr.dll"))); + Assert.Single(minidump.LoadedImages, i => i.ModuleName.EndsWith(@"\clr.dll")); foreach (var module in minidump.LoadedImages) Assert.NotNull(module.ModuleName); From 35fab2731b24c6159e3c6d352f5345371dd640ef Mon Sep 17 00:00:00 2001 From: Mike McLaughlin Date: Mon, 21 Oct 2024 12:02:00 -0700 Subject: [PATCH 22/36] Clean up thread and thread service interfaces (#5013) Change GetThreadContext to return an ReadOnlySpan because the original API allowed the array returned to be changed. Fixed a couple of other APIs to that a ReadOnlySpan. Added some common GetThreadContext extensions --- .../DataReader.cs | 5 +- .../Thread.cs | 51 ++++++------------- .../ThreadService.cs | 42 ++++++++++++++- .../IThread.cs | 5 +- .../IThreadService.cs | 12 +++++ .../IThreadUnwindService.cs | 5 +- .../ThreadExtensions.cs | 23 +++++++++ src/SOS/SOS.Extensions/DebuggerServices.cs | 11 ++-- ...ThreadUnwindServiceFromDebuggerServices.cs | 5 +- .../SOS.Hosting/CorDebugDataTargetWrapper.cs | 25 +++------ src/SOS/SOS.Hosting/DataTargetWrapper.cs | 23 +++------ src/SOS/SOS.Hosting/LLDBServices.cs | 4 +- src/SOS/SOS.Hosting/SOSHost.cs | 17 ++----- 13 files changed, 128 insertions(+), 100 deletions(-) create mode 100644 src/Microsoft.Diagnostics.DebugServices/ThreadExtensions.cs diff --git a/src/Microsoft.Diagnostics.DebugServices.Implementation/DataReader.cs b/src/Microsoft.Diagnostics.DebugServices.Implementation/DataReader.cs index 826eaecdf1..01f46135fa 100644 --- a/src/Microsoft.Diagnostics.DebugServices.Implementation/DataReader.cs +++ b/src/Microsoft.Diagnostics.DebugServices.Implementation/DataReader.cs @@ -54,11 +54,10 @@ bool IDataReader.GetThreadContext(uint threadId, uint contextFlags, Span c { try { - byte[] registerContext = ThreadService.GetThreadFromId(threadId).GetThreadContext(); - registerContext.AsSpan().Slice(0, context.Length).CopyTo(context); + ThreadService.GetThreadFromId(threadId).GetThreadContext(context); return true; } - catch (Exception ex) when (ex is DiagnosticsException or ArgumentException) + catch (Exception ex) when (ex is DiagnosticsException or ArgumentOutOfRangeException) { Trace.TraceError($"GetThreadContext: {threadId} exception {ex.Message}"); } diff --git a/src/Microsoft.Diagnostics.DebugServices.Implementation/Thread.cs b/src/Microsoft.Diagnostics.DebugServices.Implementation/Thread.cs index 5a4fc38934..96804254d7 100644 --- a/src/Microsoft.Diagnostics.DebugServices.Implementation/Thread.cs +++ b/src/Microsoft.Diagnostics.DebugServices.Implementation/Thread.cs @@ -3,14 +3,13 @@ using System; using System.Diagnostics; -using System.Runtime.InteropServices; namespace Microsoft.Diagnostics.DebugServices.Implementation { public class Thread : IThread, IDisposable { private readonly ThreadService _threadService; - private byte[] _threadContext; + private ReadOnlyMemory _threadContext; private ulong? _teb; protected readonly ServiceContainer _serviceContainer; @@ -40,46 +39,28 @@ void IDisposable.Dispose() public IServiceProvider Services => _serviceContainer; - public bool TryGetRegisterValue(int index, out ulong value) + public bool TryGetRegisterValue(int registerIndex, out ulong value) { - value = 0; - - if (_threadService.TryGetRegisterInfo(index, out RegisterInfo info)) + try + { + ReadOnlySpan context = GetThreadContext(); + return _threadService.TryGetRegisterValue(context, registerIndex, out value); + } + catch (DiagnosticsException ex) { - try - { - Span threadContext = new(GetThreadContext(), info.RegisterOffset, info.RegisterSize); - switch (info.RegisterSize) - { - case 1: - value = MemoryMarshal.Read(threadContext); - return true; - case 2: - value = MemoryMarshal.Read(threadContext); - return true; - case 4: - value = MemoryMarshal.Read(threadContext); - return true; - case 8: - value = MemoryMarshal.Read(threadContext); - return true; - default: - Trace.TraceError($"GetRegisterValue: 0x{ThreadId:X4} {info.RegisterName} invalid size {info.RegisterSize}"); - break; - } - } - catch (DiagnosticsException ex) - { - Trace.TraceError($"GetRegisterValue: 0x{ThreadId:X4} {info.RegisterName} {ex}"); - } + Trace.TraceError($"GetRegisterValue: 0x{ThreadId:X4} {ex}"); } + value = 0; return false; } - public byte[] GetThreadContext() + public ReadOnlySpan GetThreadContext() { - _threadContext ??= _threadService.GetThreadContext(this); - return _threadContext; + if (_threadContext.IsEmpty) + { + _threadContext = _threadService.GetThreadContext(this); + } + return _threadContext.Span; } public ulong GetThreadTeb() diff --git a/src/Microsoft.Diagnostics.DebugServices.Implementation/ThreadService.cs b/src/Microsoft.Diagnostics.DebugServices.Implementation/ThreadService.cs index 2d0a95cbee..668d17e127 100644 --- a/src/Microsoft.Diagnostics.DebugServices.Implementation/ThreadService.cs +++ b/src/Microsoft.Diagnostics.DebugServices.Implementation/ThreadService.cs @@ -3,14 +3,14 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.InteropServices; using Microsoft.Diagnostics.Runtime; using Architecture = System.Runtime.InteropServices.Architecture; -namespace Microsoft.Diagnostics.DebugServices.Implementation -{ +namespace Microsoft.Diagnostics.DebugServices.Implementation { /// /// Provides thread and register info and values for the clrmd IDataReader /// @@ -187,6 +187,43 @@ public bool TryGetRegisterInfo(int registerIndex, out RegisterInfo info) return _lookupByIndex.TryGetValue(registerIndex, out info); } + /// + /// Returns the register value for the thread context and register index. This function + /// can only return register values that are 64 bits or less and currently the clrmd data + /// targets don't return any floating point or larger registers. + /// + /// thread context + /// register index + /// value returned + /// true if value found + public bool TryGetRegisterValue(ReadOnlySpan context, int registerIndex, out ulong value) + { + if (TryGetRegisterInfo(registerIndex, out RegisterInfo info)) + { + ReadOnlySpan threadSpan = context.Slice(info.RegisterOffset, info.RegisterSize); + switch (info.RegisterSize) + { + case 1: + value = MemoryMarshal.Read(threadSpan); + return true; + case 2: + value = MemoryMarshal.Read(threadSpan); + return true; + case 4: + value = MemoryMarshal.Read(threadSpan); + return true; + case 8: + value = MemoryMarshal.Read(threadSpan); + return true; + default: + Trace.TraceError($"GetRegisterValue: {info.RegisterName} invalid size {info.RegisterSize}"); + break; + } + } + value = 0; + return false; + } + /// /// Enumerate all the native threads /// @@ -236,6 +273,7 @@ public IThread GetThreadFromId(uint threadId) /// /// thread instance /// context array + /// invalid thread id internal byte[] GetThreadContext(Thread thread) { byte[] threadContext = new byte[_contextSize]; diff --git a/src/Microsoft.Diagnostics.DebugServices/IThread.cs b/src/Microsoft.Diagnostics.DebugServices/IThread.cs index 207ca62c0a..e78515e369 100644 --- a/src/Microsoft.Diagnostics.DebugServices/IThread.cs +++ b/src/Microsoft.Diagnostics.DebugServices/IThread.cs @@ -3,8 +3,7 @@ using System; -namespace Microsoft.Diagnostics.DebugServices -{ +namespace Microsoft.Diagnostics.DebugServices { /// /// Details about a thread /// @@ -45,7 +44,7 @@ public interface IThread /// /// register context /// invalid thread - byte[] GetThreadContext(); + ReadOnlySpan GetThreadContext(); /// /// Returns the address of the Windows TEB or 0. diff --git a/src/Microsoft.Diagnostics.DebugServices/IThreadService.cs b/src/Microsoft.Diagnostics.DebugServices/IThreadService.cs index 7518d53028..922ecdac0f 100644 --- a/src/Microsoft.Diagnostics.DebugServices/IThreadService.cs +++ b/src/Microsoft.Diagnostics.DebugServices/IThreadService.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Collections.Generic; namespace Microsoft.Diagnostics.DebugServices @@ -46,6 +47,17 @@ public interface IThreadService /// true if index found bool TryGetRegisterInfo(int registerIndex, out RegisterInfo info); + /// + /// Returns the register value for the thread context and register index. This function + /// can only return register values that are 64 bits or less and currently the clrmd data + /// targets don't return any floating point or larger registers. + /// + /// thread context + /// register index + /// value returned + /// true if value found + bool TryGetRegisterValue(ReadOnlySpan context, int registerIndex, out ulong value); + /// /// Enumerate all the native threads /// diff --git a/src/Microsoft.Diagnostics.DebugServices/IThreadUnwindService.cs b/src/Microsoft.Diagnostics.DebugServices/IThreadUnwindService.cs index cb8a4b7d81..9e3b032040 100644 --- a/src/Microsoft.Diagnostics.DebugServices/IThreadUnwindService.cs +++ b/src/Microsoft.Diagnostics.DebugServices/IThreadUnwindService.cs @@ -1,6 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; + namespace Microsoft.Diagnostics.DebugServices { /// @@ -14,9 +16,8 @@ public interface IThreadUnwindService /// return the context will be modified to reflect the parent frame's context. /// /// thread id to unwind - /// register context size /// On input, the frame to unwind. On return, the context of the next frame /// HRESULT - int Unwind(uint threadId, uint contextSize, byte[] context); + int Unwind(uint threadId, Span context); } } diff --git a/src/Microsoft.Diagnostics.DebugServices/ThreadExtensions.cs b/src/Microsoft.Diagnostics.DebugServices/ThreadExtensions.cs new file mode 100644 index 0000000000..e4e4be22a0 --- /dev/null +++ b/src/Microsoft.Diagnostics.DebugServices/ThreadExtensions.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +namespace Microsoft.Diagnostics.DebugServices +{ + public static class ThreadExtensions + { + public static unsafe void GetThreadContext(this IThread thread, IntPtr context, int contextSize) + { + GetThreadContext(thread, new(context.ToPointer(), contextSize)); + } + + public static void GetThreadContext(this IThread thread, Span context) + { + ReadOnlySpan registerContext = thread.GetThreadContext(); + context.Clear(); + registerContext.Slice(0, Math.Min(registerContext.Length, context.Length)).CopyTo(context); + } + } +} diff --git a/src/SOS/SOS.Extensions/DebuggerServices.cs b/src/SOS/SOS.Extensions/DebuggerServices.cs index 82cb8872dd..a1888f0af4 100644 --- a/src/SOS/SOS.Extensions/DebuggerServices.cs +++ b/src/SOS/SOS.Extensions/DebuggerServices.cs @@ -284,15 +284,18 @@ public HResult SetCurrentThreadId(uint threadId) public HResult GetThreadTeb(uint threadId, out ulong teb) { - // The native code may zero out this return pointer + // The native code may not zero out this return pointer +#pragma warning disable IDE0059 // Unnecessary assignment of a value + teb = 0; +#pragma warning restore IDE0059 // Unnecessary assignment of a value return VTable.GetThreadTeb(Self, threadId, out teb); } - public HResult VirtualUnwind(uint threadId, uint contextSize, byte[] context) + public HResult VirtualUnwind(uint threadId, Span context) { fixed (byte* contextPtr = context) { - return VTable.VirtualUnwind(Self, threadId, contextSize, contextPtr); + return VTable.VirtualUnwind(Self, threadId, context.Length, contextPtr); } } @@ -537,7 +540,7 @@ private readonly unsafe struct IDebuggerServicesVTable public readonly delegate* unmanaged[Stdcall] GetCurrentThreadSystemId; public readonly delegate* unmanaged[Stdcall] SetCurrentThreadSystemId; public readonly delegate* unmanaged[Stdcall] GetThreadTeb; - public readonly delegate* unmanaged[Stdcall] VirtualUnwind; + public readonly delegate* unmanaged[Stdcall] VirtualUnwind; public readonly delegate* unmanaged[Stdcall] GetSymbolPath; public readonly delegate* unmanaged[Stdcall] GetSymbolByOffset; public readonly delegate* unmanaged[Stdcall] GetOffsetBySymbol; diff --git a/src/SOS/SOS.Extensions/ThreadUnwindServiceFromDebuggerServices.cs b/src/SOS/SOS.Extensions/ThreadUnwindServiceFromDebuggerServices.cs index b3a5f683a6..5d42737f50 100644 --- a/src/SOS/SOS.Extensions/ThreadUnwindServiceFromDebuggerServices.cs +++ b/src/SOS/SOS.Extensions/ThreadUnwindServiceFromDebuggerServices.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using Microsoft.Diagnostics.DebugServices; namespace SOS.Extensions @@ -14,9 +15,9 @@ public ThreadUnwindServiceFromDebuggerServices(DebuggerServices debuggerServices _debuggerServices = debuggerServices; } - public int Unwind(uint threadId, uint contextSize, byte[] context) + public int Unwind(uint threadId, Span context) { - return _debuggerServices.VirtualUnwind(threadId, contextSize, context); + return _debuggerServices.VirtualUnwind(threadId, context); } } } diff --git a/src/SOS/SOS.Hosting/CorDebugDataTargetWrapper.cs b/src/SOS/SOS.Hosting/CorDebugDataTargetWrapper.cs index a58f59211f..7ecd6c98a7 100644 --- a/src/SOS/SOS.Hosting/CorDebugDataTargetWrapper.cs +++ b/src/SOS/SOS.Hosting/CorDebugDataTargetWrapper.cs @@ -7,8 +7,7 @@ using Microsoft.Diagnostics.DebugServices; using Microsoft.Diagnostics.Runtime.Utilities; -namespace SOS.Hosting -{ +namespace SOS.Hosting { public sealed unsafe class CorDebugDataTargetWrapper : COMCallableIUnknown { private static readonly Guid IID_ICorDebugDataTarget = new("FE06DC28-49FB-4636-A4A3-E80DB4AE116C"); @@ -137,7 +136,7 @@ private unsafe int ReadVirtual( address &= _ignoreAddressBitsMask; if (!_memoryService.ReadMemory(address, buffer, unchecked((int)bytesRequested), out read)) { - Trace.TraceError("CorDebugDataTargetWrappter.ReadVirtual FAILED address {0:X16} size {1:X8}", address, bytesRequested); + Trace.TraceError("CorDebugDataTargetWrapper.ReadVirtual FAILED address {0:X16} size {1:X8}", address, bytesRequested); return HResult.E_FAIL; } } @@ -152,21 +151,13 @@ private int GetThreadContext( int contextSize, IntPtr context) { - byte[] registerContext; try { - registerContext = _threadService.GetThreadFromId(threadId).GetThreadContext(); + _threadService.GetThreadFromId(threadId).GetThreadContext(context, contextSize); } - catch (DiagnosticsException) - { - return HResult.E_FAIL; - } - try - { - Marshal.Copy(registerContext, 0, context, Math.Min(registerContext.Length, contextSize)); - } - catch (Exception ex) when (ex is ArgumentOutOfRangeException or ArgumentNullException) + catch (Exception ex) when (ex is DiagnosticsException or ArgumentOutOfRangeException) { + Trace.TraceError($"CorDebugDataTargetWrapper.GetThreadContext({threadId:X8}) FAILED"); return HResult.E_INVALIDARG; } return HResult.S_OK; @@ -179,7 +170,7 @@ private int GetThreadContext( private int VirtualUnwind( IntPtr self, uint threadId, - uint contextSize, + int contextSize, byte[] context) { try @@ -188,7 +179,7 @@ private int VirtualUnwind( { return HResult.E_NOTIMPL; } - return _threadUnwindService.Unwind(threadId, contextSize, context); + return _threadUnwindService.Unwind(threadId, context.AsSpan(0, contextSize)); } catch (DiagnosticsException) { @@ -263,7 +254,7 @@ private delegate int GetThreadContextDelegate( private delegate int VirtualUnwindDelegate( [In] IntPtr self, [In] uint threadId, - [In] uint contextSize, + [In] int contextSize, [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] byte[] context); #endregion diff --git a/src/SOS/SOS.Hosting/DataTargetWrapper.cs b/src/SOS/SOS.Hosting/DataTargetWrapper.cs index 659835540f..3feade5d10 100644 --- a/src/SOS/SOS.Hosting/DataTargetWrapper.cs +++ b/src/SOS/SOS.Hosting/DataTargetWrapper.cs @@ -9,8 +9,7 @@ using Microsoft.Diagnostics.Runtime.Utilities; using SOS.Hosting.DbgEng.Interop; -namespace SOS.Hosting -{ +namespace SOS.Hosting { internal sealed unsafe class DataTargetWrapper : COMCallableIUnknown { private static readonly Guid IID_ICLRDataTarget = new("3E11CCEE-D08B-43e5-AF01-32717A64DA03"); @@ -221,23 +220,13 @@ private int GetThreadContext( int contextSize, IntPtr context) { - byte[] registerContext; try { - registerContext = _threadService.GetThreadFromId(threadId).GetThreadContext(); + _threadService.GetThreadFromId(threadId).GetThreadContext(context, contextSize); } - catch (DiagnosticsException) + catch (Exception ex) when (ex is DiagnosticsException or ArgumentOutOfRangeException) { Trace.TraceError($"DataTargetWrapper.GetThreadContext({threadId:X8}) FAILED"); - return HResult.E_FAIL; - } - try - { - Marshal.Copy(registerContext, 0, context, Math.Min(registerContext.Length, contextSize)); - } - catch (Exception ex) when (ex is ArgumentOutOfRangeException or ArgumentNullException) - { - Trace.TraceError($"DataTargetWrapper.GetThreadContext Marshal.Copy FAILED {ex}"); return HResult.E_INVALIDARG; } return HResult.S_OK; @@ -311,7 +300,7 @@ private int FreeVirtual( private int VirtualUnwind( IntPtr self, uint threadId, - uint contextSize, + int contextSize, byte[] context) { try @@ -320,7 +309,7 @@ private int VirtualUnwind( { return HResult.E_NOTIMPL; } - return _threadUnwindService.Unwind(threadId, contextSize, context); + return _threadUnwindService.Unwind(threadId, context.AsSpan(0, contextSize)); } catch (DiagnosticsException) { @@ -466,7 +455,7 @@ private delegate int FreeVirtualDelegate( private delegate int VirtualUnwindDelegate( [In] IntPtr self, [In] uint threadId, - [In] uint contextSize, + [In] int contextSize, [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] byte[] context); #endregion diff --git a/src/SOS/SOS.Hosting/LLDBServices.cs b/src/SOS/SOS.Hosting/LLDBServices.cs index 1e6b127090..3c6d1a4552 100644 --- a/src/SOS/SOS.Hosting/LLDBServices.cs +++ b/src/SOS/SOS.Hosting/LLDBServices.cs @@ -107,7 +107,7 @@ private string GetCoreClrDirectory( private int VirtualUnwind( IntPtr self, uint threadId, - uint contextSize, + int contextSize, byte[] context) { return HResult.E_NOTIMPL; @@ -226,7 +226,7 @@ private delegate ulong GetExpressionDelegate( private delegate int VirtualUnwindDelegate( IntPtr self, uint threadId, - uint contextSize, + int contextSize, byte[] context); [UnmanagedFunctionPointer(CallingConvention.Winapi)] diff --git a/src/SOS/SOS.Hosting/SOSHost.cs b/src/SOS/SOS.Hosting/SOSHost.cs index 5a8cfb48b4..68e737c8d4 100644 --- a/src/SOS/SOS.Hosting/SOSHost.cs +++ b/src/SOS/SOS.Hosting/SOSHost.cs @@ -13,8 +13,7 @@ using SOS.Hosting.DbgEng.Interop; using Architecture = System.Runtime.InteropServices.Architecture; -namespace SOS.Hosting -{ +namespace SOS.Hosting { /// /// Helper code to hosting the native SOS code /// @@ -581,21 +580,13 @@ internal int GetThreadContextBySystemId( int contextSize, IntPtr context) { - byte[] registerContext; try { - registerContext = ThreadService.GetThreadFromId(threadId).GetThreadContext(); + ThreadService.GetThreadFromId(threadId).GetThreadContext(context, contextSize); } - catch (DiagnosticsException) - { - return HResult.E_FAIL; - } - try - { - Marshal.Copy(registerContext, 0, context, Math.Min(registerContext.Length, contextSize)); - } - catch (Exception ex) when (ex is ArgumentOutOfRangeException or ArgumentNullException) + catch (Exception ex) when (ex is DiagnosticsException or ArgumentOutOfRangeException) { + Trace.TraceError($"SOSHost.GetThreadContext({threadId:X8}) FAILED"); return HResult.E_INVALIDARG; } return HResult.S_OK; From c409ecc21c3ff38a8d53b740debec222a82469a8 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 13:24:55 +0000 Subject: [PATCH 23/36] [main] Update dependencies from dotnet/source-build-reference-packages (#5016) [main] Update dependencies from dotnet/source-build-reference-packages --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 531fcdd97d..d766edf53b 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -49,9 +49,9 @@ b8f5d2538d402d4714b4567af4b05b98aac94d2d - + https://github.com/dotnet/source-build-reference-packages - 4660d88cf953fbbd14192c787053a20246ce1aeb + ccd0927e3823fb178c7151594f5d2eaba81bba81 diff --git a/eng/Versions.props b/eng/Versions.props index 8f4d6a362b..536d6ff283 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -60,7 +60,7 @@ 7.0.0-beta.22316.2 10.0.26100.1 13.0.1 - 10.0.0-alpha.1.24515.1 + 10.0.0-alpha.1.24521.1 6.0.0 - 4.0.0-beta.24516.1 + 4.0.0-beta.24524.1 17.10.0-beta1.24272.1 3.0.7 6.0.0 From eb01be7a1ca6dac20d5afae1f818ad8ffbfd1f92 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 25 Oct 2024 13:57:45 -0700 Subject: [PATCH 27/36] [main] Update dependencies from dotnet/aspnetcore (#5008) This pull request updates the following dependencies [marker]: <> (Begin:e96c3e1a-afbc-49f7-37c9-08dc4e3803cb) ## From https://github.com/dotnet/aspnetcore - **Subscription**: e96c3e1a-afbc-49f7-37c9-08dc4e3803cb - **Build**: 20241022.5 - **Date Produced**: October 22, 2024 10:17:57 PM UTC - **Commit**: 6d58cd8ffa1b8f00a04238f16c58248d38c90776 - **Branch**: refs/heads/release/9.0 [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.AspNetCore.App.Ref**: [from 9.0.0 to 9.0.0][5] - **Microsoft.AspNetCore.App.Ref.Internal**: [from 9.0.0-rtm.24521.18 to 9.0.0-rtm.24522.5][5] [5]: https://github.com/dotnet/aspnetcore/compare/82199059ba...6d58cd8ffa [DependencyUpdate]: <> (End) [marker]: <> (End:e96c3e1a-afbc-49f7-37c9-08dc4e3803cb) --------- Co-authored-by: dotnet-maestro[bot] Co-authored-by: Mike McLaughlin --- NuGet.config | 5 +++++ eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- .../ConfigFiles/Unix/Debugger.Tests.Config.txt | 5 ----- .../ConfigFiles/Windows/Debugger.Tests.Config.txt | 5 ----- .../ConfigFiles/Unix/Debugger.Tests.Config.txt | 5 ----- .../ConfigFiles/Windows/Debugger.Tests.Config.txt | 5 ----- .../ConfigFiles/Unix/Debugger.Tests.Config.txt | 5 ----- .../ConfigFiles/Windows/Debugger.Tests.Config.txt | 5 ----- 9 files changed, 11 insertions(+), 36 deletions(-) diff --git a/NuGet.config b/NuGet.config index 4b675ebca4..f5449f33ef 100644 --- a/NuGet.config +++ b/NuGet.config @@ -5,6 +5,11 @@ + + + + + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index d32e890828..433ce93b77 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -32,13 +32,13 @@ https://github.com/dotnet/sdk 95bea787c14e3402b47311007dba6b3f503b34e7 - + https://github.com/dotnet/aspnetcore - 228b9ea237f21b19647f11c98e342efdb9a1f3f1 + 6d58cd8ffa1b8f00a04238f16c58248d38c90776 - + https://github.com/dotnet/aspnetcore - 228b9ea237f21b19647f11c98e342efdb9a1f3f1 + 6d58cd8ffa1b8f00a04238f16c58248d38c90776 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 00d41f464e..0687302ed1 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -19,8 +19,8 @@ 9.0.0-rtm.24515.15 9.0.0-rtm.24515.15 - 9.0.0-rtm.24514.7 - 9.0.0-rtm.24514.7 + 9.0.0-rtm.24522.5 + 9.0.0 9.0.100-rc.1.24409.1 diff --git a/src/SOS/SOS.UnitTests/ConfigFiles/Unix/Debugger.Tests.Config.txt b/src/SOS/SOS.UnitTests/ConfigFiles/Unix/Debugger.Tests.Config.txt index fd034675a5..c1ea95337d 100644 --- a/src/SOS/SOS.UnitTests/ConfigFiles/Unix/Debugger.Tests.Config.txt +++ b/src/SOS/SOS.UnitTests/ConfigFiles/Unix/Debugger.Tests.Config.txt @@ -35,11 +35,6 @@ $(DotNetRoot)/dotnet - - dotnet9=https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet9/nuget/v3/index.json; - dotnet-public=https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json - - $(DotNetRoot)/dotnet - - dotnet9=https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet9/nuget/v3/index.json; - dotnet-public=https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json - - false true diff --git a/src/tests/DbgShim.UnitTests/ConfigFiles/Windows/Debugger.Tests.Config.txt b/src/tests/DbgShim.UnitTests/ConfigFiles/Windows/Debugger.Tests.Config.txt index b280bd5904..3fc9b1d4d2 100644 --- a/src/tests/DbgShim.UnitTests/ConfigFiles/Windows/Debugger.Tests.Config.txt +++ b/src/tests/DbgShim.UnitTests/ConfigFiles/Windows/Debugger.Tests.Config.txt @@ -16,11 +16,6 @@ $(DotNetRoot)\dotnet.exe - - dotnet9=https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet9/nuget/v3/index.json; - dotnet-public=https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json - - true false From dfc9c901bd74274cca40f69d4a145fc124ac857b Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 25 Oct 2024 14:59:27 -0700 Subject: [PATCH 28/36] [main] Update dependencies from dotnet/runtime (#5011) This pull request updates the following dependencies [marker]: <> (Begin:a9fe20fc-c5cb-441c-a7ce-08dc4e3fac2f) ## From https://github.com/dotnet/runtime - **Subscription**: a9fe20fc-c5cb-441c-a7ce-08dc4e3fac2f - **Build**: 20241022.15 - **Date Produced**: October 23, 2024 7:43:50 AM UTC - **Commit**: 2b46f3a7eb3d0df99c523e5648f00cc8b53caa05 - **Branch**: refs/heads/release/9.0 [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.NETCore.App.Runtime.win-x64**: [from 9.0.0 to 9.0.0][4] - **VS.Redist.Common.NetCore.SharedFramework.x64.9.0**: [from 9.0.0-rtm.24518.13 to 9.0.0-rtm.24522.15][4] [4]: https://github.com/dotnet/runtime/compare/197db4ff0d...2b46f3a7eb [DependencyUpdate]: <> (End) [marker]: <> (End:a9fe20fc-c5cb-441c-a7ce-08dc4e3fac2f) --------- Co-authored-by: dotnet-maestro[bot] --- NuGet.config | 3 +++ eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/NuGet.config b/NuGet.config index f5449f33ef..8a105d11f0 100644 --- a/NuGet.config +++ b/NuGet.config @@ -9,6 +9,9 @@ + + + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 433ce93b77..afdd2b3a1c 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -40,13 +40,13 @@ https://github.com/dotnet/aspnetcore 6d58cd8ffa1b8f00a04238f16c58248d38c90776 - + https://github.com/dotnet/runtime - b8f5d2538d402d4714b4567af4b05b98aac94d2d + 2b46f3a7eb3d0df99c523e5648f00cc8b53caa05 - + https://github.com/dotnet/runtime - b8f5d2538d402d4714b4567af4b05b98aac94d2d + 2b46f3a7eb3d0df99c523e5648f00cc8b53caa05 diff --git a/eng/Versions.props b/eng/Versions.props index 0687302ed1..c25e215d3a 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -16,8 +16,8 @@ - 9.0.0-rtm.24515.15 - 9.0.0-rtm.24515.15 + 9.0.0-rtm.24522.15 + 9.0.0 9.0.0-rtm.24522.5 9.0.0 From 6831355340d4bc2e9503c418c47dd4ff71ac665b Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 26 Oct 2024 13:11:55 +0000 Subject: [PATCH 29/36] [main] Update dependencies from microsoft/clrmd (#5025) [main] Update dependencies from microsoft/clrmd --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index afdd2b3a1c..c054b808b0 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,12 +1,12 @@ - + https://github.com/microsoft/clrmd - 782e1803eed5d85070b5771658ffda0c4be51e64 + 26926a7ab14e4ca4040972dbdbf0a7cb816f4573 - + https://github.com/microsoft/clrmd - 782e1803eed5d85070b5771658ffda0c4be51e64 + 26926a7ab14e4ca4040972dbdbf0a7cb816f4573 diff --git a/eng/Versions.props b/eng/Versions.props index c25e215d3a..762e2891b4 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -37,7 +37,7 @@ 8.0.0 6.0.0 - 4.0.0-beta.24524.1 + 4.0.0-beta.24525.1 17.10.0-beta1.24272.1 3.0.7 6.0.0 From 088cb850e046ad28b522cf29f7e17811486623f5 Mon Sep 17 00:00:00 2001 From: Mike McLaughlin Date: Sat, 26 Oct 2024 09:20:32 -0700 Subject: [PATCH 30/36] Add extension loaded service manager property (#5024) Add loaded extension version display to !sosstatus Example: ``` Extensions loaded: -> 8.0.0-dev.24525.1+64eecc7e689a42bf979dd1339e90cd92a9843021 c:\diagnostics\artifacts\bin\Windows_NT.x64.Debug\Microsoft.Diagnostics.ExtensionCommands.dll -> 8.0.552406+f5de0a8ffe15b5aa596a8089c5d6a1c9472ac54b c:\diagnostics\artifacts\bin\Windows_NT.x64.Debug\extensions\Microsoft.Diagnostics.DataContractReader.dll -> 8.0.552406+f5de0a8ffe15b5aa596a8089c5d6a1c9472ac54b c:\diagnostics\artifacts\bin\Windows_NT.x64.Debug\extensions\Microsoft.Diagnostics.DataContractReader.Extension.dll -> 8.0.552406+f5de0a8ffe15b5aa596a8089c5d6a1c9472ac54b c:\diagnostics\artifacts\bin\Windows_NT.x64.Debug\extensions\Microsoft.Diagnostics.DebuggerCommands.dll ``` --- .../ServiceManager.cs | 16 ++++++++++++---- .../IServiceManager.cs | 6 ++++++ .../Host/StatusCommand.cs | 18 ++++++++++++++++++ 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.Diagnostics.DebugServices.Implementation/ServiceManager.cs b/src/Microsoft.Diagnostics.DebugServices.Implementation/ServiceManager.cs index 19904d2f10..ae69ea69ef 100644 --- a/src/Microsoft.Diagnostics.DebugServices.Implementation/ServiceManager.cs +++ b/src/Microsoft.Diagnostics.DebugServices.Implementation/ServiceManager.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; +using System.Linq; using System.Reflection; using System.Runtime.InteropServices; using System.Runtime.Loader; @@ -20,7 +21,7 @@ public class ServiceManager : IServiceManager { private readonly Dictionary[] _factories; private readonly Dictionary> _providerFactories; - private readonly List _extensions; + private readonly List<(Assembly assembly, object extension)> _extensions; private bool _finalized; /// @@ -51,7 +52,7 @@ public ServiceManager() { _factories = new Dictionary[(int)ServiceScope.Max]; _providerFactories = new Dictionary>(); - _extensions = new List(); + _extensions = new List<(Assembly assembly, object extension)>(); NotifyExtensionLoad = new ServiceEvent(); NotifyExtensionLoadFailure = new ServiceEvent(); for (int i = 0; i < (int)ServiceScope.Max; i++) @@ -299,6 +300,7 @@ public void LoadExtension(string extensionPath) if (RuntimeInformation.FrameworkDescription.StartsWith(".NET Framework")) { assembly = Assembly.LoadFile(extensionPath); + _extensions.Add((assembly, null)); } else { @@ -308,6 +310,7 @@ public void LoadExtension(string extensionPath) catch (Exception ex) when (ex is IOException or ArgumentException + or NotSupportedException or InvalidOperationException or BadImageFormatException or System.Security.SecurityException) @@ -321,6 +324,11 @@ or BadImageFormatException } } + /// + /// Returns the extensions loaded + /// + public IEnumerable ExtensionsLoaded => _extensions.Select(static ((Assembly assembly, object extension) entry) => entry.assembly); + /// /// Load the extension using an assembly load context. This needs to be in /// a separate method so ExtensionLoadContext class doesn't get referenced @@ -334,8 +342,8 @@ private Assembly UseAssemblyLoadContext(string extensionPath) Assembly assembly = extension.LoadFromAssemblyPath(extensionPath); if (assembly is not null) { - // This list is just to keep the load context alive - _extensions.Add(extension); + // This list to track the assemblies loaded and to keep the load context alive (ExtensionLoadContext) + _extensions.Add((assembly, extension)); } return assembly; } diff --git a/src/Microsoft.Diagnostics.DebugServices/IServiceManager.cs b/src/Microsoft.Diagnostics.DebugServices/IServiceManager.cs index 44bfd087bc..e52fd777b4 100644 --- a/src/Microsoft.Diagnostics.DebugServices/IServiceManager.cs +++ b/src/Microsoft.Diagnostics.DebugServices/IServiceManager.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Reflection; namespace Microsoft.Diagnostics.DebugServices { @@ -22,5 +23,10 @@ public interface IServiceManager /// type or interface /// the provider factories for the type IEnumerable EnumerateProviderFactories(Type providerType); + + /// + /// Returns the extensions loaded + /// + public IEnumerable ExtensionsLoaded { get; } } } diff --git a/src/Microsoft.Diagnostics.ExtensionCommands/Host/StatusCommand.cs b/src/Microsoft.Diagnostics.ExtensionCommands/Host/StatusCommand.cs index 36cda4e670..91c44223fb 100644 --- a/src/Microsoft.Diagnostics.ExtensionCommands/Host/StatusCommand.cs +++ b/src/Microsoft.Diagnostics.ExtensionCommands/Host/StatusCommand.cs @@ -2,7 +2,10 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Collections.Generic; +using System.Diagnostics; using System.Linq; +using System.Reflection; using Microsoft.Diagnostics.DebugServices; namespace Microsoft.Diagnostics.ExtensionCommands @@ -14,6 +17,9 @@ public class StatusCommand : CommandBase [ServiceImport] public IHost Host { get; set; } + [ServiceImport] + public IServiceManager ServiceManager { get; set; } + [ServiceImport] public ISymbolService SymbolService { get; set; } @@ -57,6 +63,18 @@ public override void Invoke() } this.DisplaySpecialInfo(); Write(SymbolService.ToString()); + + List extensions = new(ServiceManager.ExtensionsLoaded); + extensions.Insert(0, Assembly.GetExecutingAssembly()); + + WriteLine("Extensions loaded:"); + foreach (Assembly extension in extensions) + { + string path = extension.Location; + FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(path); + WriteLine($"-> {versionInfo.ProductVersion} {path}"); + } + long memoryUsage = GC.GetTotalMemory(forceFullCollection: true); WriteLine($"GC memory usage for managed SOS components: {memoryUsage:##,#} bytes"); } From b5278a82f985b25831f597af8d5bcab232fb843c Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 13:18:26 +0000 Subject: [PATCH 31/36] [main] Update dependencies from dotnet/arcade (#5026) [main] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 12 ++--- eng/Versions.props | 2 +- eng/common/native/install-dependencies.sh | 61 +++++++++++++++++++++++ global.json | 2 +- 4 files changed, 69 insertions(+), 8 deletions(-) create mode 100644 eng/common/native/install-dependencies.sh diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index c054b808b0..d9122ccb61 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -10,19 +10,19 @@ - + https://github.com/dotnet/arcade - 31624193093a13f765ab5382509e693911264509 + bee0a0f7b1e68e88c63261e127beee2ed06c6d13 - + https://github.com/dotnet/arcade - 31624193093a13f765ab5382509e693911264509 + bee0a0f7b1e68e88c63261e127beee2ed06c6d13 - + https://github.com/dotnet/arcade - 31624193093a13f765ab5382509e693911264509 + bee0a0f7b1e68e88c63261e127beee2ed06c6d13 https://github.com/dotnet/arcade diff --git a/eng/Versions.props b/eng/Versions.props index 762e2891b4..a79f38e31b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -55,7 +55,7 @@ 8.0.0 8.0.5 2.0.3 - 10.0.0-beta.24515.3 + 10.0.0-beta.24527.1 1.2.0-beta.406 7.0.0-beta.22316.2 10.0.26100.1 diff --git a/eng/common/native/install-dependencies.sh b/eng/common/native/install-dependencies.sh new file mode 100644 index 0000000000..03e47c48ac --- /dev/null +++ b/eng/common/native/install-dependencies.sh @@ -0,0 +1,61 @@ +#!/bin/sh + +set -e + +# This is a simple script primarily used for CI to install necessary dependencies +# +# Usage: +# +# ./install-dependencies.sh + +os="$(echo "$1" | tr "[:upper:]" "[:lower:]")" + +if [ -z "$os" ]; then + . "$(dirname "$0")"/init-os-and-arch.sh +fi + +case "$os" in + linux) + if [ -e /etc/os-release ]; then + . /etc/os-release + fi + + if [ "$ID" = "debian" ] || [ "$ID_LIKE" = "debian" ]; then + apt update + + apt install -y build-essential gettext locales cmake llvm clang lld lldb liblldb-dev libunwind8-dev libicu-dev liblttng-ust-dev \ + libssl-dev libkrb5-dev zlib1g-dev pigz + + localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 + elif [ "$ID" = "fedora" ]; then + dnf install -y cmake llvm lld lldb clang python curl libicu-devel openssl-devel krb5-devel zlib-devel lttng-ust-devel pigz + elif [ "$ID" = "alpine" ]; then + apk add build-base cmake bash curl clang llvm-dev lld lldb krb5-dev lttng-ust-dev icu-dev zlib-dev openssl-dev pigz + else + echo "Unsupported distro. distro: $ID" + exit 1 + fi + ;; + + osx|maccatalyst|ios|iossimulator|tvos|tvossimulator) + echo "Installed xcode version: $(xcode-select -p)" + + export HOMEBREW_NO_INSTALL_CLEANUP=1 + export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 + # Skip brew update for now, see https://github.com/actions/setup-python/issues/577 + # brew update --preinstall + brew bundle --no-upgrade --no-lock --file=- < Date: Mon, 28 Oct 2024 09:20:00 -0700 Subject: [PATCH 32/36] [main] Update dependencies from dotnet/sdk (#5027) This pull request updates the following dependencies [marker]: <> (Begin:638f1194-0c1a-4d47-eb59-08d8e4d5099b) ## From https://github.com/dotnet/sdk - **Subscription**: 638f1194-0c1a-4d47-eb59-08d8e4d5099b - **Build**: 20241027.3 - **Date Produced**: October 28, 2024 3:35:29 AM UTC - **Commit**: 50e04b8d1d8ff413de90383aa799e4189612f685 - **Branch**: refs/heads/release/9.0.1xx [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.NET.Sdk**: [from 9.0.100-rtm.24520.4 to 9.0.100-rtm.24527.3][1] [1]: https://github.com/dotnet/sdk/compare/95bea787c1...50e04b8d1d [DependencyUpdate]: <> (End) [marker]: <> (End:638f1194-0c1a-4d47-eb59-08d8e4d5099b) Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index d9122ccb61..65f2f37929 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -28,9 +28,9 @@ https://github.com/dotnet/arcade ccfe6da198c5f05534863bbb1bff66e830e0c6ab - + https://github.com/dotnet/sdk - 95bea787c14e3402b47311007dba6b3f503b34e7 + 50e04b8d1d8ff413de90383aa799e4189612f685 https://github.com/dotnet/aspnetcore From 9ab276edddf2e5d39a038792783f2c0208f04f38 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 13:11:04 +0000 Subject: [PATCH 33/36] [main] Update dependencies from dotnet/source-build-reference-packages (#5029) [main] Update dependencies from dotnet/source-build-reference-packages --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 65f2f37929..80f07bd5f4 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -49,9 +49,9 @@ 2b46f3a7eb3d0df99c523e5648f00cc8b53caa05 - + https://github.com/dotnet/source-build-reference-packages - ccd0927e3823fb178c7151594f5d2eaba81bba81 + ed0d2d18003162e01c244e5b7f97a3f8fd695d5f diff --git a/eng/Versions.props b/eng/Versions.props index a79f38e31b..f11cbfe8a5 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -60,7 +60,7 @@ 7.0.0-beta.22316.2 10.0.26100.1 13.0.1 - 10.0.0-alpha.1.24521.1 + 10.0.0-alpha.1.24528.1 6.0.0 - 4.0.0-beta.24525.1 + 4.0.0-beta.24528.1 17.10.0-beta1.24272.1 3.0.7 6.0.0 From a2e08c2c54714530293b31236aa5c7dc7177074c Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 13:46:22 +0000 Subject: [PATCH 35/36] [main] Update dependencies from dotnet/runtime (#5030) [main] Update dependencies from dotnet/runtime --- NuGet.config | 2 +- eng/Version.Details.xml | 6 +++--- eng/Versions.props | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/NuGet.config b/NuGet.config index 8a105d11f0..53688d72fe 100644 --- a/NuGet.config +++ b/NuGet.config @@ -10,7 +10,7 @@ - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index c610596167..f66e3d113f 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -42,11 +42,11 @@ https://github.com/dotnet/runtime - 2b46f3a7eb3d0df99c523e5648f00cc8b53caa05 + 7dab903b20269d78c6bc08d5269947db7d35c22b - + https://github.com/dotnet/runtime - 2b46f3a7eb3d0df99c523e5648f00cc8b53caa05 + 7dab903b20269d78c6bc08d5269947db7d35c22b diff --git a/eng/Versions.props b/eng/Versions.props index b177aa6153..1ee40d1c51 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -16,7 +16,7 @@ - 9.0.0-rtm.24522.15 + 9.0.0-rtm.24528.8 9.0.0 9.0.0-rtm.24522.5 From 4269d93e0c1bcb9c0698e3a29c8ddfe5c347aae1 Mon Sep 17 00:00:00 2001 From: Mike McLaughlin Date: Tue, 29 Oct 2024 18:08:25 -0700 Subject: [PATCH 36/36] Update version to 9.0.0 (#5031) --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index 1ee40d1c51..c8b56f412f 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -2,7 +2,7 @@ https://github.com/dotnet/diagnostics preview - 8.0.0 + 9.0.0 true true