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

Fix sync issue in profiler tests #46907

Merged
merged 1 commit into from
Jan 13, 2021
Merged

Conversation

davmason
Copy link
Member

Fixes #46844

The macros introduced with #46739 had a bug. Because I was on autopilot and used do{...} while(0) in the macros, it introduced a new scope and the ShutdownGuard class would not be held for the duration of the call. I did test it, since it prevented new calls from entering the profiler code it drastically reduced the hit rate but there still was a race condition.

@davmason davmason added this to the 6.0.0 milestone Jan 13, 2021
@davmason davmason requested a review from a team January 13, 2021 08:50
@davmason davmason self-assigned this Jan 13, 2021
@ghost
Copy link

ghost commented Jan 13, 2021

Tagging subscribers to this area: @tommcdon
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes #46844

The macros introduced with #46739 had a bug. Because I was on autopilot and used do{...} while(0) in the macros, it introduced a new scope and the ShutdownGuard class would not be held for the duration of the call. I did test it, since it prevented new calls from entering the profiler code it drastically reduced the hit rate but there still was a race condition.

Author: davmason
Assignees: davmason
Labels:

area-Diagnostics-coreclr

Milestone: 6.0.0

@@ -307,8 +307,6 @@ HRESULT STDMETHODCALLTYPE SlowPathELTProfiler::LeaveCallback(FunctionIDOrClientI

HRESULT STDMETHODCALLTYPE SlowPathELTProfiler::TailcallCallback(FunctionIDOrClientID functionIdOrClientID, COR_PRF_ELT_INFO eltInfo)
{
SHUTDOWNGUARD();
Copy link
Member Author

Choose a reason for hiding this comment

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

This is superfluous since it's already protected in TailcallStub above.

@davmason davmason linked an issue Jan 13, 2021 that may be closed by this pull request
@davmason davmason merged commit fd744a8 into dotnet:master Jan 13, 2021
@davmason davmason deleted the profiler_sync_2 branch January 20, 2021 08:58
@ghost ghost locked as resolved and limited conversation to collaborators Feb 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants