From c1bbdae7964b19b7063074d36e6af960f0cdc3a0 Mon Sep 17 00:00:00 2001 From: "Victor \"Nate\" Graf" Date: Tue, 2 Jan 2018 09:47:20 -0800 Subject: Retry: Enable EventPipe across Unix and Windows (#15611) * Revert "Revert "Enable EventPipe across Unix and Windows (#14772)" (#15609)" This reverts commit 302005ca8ae14eade37ddf4ac6e900617c1c166a. * Fix ARM build break * Use more explicit references to resolve build failures * Fix compat with python3 * Disable FeaturePerfTracing on Windows as it is not ready * Disable test for incomplete functionality * Fix test diabled patterns * Add license header * Use keyword types for managed code * Add message prefix * More precisly condition generation of eventing sources * Remove erroneously added changes --- src/vm/eventpipeprovider.cpp | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) (limited to 'src/vm/eventpipeprovider.cpp') diff --git a/src/vm/eventpipeprovider.cpp b/src/vm/eventpipeprovider.cpp index c10dd33638..84a90e4abb 100644 --- a/src/vm/eventpipeprovider.cpp +++ b/src/vm/eventpipeprovider.cpp @@ -24,6 +24,7 @@ EventPipeProvider::EventPipeProvider(EventPipeConfiguration *pConfig, const SStr m_providerName = providerName; m_enabled = false; + m_deleteDeferred = false; m_keywords = 0; m_providerLevel = EventPipeEventLevel::Critical; m_pEventList = new SList>(); @@ -36,8 +37,8 @@ EventPipeProvider::~EventPipeProvider() { CONTRACTL { - THROWS; - GC_NOTRIGGER; + NOTHROW; + GC_TRIGGERS; MODE_ANY; } CONTRACTL_END; @@ -45,21 +46,30 @@ EventPipeProvider::~EventPipeProvider() // Free all of the events. if(m_pEventList != NULL) { - // Take the lock before manipulating the list. - CrstHolder _crst(EventPipe::GetLock()); - - SListElem *pElem = m_pEventList->GetHead(); - while(pElem != NULL) + // We swallow exceptions here because the HOST_BREAKABLE + // lock may throw and this destructor gets called in throw + // intolerant places. If that happens the event list will leak + EX_TRY { - EventPipeEvent *pEvent = pElem->GetValue(); - delete pEvent; + // Take the lock before manipulating the list. + CrstHolder _crst(EventPipe::GetLock()); + + SListElem *pElem = m_pEventList->GetHead(); + while(pElem != NULL) + { + EventPipeEvent *pEvent = pElem->GetValue(); + delete pEvent; + + SListElem *pCurElem = pElem; + pElem = m_pEventList->GetNext(pElem); + delete pCurElem; + } - SListElem *pCurElem = pElem; - pElem = m_pEventList->GetNext(pElem); - delete pCurElem; + delete m_pEventList; } + EX_CATCH { } + EX_END_CATCH(SwallowAllExceptions); - delete m_pEventList; m_pEventList = NULL; } } -- cgit v1.2.3