From e23ea61503b2d7b724a7976201dd9e44001622ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rivero?= Date: Wed, 26 Jun 2019 09:45:47 -0700 Subject: Fix disabling wrong session on EventPipe::Shutdown (#25409) - It's safe to call EventPipe::Disable during shutdown (eventpipe being disabled) --- src/vm/eventpipe.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/vm') diff --git a/src/vm/eventpipe.cpp b/src/vm/eventpipe.cpp index 92d2875c04..670c38692d 100644 --- a/src/vm/eventpipe.cpp +++ b/src/vm/eventpipe.cpp @@ -143,7 +143,7 @@ void EventPipe::Shutdown() { EventPipeSession *pSession = s_pSessions[i].Load(); if (pSession) - Disable(static_cast(1ULL << i)); + Disable(reinterpret_cast(pSession)); } // dotnet/coreclr: issue 24850: EventPipe shutdown race conditions @@ -327,7 +327,7 @@ void EventPipe::DisableInternal(EventPipeSessionID id, EventPipeProviderCallback } CONTRACTL_END; - if (!Enabled() || !IsSessionIdInCollection(id)) + if (!IsSessionIdInCollection(id)) return; // If the session was not found, then there is nothing else to do. -- cgit v1.2.3