Skip to content

Conversation

@Maoni0
Copy link
Member

@Maoni0 Maoni0 commented Jul 18, 2025

fixes #115420. please see description of the problem in that issue.

The key problem is that ETW doesn't guarantee the handle is initialized prior to running the callback. Trying to use the handle in the callback as an identifier doesn't work. Instead of the handle we can use the CONTEXT address which is already initialized at that time.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue where events from private ETW providers are not fired if a process starts after event collection begins. The fix changes how provider handles are compared in the ETW callback logic by comparing against the EtwProvider context directly rather than using RegistrationHandle.

Key changes:

  • Updates provider handle comparison logic to use EtwProvider context instead of RegistrationHandle
  • Adds missing stress trace handle declaration and usage
  • Refactors if-else chain formatting for consistency

@Maoni0 Maoni0 enabled auto-merge (squash) July 18, 2025 21:21
@Maoni0
Copy link
Member Author

Maoni0 commented Jul 22, 2025

/ba-g dotnet/dnceng#6004

@Maoni0 Maoni0 merged commit 082123b into dotnet:main Jul 22, 2025
96 of 99 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 21, 2025
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.

private provider not correctly initialized when starting process after etw session is started

2 participants