[release/6.0] Fix unmatched transition callback in JIT_ReversePInvokeExitTrackTransitions #59939
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.
Backport of #59919 to release/6.0
/cc @AaronRobinsonMSFT @k15tfu @jkoritzinsky
This was regressed in #46238 (which was merged, GitHub's display is buggy), and was missed due to the fact that we have limited/no profiler tests in the dotnet/runtime repo. Additionally, this transition notification API is only used by some profilers, so it's possible that the profilers we test with didn't notice the bug.
Customer Impact
Users of
ICorProfilerCallback::ManagedToUnmanagedTransition
will be triggered incorrectly when being notified of the transition from managed to unmanaged when leaving a reverse P/Invoke.Since this is in the
ICorProfilerCallback
interface and that is used in many scenarios that are considered business priority by Microsoft this would appear to be a priority fix.Testing
Fix was provided by and validated by an external user. Upon code inspection by Interop team the fix was obviously correct and represented a copy/paste error.
Risk
Minimal. The correct callback is now being called instead of the incorrect one. This only impacts scenarios using
ICorProfilerCallback::ManagedToUnmanagedTransition
.