Skip to content

Sometimes testhost/CoreRun crashes with System.Diagnostics.Tracing-related assertion failure #92519

@karakasa

Description

@karakasa

Description

testhost/CoreRun sometimes crashes for a blank console app.

Reproduction Steps

  1. Clone the latest repo and build it using build -rc Debug.
  2. Use testhost\CoreRun to run a blank Console App (dll).

The crash doesn't always happen.

Expected behavior

CoreRun runs without issues.

Actual behavior

CoreRun crashes.

stack
Process terminated. Assertion failed.
   at System.Diagnostics.Tracing.CounterGroup.OnEventSourceCommand(Object sender, EventCommandEventArgs e)
   at System.Diagnostics.Tracing.EventSource.add_EventCommandExecuted(EventHandler`1 value)
   at System.Diagnostics.Tracing.CounterGroup.RegisterCommandCallback()
   at System.Diagnostics.Tracing.CounterGroup..ctor(EventSource eventSource)
   at System.Diagnostics.Tracing.CounterGroup.GetCounterGroup(EventSource eventSource)
   at System.Diagnostics.Tracing.DiagnosticCounter.Publish()
   at System.Diagnostics.Tracing.PollingCounter..ctor(String name, EventSource eventSource, Func`1 metricProvider)
   at System.Diagnostics.Tracing.RuntimeEventSource.OnEventCommand(EventCommandEventArgs command)
   at System.Diagnostics.Tracing.EventSource.DoCommand(EventCommandEventArgs commandArgs)
   at System.Diagnostics.Tracing.EventSource.Initialize(Guid eventSourceGuid, String eventSourceName, String[] traits)
   at System.Diagnostics.Tracing.EventSource..ctor(Guid eventSourceGuid, String eventSourceName, EventSourceSettings settings, String[] traits)
   at System.Diagnostics.Tracing.RuntimeEventSource..ctor()
   at System.Diagnostics.Tracing.RuntimeEventSource.Initialize()
   at System.StartupHookProvider.ManagedStartup(Char* pDiagnosticStartupHooks)

Regression?

I never run into such issues in the past half a year. It started after I updated the local repo to the latest last afternoon.

Known Workarounds

Rebooting Windows usually resolves the issue. But sometimes it occurs again after a period of usage.

Configuration

Local .NET: 8 RC1
OS: Windows 10 x64 22H2

Other information

Visual Studio debugger shows the assertion here fails.

Debug.Assert(e.Command == EventCommand.Enable || e.Command == EventCommand.Disable);

image

the unhandled Update seems coming from:

ControllerCommand command = ControllerCommand.Update;

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions