Skip to content

Conversation

@cshung
Copy link
Contributor

@cshung cshung commented Sep 1, 2022

In #74363, we changed the code in gc.cpp such that memset (&last_ephemeral_gc_info, 0, sizeof (last_ephemeral_gc_info)); is replaced by last_ephemeral_gc_info = {};

last_ephemeral_gc_info has type Volatile<size_t> and the default constructor of Volatile leave the underlying value uninitialized, this is causing the issue. In the old code, the volatile field was zero-initialized but in the new code, it isn't.

This change added back the default initialization for the volatile field and the issue associated with #74631 is fixed.

All GC code related to this change is reviewed and I confirm volatile is the only issue.

@cshung cshung self-assigned this Sep 1, 2022
@ghost
Copy link

ghost commented Sep 1, 2022

Tagging subscribers to this area: @dotnet/gc
See info in area-owners.md if you want to be subscribed.

Issue Details

Adding some instrumentation so that we can debug #74631.

Author: cshung
Assignees: cshung
Labels:

area-GC-coreclr

Milestone: -

@cshung cshung force-pushed the public/test-instrumentation branch 5 times, most recently from 0cd0d9a to b5250df Compare September 16, 2022 23:15
@cshung cshung force-pushed the public/test-instrumentation branch from b5250df to 6b4aee0 Compare September 19, 2022 19:04
@cshung cshung changed the title Test instrumentation Initialize Volatile value Sep 19, 2022
@cshung cshung requested review from am11 and jkotas and removed request for am11 September 19, 2022 19:52
@jkotas
Copy link
Member

jkotas commented Sep 19, 2022

We also have a copy for local GC here:

https://github.com/dotnet/runtime/blob/main/src/coreclr/gc/env/volatile.h

@cshung cshung linked an issue Sep 19, 2022 that may be closed by this pull request
@cshung cshung merged commit 001c1b1 into dotnet:main Sep 20, 2022
@cshung cshung deleted the public/test-instrumentation branch September 20, 2022 05:08
@ghost ghost locked as resolved and limited conversation to collaborators Oct 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test failure System.Tests.GCExtendedTests.GetGCMemoryInfo Test failure GC\\API\\GC\\GetTotalPauseDuration\\GetTotalPauseDuration.cmd

3 participants