From f170db722be6fb695ca229bcbe46be0caa8b3a48 Mon Sep 17 00:00:00 2001 From: Mike McLaughlin Date: Wed, 1 Jul 2020 19:30:12 -0700 Subject: [PATCH] Fix SOS/managed debugging failures from PR #36847 (#38689) Add PAL_GetApplicationGroupId() that returns null for Linux. --- src/coreclr/src/pal/inc/pal.h | 2 -- src/coreclr/src/pal/src/thread/process.cpp | 14 +++++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/coreclr/src/pal/inc/pal.h b/src/coreclr/src/pal/inc/pal.h index b7303bfe80a147..5154159b4b72be 100644 --- a/src/coreclr/src/pal/inc/pal.h +++ b/src/coreclr/src/pal/inc/pal.h @@ -449,12 +449,10 @@ BOOL PALAPI PAL_NotifyRuntimeStarted(); -#ifdef __APPLE__ PALIMPORT LPCSTR PALAPI PAL_GetApplicationGroupId(); -#endif static const unsigned int MAX_DEBUGGER_TRANSPORT_PIPE_NAME_LENGTH = MAX_PATH; diff --git a/src/coreclr/src/pal/src/thread/process.cpp b/src/coreclr/src/pal/src/thread/process.cpp index ee1e759087da3e..c0d8bc90dc7476 100644 --- a/src/coreclr/src/pal/src/thread/process.cpp +++ b/src/coreclr/src/pal/src/thread/process.cpp @@ -2011,12 +2011,7 @@ PAL_NotifyRuntimeStarted() _ASSERTE(ret == TRUE || processIdDisambiguationKey == 0); UnambiguousProcessDescriptor unambiguousProcessDescriptor(gPID, processIdDisambiguationKey); - LPCSTR applicationGroupId = -#ifdef __APPLE__ - PAL_GetApplicationGroupId(); -#else - nullptr; -#endif + LPCSTR applicationGroupId = PAL_GetApplicationGroupId(); CreateSemaphoreName(startupSemName, RuntimeStartupSemaphoreName, unambiguousProcessDescriptor, applicationGroupId); CreateSemaphoreName(continueSemName, RuntimeContinueSemaphoreName, unambiguousProcessDescriptor, applicationGroupId); @@ -2066,14 +2061,19 @@ PAL_NotifyRuntimeStarted() return launched; } -#ifdef __APPLE__ LPCSTR PALAPI PAL_GetApplicationGroupId() { +#ifdef __APPLE__ return gApplicationGroupId; +#else + return nullptr; +#endif } +#ifdef __APPLE__ + // We use 7bits from each byte, so this computes the extra size we need to encode a given byte count constexpr int GetExtraEncodedAreaSize(UINT rawByteCount) {