-
Notifications
You must be signed in to change notification settings - Fork 536
[ETW] Fix infinite loop in ETWProvider::close #3827
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,4 +61,18 @@ TEST(ETWProvider, CheckCloseSuccess) | |
| ASSERT_FALSE(etw.is_registered(providerName)); | ||
| } | ||
|
|
||
| TEST(ETWProvider, CheckCloseInfiniteLoop) | ||
| { | ||
| std::string providerName1 = "Provider1"; | ||
| std::string providerName2 = "Provider2"; | ||
|
|
||
| static ETWProvider etw; | ||
| auto handle1 = etw.open(providerName1.c_str()); | ||
| auto handle2 = etw.open(providerName2.c_str()); | ||
|
|
||
| // This should not hang | ||
| etw.close(handle2); | ||
| etw.close(handle1); | ||
| } | ||
|
Comment on lines
+64
to
+94
|
||
|
|
||
| #endif | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test should include assertions to verify that the close operations succeeded. Currently, the test only verifies that it doesn't hang, but doesn't check if the operations completed successfully. Consider adding assertions to check the return values and provider registration status.