Skip to content
Merged
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
1 change: 1 addition & 0 deletions eng/pipelines/runtime-diagnostics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ pr:
- eng/pipelines/**
- src/native/managed/cdac/**
- src/coreclr/debug/runtimeinfo/**
- src/coreclr/vm/cdacstress.cpp

extends:
template: /eng/pipelines/common/templates/pipeline-with-resources.yml
Expand Down
8 changes: 6 additions & 2 deletions src/coreclr/vm/cdacstress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,9 @@ void CdacStressPolicy::Shutdown()
if (!s_initialized)
return;

CrstHolder cdacLock(&s_cdacLock);
s_initialized = false;
Comment thread
max-charlamb marked this conversation as resolved.

Comment thread
max-charlamb marked this conversation as resolved.
// Print summary to stderr so results are always visible
LONG totalVerifications = s_passCount + s_failCount + s_knownIssueCount;
fprintf(stderr,
Expand Down Expand Up @@ -652,7 +655,6 @@ void CdacStressPolicy::Shutdown()
s_cdacHandle = 0;
}
Comment thread
max-charlamb marked this conversation as resolved.

s_initialized = false;
s_cdacStressLevel = 0;
LOG((LF_GCROOTS, LL_INFO10, "CDAC GC Stress: Shutdown complete\n"));
}
Expand Down Expand Up @@ -1776,14 +1778,16 @@ static void VerifyArgIteratorOnStack(Thread* pThread)

static void VerifyAtStressPoint(Thread* pThread, PCONTEXT regs)
{
_ASSERTE(s_initialized);
_ASSERTE(pThread != nullptr);
_ASSERTE(regs != nullptr);

// Serialize cDAC access — the cDAC's ProcessedData cache and COM interfaces
// are not thread-safe, and GC stress can fire on multiple threads.
CrstHolder cdacLock(&s_cdacLock);

if (!s_initialized)
return;

DWORD osThreadId = pThread->GetOSThreadId();

// Each sub-check below is gated independently on its CDACSTRESS_* WHAT bit.
Expand Down
Loading