Fix concurrent publication of interface GUID cache entries - #134360
Conversation
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Tagging subscribers to this area: @agocke |
Co-authored-by: AaronRobinsonMSFT <30635565+AaronRobinsonMSFT@users.noreply.github.com>
|
@copilot Please verify in the surrounding code all readers go through |
Verified all tracked-file references to
Direct |
|
/cc @dotnet/interop-contrib |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Add regression coverage for cold concurrent GUID publication and marshalling.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
What changed in this PR
Fixes concurrent publication of CoreCLR interface GUID cache entries using acquire/release ordering.
Changes:
- Adds
VolatileLoadfor live readers. - Adds
VolatileStorefor publishers. - Preserves DAC behavior and cache ownership semantics.
| File | Description |
|---|---|
src/coreclr/vm/class.h |
Adds ordered GUID cache publication and consumption. |
|
@copilot Please investigate the failures on loongarch. |
Investigated. The loongarch64 failure is unrelated to this PR: build https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=1609481&view=logs&jobId=b6c7d770-02f1-5c1e-1770-09d092567592 fails during "Build product" while linking the cross-compiled This is an |
|
/ba-g Unrelated failure. |

CoreCLR publishes cached interface GUIDs without ordering payload initialization before concurrent reads. After global ComWrappers marshalling registration on Windows, a reader could pass an incompletely initialized IID to
QueryInterface, causing a spurious marshalling exception; this is source-analysis-backed, not dynamically reproduced.VolatileStoreinSetGuidInfoandVolatileLoadin live-processGetGuidInfo, ensuring both the GUID and generation classification are visible before consumption.