Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions docs/design/datacontracts/RuntimeTypeSystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -589,25 +589,14 @@ static class RuntimeTypeSystem_1_Helpers
| `InstantiatedMethodDesc` | `PerInstInfo` | `pointer` | The pointer to the method's type arguments |
| `LayoutEEClass` | `LayoutInfo` | `EEClassLayoutInfo` | Inline `EEClassLayoutInfo` for a type with layout. Only the offset is used - the reader constructs an `EEClassLayoutInfo` at that offset from the `EEClass` address. Only valid when `EEClass.VMFlags` has `VMFLAG_HASLAYOUT` |
| `LoaderAllocator` | `CreationNumber` | `uint64` | Monotonically-increasing creation number assigned to each collectible LoaderAllocator. |
| `LoaderAllocator` | `DynamicHelpersStubHeap` | `pointer` | Dynamic-helper stub heap (optional, present when ReadyToRun dynamic-helper stubs are enabled) |
| `LoaderAllocator` | `ExecutableHeap` | `pointer` | Executable-code heap |
| `LoaderAllocator` | `FixupPrecodeHeap` | `pointer` | Fixup-precode heap (optional, present when fixup precodes are supported) |
| `LoaderAllocator` | `HighFrequencyHeap` | `pointer` | High-frequency allocation heap |
| `LoaderAllocator` | `IsCollectible` | `uint8` | Non-zero if the LoaderAllocator is collectible. |
| `LoaderAllocator` | `LowFrequencyHeap` | `pointer` | Low-frequency allocation heap |
| `LoaderAllocator` | `NewStubPrecodeHeap` | `pointer` | New-stub-precode heap (optional, absent with portable entry points) |
| `LoaderAllocator` | `ObjectHandle` | `ObjectHandle` | Handle to the managed loader allocator object |
| `LoaderAllocator` | `ReferenceCount` | `uint32` | Reference count of the loader allocator |
| `LoaderAllocator` | `StaticsHeap` | `pointer` | Heap containing statics-related allocations |
| `LoaderAllocator` | `VirtualCallStubManager` | `pointer` | Pointer to the virtual-call stub manager |
Comment thread
rcj1 marked this conversation as resolved.
| `MethodDesc` | *(type size)* | `uint32` | Base size for mcIL classification |
| `MethodDesc` | `ChunkIndex` | `uint8` | Offset of this MethodDesc relative to the end of its containing MethodDescChunk - in multiples of MethodDescAlignment |
| `MethodDesc` | `CodeData` | `pointer` | Pointer to per-method code data containing entry-point and code-versioning state |
| `MethodDesc` | `EntryPointFlags` | `uint8` | Flags describing entry-point state, including whether a temporary entry point has been assigned |
| `MethodDesc` | `Flags` | `uint16` | The method's flags |
| `MethodDesc` | `Flags3AndTokenRemainder` | `uint16` | More flags for the method, and the low bits of the method's token's RID |
| `MethodDesc` | `GCCoverageInfo` | `pointer` | The method's GCCover debug info, if supported |
| `MethodDesc` | `InterpreterCode` | `pointer` | Pointer to the method's `InterpByteCodeStart`, or the poison value 1 if the method will never be interpreted (only defined if `FEATURE_INTERPRETER` is enabled) |
| `MethodDesc` | `Slot` | `uint16` | The method's slot |
| `MethodDescChunk` | *(type size)* | `uint32` | Size of the data descriptor layout |
| `MethodDescChunk` | `Count` | `uint8` | The number of MethodDesc entries in this chunk, minus 1. |
Expand Down Expand Up @@ -636,7 +625,6 @@ static class RuntimeTypeSystem_1_Helpers
| `NativeCodeSlot` | *(type size)* | `uint32` | Size of the native code slot, added when HasNativeCodeSlot flag is set |
| `NonVtableSlot` | *(type size)* | `uint32` | Size of the non-vtable slot, added when HasNonVtableSlot flag is set |
| `Object` | *(type size)* | `uint32` | Size in bytes of the fixed Object portion through its MethodTable pointer |
| `Object` | `m_pMethTab` | `pointer` | Method table for the object |
| `ParamTypeDesc` | `TypeArg` | `pointer` | Associated type argument |
| `PInvokeMethodDesc` | *(type size)* | `uint32` | Base size for mcPInvoke classification |
| `Signature` | `SignatureLength` | `uint32` | Length in bytes of the raw signature blob. |
Expand Down
16 changes: 12 additions & 4 deletions eng/pipelines/diagnostics/sos-test-leg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ parameters:
templatePath: 'templates'
templateContext: ''
disableComponentGovernance: ''
artifactSuffix: ''
useCdacDumpCollectProvider: false

