Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing TraceLoggingRegister calls #16467

Merged
merged 4 commits into from Dec 15, 2023
Merged

Conversation

lhecker
Copy link
Member

@lhecker lhecker commented Dec 13, 2023

17cc109 and e9de646 both made the same mistake: When cleaning up our
telemetry code they also removed the calls to TraceLoggingRegister
which also broke regular tracing. Windows Defender in particular uses
the "CookedRead" event to monitor for malicious shell commands.

This doesn't fix it the "right way", because destructors of statics
aren't executed when DLLs are unloaded. But I felt like that this is
fine because we have way more statics than that in conhost land,
all of which have the same kind of issue.

@lhecker lhecker added Product-Conhost For issues in the Console codebase Area-Interop Communication between processes Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) zInbox-Bug Ignore me! labels Dec 13, 2023
@lhecker lhecker added this to To Cherry Pick in Inbox Servicing Pipeline via automation Dec 13, 2023
TraceLoggingOptionMicrosoftTelemetry());

static const auto cleanup = []() {
TraceLoggingRegister(g_hConhostV2EventTraceProvider);
Copy link
Member

Choose a reason for hiding this comment

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

can we not register this in WinMain()? Since we're inside host and all.

Copy link
Member Author

Choose a reason for hiding this comment

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

We could do that! I assume you would prefer that?

Copy link
Member

Choose a reason for hiding this comment

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

feels less "weird", but for no good reason.

@DHowett DHowett added this to To Cherry Pick in 1.19 Servicing Pipeline via automation Dec 13, 2023
@DHowett
Copy link
Member

DHowett commented Dec 15, 2023

Unfortunately, this has exploded Audit Mode

@DHowett DHowett enabled auto-merge (squash) December 15, 2023 22:55
@DHowett DHowett merged commit a65d5f3 into main Dec 15, 2023
19 of 20 checks passed
@DHowett DHowett deleted the dev/lhecker/register-tracing branch December 15, 2023 23:29
@DHowett DHowett moved this from To Cherry Pick to Rejected in 1.19 Servicing Pipeline Dec 15, 2023
@DHowett DHowett moved this from Rejected to To Cherry Pick in 1.19 Servicing Pipeline Jan 29, 2024
@DHowett DHowett moved this from To Cherry Pick to Cherry Picked in 1.19 Servicing Pipeline Jan 29, 2024
DHowett pushed a commit that referenced this pull request Jan 29, 2024
17cc109 and e9de646 both made the same mistake: When cleaning up our
telemetry code they also removed the calls to `TraceLoggingRegister`
which also broke regular tracing. Windows Defender in particular uses
the "CookedRead" event to monitor for malicious shell commands.

This doesn't fix it the "right way", because destructors of statics
aren't executed when DLLs are unloaded. But I felt like that this is
fine because we have way more statics than that in conhost land,
all of which have the same kind of issue.

(cherry picked from commit a65d5f3)
Service-Card-Id: 91337330
Service-Version: 1.19
@DHowett DHowett moved this from Cherry Picked to Validated in 1.19 Servicing Pipeline Feb 21, 2024
@DHowett DHowett moved this from Validated to Shipped in 1.19 Servicing Pipeline Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Interop Communication between processes Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Product-Conhost For issues in the Console codebase zInbox-Bug Ignore me!
Development

Successfully merging this pull request may close these issues.

None yet

3 participants