Stop using m_summary
in the global globals for telemetry
#2820
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We were observing crashes in
TelemetryTraceLogger::LogFailure()
due to heap corruption. The root cause of this is that for many types of COM calls we don't have a thread local telemetry trace logger, but instead use a process global. If there are multiple simultaneous calls, there is a possibility for a race condition, specifically around writing to theTelemetryTraceLogger
'sm_summary
.The long term solution would be to stop using a process globals there, but that is tricky. As a band-aid to prevent these crashes, disable the use of
m_summary
in the process globals.Tested by creating a local repro of the crash and verifying it didn't crash after the change. Repro'd by adding an artificial
THROW_HR_MSG
to force going toLogFailure()
and then using the sample COM caller project to generate many simultaneous calls that would hit it.Credit to @JohnMcPMS for figuring out the issue and the fix :)
Related to #1880
Microsoft Reviewers: Open in CodeFlow