jobs:
- template: /eng/common/${{ parameters.templatePath }}/job/job.yml
Expand Down Expand Up @@ -94,15 +96,15 @@ jobs:

- template: /eng/pipelines/common/download-artifact-step.yml
parameters:
artifactName: SosRuntimeArtifacts_$(osGroup)$(osSubgroup)_$(archType)
artifactFileName: SosRuntimeArtifacts_$(osGroup)$(osSubgroup)_$(archType)$(archiveExtension)
artifactName: SosRuntimeArtifacts_$(osGroup)$(osSubgroup)_$(archType)${{ parameters.artifactSuffix }}
artifactFileName: SosRuntimeArtifacts_$(osGroup)$(osSubgroup)_$(archType)${{ parameters.artifactSuffix }}$(archiveExtension)
unpackFolder: $(Build.SourcesDirectory)/artifacts/runtime
displayName: 'SOS Runtime Artifacts'

- template: /eng/pipelines/common/download-artifact-step.yml
parameters:
artifactName: SosCdacArtifacts_$(osGroup)$(osSubgroup)_$(archType)
artifactFileName: SosCdacArtifacts_$(osGroup)$(osSubgroup)_$(archType)$(archiveExtension)
artifactName: SosCdacArtifacts_$(osGroup)$(osSubgroup)_$(archType)${{ parameters.artifactSuffix }}
artifactFileName: SosCdacArtifacts_$(osGroup)$(osSubgroup)_$(archType)${{ parameters.artifactSuffix }}$(archiveExtension)
unpackFolder: $(Build.SourcesDirectory)/artifacts/private-cdac
displayName: 'SOS cDAC Artifacts'

Expand Down Expand Up @@ -203,6 +205,12 @@ jobs:
HelixConfiguration: ${{ parameters.targetRid }}_${{ parameters.buildConfig }}
HelixTargetQueues: $(SOSHelixQueue)
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
# The enumerator replaces the legacy DAC; select cDAC on the Helix worker.
${{ if eq(parameters.useCdacDumpCollectProvider, true) }}:
${{ if eq(parameters.osGroup, 'windows') }}:
HelixPreCommands: set SOSHARNESS_ONLY_DAC=CDac
${{ else }}:
HelixPreCommands: export SOSHARNESS_ONLY_DAC=CDac
${{ if eq(variables['System.TeamProject'], 'public') }}:
Creator: dotnet-bot
${{ else }}:
Expand Down
143 changes: 74 additions & 69 deletions eng/pipelines/runtime-diagnostics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
# UnitTests + DataGeneratorTests projects (tools.cdactests
# subset). Independent of every other stage.
#
# SOSTests Per-platform Release runtime + cDAC build and SOS Helix
# submission. SOS.Tests covers both legacy DAC and cDAC
# modes. Independent of every other stage.
# SOSTests Per-platform Release builds with the legacy DAC and the
# EnumMemory provider, each with a matching SOS Helix submission.
# Legacy builds cover both DAC modes; EnumMemory uses cDAC only.
# Independent of every other stage.
#
# CdacTests Per-platform Checked runtime build + Dump / Stress /
# XPlatDumpGen / XPlatDumpTest legs in one stage. Each dump
Expand Down Expand Up @@ -146,81 +147,85 @@ extends:
testResultsFormat: 'xunit'

