dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.27k stars 4.73k forks source link

ICorDebugGCReferenceEnum does not enumerate CorGCReferenceType::CorReferenceFinalizer #39333

Open WilliamXieMSFT opened 4 years ago

WilliamXieMSFT commented 4 years ago

Description

The finalizer queue segment enumeration appears to be not implemented. See here: https://github.com/dotnet/runtime/blob/master/src/coreclr/src/debug/daccess/dacdbiimpl.cpp#L7488, mFQStart/mFQEnd is set to null and never updated.

Configuration

This potentially affects all .NET Framework & Core (all versions). I tested using .NET 4.8.4180.0 on Windows 19041.329. This would affect both x86 and x64 configuration (not sure about ARM).

Regression?

N/A

Other information

Current workarounds would be to use CLRMD (via SOS & DAC) to get finalizer queue address start/end or leveraging ICorProfiler apis for Finalizer callbacks.

Dotnet-GitSync-Bot commented 4 years ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

WilliamXieMSFT commented 4 years ago

area-Diagnostics-coreclr @tommcdon

ghost commented 4 years ago

Tagging subscribers to this area: @tommcdon Notify danmosemsft if you want to be subscribed.

josalem commented 4 years ago

CC @dotnet/dotnet-diag @mikem8361

tommcdon commented 4 years ago

@davmason

davmason commented 4 years ago

I looked at this last week with @WilliamXieMSFT, it's just plain broken and there's no workaround to make the API work.

The options for getting finalizer references are: