Conversation
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
…ockCleanupInfo_RCWLockBitMasked tests Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
...ive/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/SyncBlock_1.cs
Show resolved
Hide resolved
Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
… COM data Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
…ct delegates to it; update docs Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
|
@copilot please apply the following patch. |
…to factory, simplify null checks Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
Applied in b2c0797. Key changes from the patch:
|
There was a problem hiding this comment.
Pull request overview
This PR implements the GetSyncBlockCleanupData API in the cDAC (Contracts Data for Diagnostics). It also fixes a pre-existing behavior discrepancy: the legacy C++ implementation incorrectly returned E_INVALIDARG for addr=0, while the API contract specifies that addr=0 should start cleanup list traversal from SyncBlockCache.m_pCleanupBlockList. Additionally, it refactors GetBuiltInComData to work directly from a sync block pointer, enabling safe access during cleanup when the associated managed object may not be valid.
Changes:
- Adds
GetSyncBlockFromCleanupList(),GetNextSyncBlock(), andGetBuiltInComData(TargetPointer syncBlock, ...)to theISyncBlockinterface andSyncBlock_1implementation - Refactors
Object_1.GetBuiltInComDatato delegate to the SyncBlock contract, and moves the sync block bit constants (SyncBlockIsHashOrSyncBlockIndex,SyncBlockIsHashCode,SyncBlockIndexMask) to runtime globals exposed via the data descriptor - Adds
GetSyncBlockCleanupDataimplementation inSOSDacImplusing the new SyncBlock contract APIs, and updatesGetSyncBlockDatato usesyncBlock.GetBuiltInComDatadirectly
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
ISyncBlock.cs |
Adds three new cleanup-list and COM-data interface methods |
SyncBlock_1.cs |
Implements new methods; receives syncBlockLinkOffset for list pointer arithmetic |
SyncBlockFactory.cs |
Computes and passes syncBlockLinkOffset to SyncBlock_1 |
Object_1.cs |
Removes SyncBlockValue nested class; reads bit constants from runtime globals; delegates GetBuiltInComData to ISyncBlock |
SOSDacImpl.cs |
Implements GetSyncBlockCleanupData; updates GetSyncBlockData to use SyncBlock contract |
ISOSDacInterface.cs |
Adds DacpSyncBlockCleanupData struct; updates GetSyncBlockCleanupData signature |
Constants.cs |
Adds three new SyncBlock* global name constants |
SyncBlockCache.cs |
Adds CleanupBlockList field |
datadescriptor.inc |
Exposes SyncBlockCache.CleanupBlockList and three bit constants as globals |
syncblk.h |
Adds CleanupBlockList to cdac_data<SyncBlockCache> |
request.cpp |
Removes syncBlock == 0 from E_INVALIDARG guard |
SyncBlockTests.cs |
New unit tests for cleanup list traversal and COM data |
MockDescriptors.SyncBlock.cs |
New test descriptor for SyncBlock cleanup list |
MockDescriptors.Object.cs |
Adds three new globals to Object mock |
MockDescriptors.cs |
Adds CleanupBlockList to SyncBlockCacheFields |
SyncBlock.md |
Documents new APIs, data descriptors |
Object.md |
Documents new globals and delegation pattern |
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.cs
Show resolved
Hide resolved
src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.SyncBlock.cs
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
...anaged/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/SyncBlockFactory.cs
Show resolved
Hide resolved
...native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Object_1.cs
Show resolved
Hide resolved
|
@copilot do you know why the build and test is stalling https://dev.azure.com/dnceng-public/public/_build/results?buildId=1316850 |
The build isn't stalled — it spent about 7+ hours in the queue (queued at 21:44 UTC, started running at ~04:58 UTC) and has been executing normally since then. As of now, 5 of 7 jobs have completed successfully; the remaining 2 ( Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
/ba-g unrelated fails |
Implements
GetSyncBlockCleanupDataandGetSyncBlockDatain the cDAC. COM data is read directly from the sync block pointer (not via the object header) since objects on the cleanup list may not be valid managed objects.Changes
SyncBlock_1— addsGetSyncBlockFromCleanupList(),GetNextSyncBlock(TargetPointer), andGetBuiltInComData(TargetPointer, ...)for cleanup-list traversal and COM data reads directly from a sync blockSOSDacImpl.GetSyncBlockCleanupData—addr==0walks from cleanup list head;addr!=0reads the block at that pointer; both paths useSyncBlock.GetBuiltInComDatadirectlySOSDacImpl.GetSyncBlockData— usesSyncBlockcontract methods directly instead of going through the object headerGetAdditionalThreadCount— returns 0 (conditional weak table traversal is a TODO)SLink— removed from the managed type system (DataType.SLink,Data/SLink.cs);LinkNextencodes the field offset directly inSyncBlockFactory, eliminating the need for a separateSLinktypeSyncBlockTestscovering cleanup-list traversal (single/multi-item, last-item-returns-null) andGetBuiltInComDatawith/without interop infoWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/dotnet/diagnostics/contents/src/tests/SOS/usr/bin/curl curl -s REDACTED(http block)https://api.github.com/search/code/usr/bin/curl curl -s REDACTED(http block)If you need me to access, download, or install something from one of these locations, you can either:
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.