# ----------------------------------------------------------------------
# SOS tests. Each platform builds a Release runtime and matching universal
# cDAC/DBI, then submits the diagnostics SOS.Tests payload to Helix.
# SOS tests. Each platform builds legacy and EnumMemory Release runtimes with
# matching universal cDAC/DBI, then submits each SOS.Tests payload to Helix.
# ----------------------------------------------------------------------
- stage: SOSTests
dependsOn: []
jobs:
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
buildConfig: release
platforms: ${{ parameters.sosPlatforms }}
jobParameters:
nameSuffix: SOSBuild
buildArgs: -s clr+libs+tools.cdac+host -c $(_BuildConfig) -rc $(_BuildConfig) -lc $(_BuildConfig)
isOfficialBuild: ${{ variables.isOfficialBuild }}
timeoutInMinutes: 180
postBuildSteps:
- pwsh: |
$runtimeDirs = @(Get-ChildItem -Directory -Path "$(Build.SourcesDirectory)/artifacts/bin/testhost/net*-$(osGroup)-$(_BuildConfig)-$(archType)/shared/Microsoft.NETCore.App/*")
if ($runtimeDirs.Count -ne 1) {
throw "Expected one SOS runtime directory, but found $($runtimeDirs.Count)."
}

Write-Host "##vso[task.setvariable variable=sosRuntimeDir]$($runtimeDirs[0].FullName)"
# An empty suffix preserves the standard build and artifact names.
- ${{ each suffix in split(',_EnumMemory', ',') }}:
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
buildConfig: release
platforms: ${{ parameters.sosPlatforms }}
jobParameters:
nameSuffix: SOSBuild${{ suffix }}
buildArgs: -s clr+libs+tools.cdac+host -c $(_BuildConfig) -rc $(_BuildConfig) -lc $(_BuildConfig) /p:UseCdacDumpCollectProvider=${{ eq(suffix, '_EnumMemory') }}
isOfficialBuild: ${{ variables.isOfficialBuild }}
timeoutInMinutes: 180
postBuildSteps:
- pwsh: |
$runtimeDirs = @(Get-ChildItem -Directory -Path "$(Build.SourcesDirectory)/artifacts/bin/testhost/net*-$(osGroup)-$(_BuildConfig)-$(archType)/shared/Microsoft.NETCore.App/*")
if ($runtimeDirs.Count -ne 1) {
throw "Expected one SOS runtime directory, but found $($runtimeDirs.Count)."
}

$sourceDir = "$(Build.SourcesDirectory)/artifacts/bin/coreclr/$(osGroup).$(archType).$(_BuildConfig)"
$stagingDir = "$(Build.SourcesDirectory)/artifacts/sos-cdac"
New-Item -ItemType Directory -Force -Path $stagingDir | Out-Null
Write-Host "##vso[task.setvariable variable=sosRuntimeDir]$($runtimeDirs[0].FullName)"

$fileNames = switch ("$(osGroup)") {
"windows" { "mscordaccore_universal.dll", "mscordbi_universal.dll" }
"linux" { "libmscordaccore_universal.so", "libmscordbi_universal.so" }
"osx" { "libmscordaccore_universal.dylib", "libmscordbi_universal.dylib" }
default { throw "Unsupported OS group '$(osGroup)'." }
}
$sourceDir = "$(Build.SourcesDirectory)/artifacts/bin/coreclr/$(osGroup).$(archType).$(_BuildConfig)"
$stagingDir = "$(Build.SourcesDirectory)/artifacts/sos-cdac"
New-Item -ItemType Directory -Force -Path $stagingDir | Out-Null

