perfview icon indicating copy to clipboard operation
perfview copied to clipboard

Initialization of EventPipeEventSource stucks with ServerGC

Open kripergvg opened this issue 6 years ago • 1 comments

I want to listen to GC events of another process. I have an initialization code like this

         var configuration = new SessionConfiguration((uint)1000,
                    EventPipeSerializationFormat.NetTrace,
                    new []{new Provider(RuntimeName,
                        (ulong) (ClrTraceEventParser.Keywords.GC | ClrTraceEventParser.Keywords.GCHeapAndTypeNames),
                        EventLevel.Informational)}
                );
                var binaryReader = EventPipeClient.CollectTracing(_processId, configuration, out _sessionId);
                var source = new EventPipeEventSource(binaryReader); 

When I run a monitored process with workstation GC everything is good but as soon as i change it to server GC the monitoring process gets stuck at ReadFileNative:677 image Stack trace image

dotnet --info

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.18362
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\3.0.100\

Host (useful for support):
  Version: 3.0.0
  Commit:  7d57652f33

.NET Core SDKs installed:
  2.2.402 [C:\Program Files\dotnet\sdk]
  3.0.100 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Simple reproduction https://github.com/kripergvg/EventPipeStuck

Upd: It works when I use as keywords (uint) (ClrTraceEventParser.Keywords.Threading | ClrTraceEventParser.Keywords.GC) and doesn't work when i use only (uint) (ClrTraceEventParser.Keywords.GC)

kripergvg avatar Nov 19 '19 09:11 kripergvg

Due to lack of recent activity, this issue has been labeled as 'stale'. It will be closed if no further activity occurs within 30 more days. Any new comment will remove the label.

github-actions[bot] avatar Nov 19 '25 14:11 github-actions[bot]