foreach ($fileName in $fileNames) {
$source = Join-Path $sourceDir $fileName
if (-not (Test-Path -PathType Leaf $source)) {
throw "Required private cDAC file '$source' was not found."
$fileNames = switch ("$(osGroup)") {
"windows" { "mscordaccore_universal.dll", "mscordbi_universal.dll" }
"linux" { "libmscordaccore_universal.so", "libmscordbi_universal.so" }
"osx" { "libmscordaccore_universal.dylib", "libmscordbi_universal.dylib" }
default { throw "Unsupported OS group '$(osGroup)'." }
}

Copy-Item -Path $source -Destination $stagingDir
}
displayName: 'Find SOS Runtime and cDAC'
- template: /eng/pipelines/common/upload-artifact-step.yml
parameters:
rootFolder: $(sosRuntimeDir)
includeRootFolder: false
archiveType: $(archiveType)
archiveExtension: $(archiveExtension)
tarCompression: $(tarCompression)
artifactName: SosRuntimeArtifacts_$(osGroup)$(osSubgroup)_$(archType)
displayName: SOS Runtime Artifacts
- template: /eng/pipelines/common/upload-artifact-step.yml
parameters:
rootFolder: $(Build.SourcesDirectory)/artifacts/sos-cdac
includeRootFolder: false
archiveType: $(archiveType)
archiveExtension: $(archiveExtension)
tarCompression: $(tarCompression)
artifactName: SosCdacArtifacts_$(osGroup)$(osSubgroup)_$(archType)
displayName: SOS cDAC Artifacts
foreach ($fileName in $fileNames) {
$source = Join-Path $sourceDir $fileName
if (-not (Test-Path -PathType Leaf $source)) {
throw "Required private cDAC file '$source' was not found."
}

- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/diagnostics/sos-test-leg.yml
buildConfig: release
platforms: ${{ parameters.sosPlatforms }}
jobParameters:
nameSuffix: SOS
isOfficialBuild: ${{ variables.isOfficialBuild }}
timeoutInMinutes: 360
dependsOnGlobalBuilds:
- nameSuffix: SOSBuild
Copy-Item -Path $source -Destination $stagingDir
}
displayName: 'Find SOS Runtime and cDAC'
- template: /eng/pipelines/common/upload-artifact-step.yml
parameters:
rootFolder: $(sosRuntimeDir)
includeRootFolder: false
archiveType: $(archiveType)
archiveExtension: $(archiveExtension)
tarCompression: $(tarCompression)
artifactName: SosRuntimeArtifacts_$(osGroup)$(osSubgroup)_$(archType)${{ suffix }}
displayName: SOS Runtime Artifacts
- template: /eng/pipelines/common/upload-artifact-step.yml
parameters:
rootFolder: $(Build.SourcesDirectory)/artifacts/sos-cdac
includeRootFolder: false
archiveType: $(archiveType)
archiveExtension: $(archiveExtension)
tarCompression: $(tarCompression)
artifactName: SosCdacArtifacts_$(osGroup)$(osSubgroup)_$(archType)${{ suffix }}
displayName: SOS cDAC Artifacts

- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/diagnostics/sos-test-leg.yml
buildConfig: release
platforms: ${{ parameters.sosPlatforms }}
jobParameters:
nameSuffix: SOS${{ suffix }}
artifactSuffix: ${{ suffix }}
useCdacDumpCollectProvider: ${{ eq(suffix, '_EnumMemory') }}
isOfficialBuild: ${{ variables.isOfficialBuild }}
timeoutInMinutes: 360
dependsOnGlobalBuilds:
- nameSuffix: SOSBuild${{ suffix }}

# ----------------------------------------------------------------------
# cDAC dump + stress + xplat-dump-gen tests.
Expand Down Expand Up @@ -248,7 +253,7 @@ extends:
platforms: ${{ parameters.cdacDumpPlatforms }}
jobParameters:
nameSuffix: Build
buildArgs: -s clr+libs+tools.cdac+tools.cdacdumptests+tools.cdacstresstests -c $(_BuildConfig) -rc checked -lc $(_BuildConfig) /p:SkipDumpVersions=net10.0
buildArgs: -s clr+libs+tools.cdac+tools.cdacdumptests+tools.cdacstresstests -c $(_BuildConfig) -rc checked -lc $(_BuildConfig) /p:SkipDumpVersions=net10.0 /p:UseCdacDumpCollectProvider=true
isOfficialBuild: ${{ variables.isOfficialBuild }}
timeoutInMinutes: 180
postBuildSteps:
Expand Down
3 changes: 2 additions & 1 deletion src/coreclr/debug/createdump/crashinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ CrashInfo::CrashInfo(const CreateDumpOptions& options) :
m_crashThread(options.CrashThread),
m_signal(options.Signal),
m_exceptionRecord(options.ExceptionRecord),
m_runtimeBaseAddress(0),
m_contractDescriptorAddress(0),
m_moduleInfos(&ModuleInfoCompare),
m_mainModule(nullptr),
m_cbModuleMappings(0),
m_dataTargetPagesAdded(0),
m_enumMemoryPagesAdded(0)
{
g_crashInfo = this;
m_runtimeBaseAddress = 0;
#ifdef __APPLE__
m_task = 0;
#else
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/debug/createdump/crashinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class CrashInfo : public ICLRDataEnumMemoryRegionsCallback, public ICLRDataLoggi
siginfo_t m_siginfo; // signal info (if any)
std::string m_coreclrPath; // the path of the coreclr module or empty if none
uint64_t m_runtimeBaseAddress; // base address of the runtime module
uint64_t m_contractDescriptorAddress; // address of the runtime contract descriptor
#ifdef __APPLE__
vm_map_t m_task; // the mach task for the process
std::set<MemoryRegion> m_allMemoryRegions; // all memory regions on MacOS
Expand Down Expand Up @@ -123,6 +124,7 @@ class CrashInfo : public ICLRDataEnumMemoryRegionsCallback, public ICLRDataLoggi
inline const std::string& Name() const { return m_name; }
inline const ModuleInfo* MainModule() const { return m_mainModule; }
inline const uint64_t RuntimeBaseAddress() const { return m_runtimeBaseAddress; }
inline const uint64_t ContractDescriptorAddress() const { return m_contractDescriptorAddress; }

inline const std::vector<ThreadInfo*>& Threads() const { return m_threads; }
inline const std::set<ModuleRegion>& ModuleMappings() const { return m_moduleMappings; }
Expand Down
18 changes: 14 additions & 4 deletions src/coreclr/debug/createdump/crashinfomac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,17 +244,26 @@ void CrashInfo::VisitModule(MachOModule& module)
{
TRACE("TryLookupSymbol(" DACCESS_TABLE_SYMBOL ") FAILED\n");
}
if (module.TryLookupSymbol(CONTRACT_DESCRIPTOR_SYMBOL, &symbolAddress))
{
m_contractDescriptorAddress = symbolAddress;
}
}
else if (m_appModel == AppModelType::SingleFile)
{
uint64_t symbolAddress;
if (module.TryLookupSymbol("DotNetRuntimeInfo", &symbolAddress))
uint64_t runtimeInfoAddress;
if (module.TryLookupSymbol("DotNetRuntimeInfo", &runtimeInfoAddress))
{
m_coreclrPath = GetDirectory(module.Name());
m_runtimeBaseAddress = module.BaseAddress();
uint64_t contractDescriptorAddress;
if (module.TryLookupSymbol(CONTRACT_DESCRIPTOR_SYMBOL, &contractDescriptorAddress))
{
m_contractDescriptorAddress = contractDescriptorAddress;
}

RuntimeInfo runtimeInfo { };
if (ReadMemory(symbolAddress, &runtimeInfo, sizeof(RuntimeInfo)))
if (ReadMemory(runtimeInfoAddress, &runtimeInfo, sizeof(RuntimeInfo)))
{
if (strcmp(runtimeInfo.Signature, RUNTIME_INFO_SIGNATURE) == 0)
{
Expand All @@ -266,10 +275,11 @@ void CrashInfo::VisitModule(MachOModule& module)
else if (m_appModel == AppModelType::NativeAOT)
{
uint64_t symbolAddress;
if (module.TryLookupSymbol("DotNetRuntimeContractDescriptor", &symbolAddress))
if (module.TryLookupSymbol(CONTRACT_DESCRIPTOR_SYMBOL, &symbolAddress))
{
m_coreclrPath = GetDirectory(module.Name());
m_runtimeBaseAddress = module.BaseAddress();
m_contractDescriptorAddress = symbolAddress;
TRACE("Found valid NativeAOT runtime module\n");
}
}
Expand Down
Loading
Loading