From: Mike McLaughlin Date: Tue, 20 Sep 2016 22:22:33 +0000 (-0700) Subject: Fix launch timing issue in dbgshim found in VS. (#7279) X-Git-Tag: accepted/tizen/base/20180629.140029~3540 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f29eee4896d490f88e06865916d5821d0fad935a;p=platform%2Fupstream%2Fcoreclr.git Fix launch timing issue in dbgshim found in VS. (#7279) Issue #7274. --- diff --git a/src/dlls/dbgshim/dbgshim.cpp b/src/dlls/dbgshim/dbgshim.cpp index 3c4e951..4d6dc5a 100644 --- a/src/dlls/dbgshim/dbgshim.cpp +++ b/src/dlls/dbgshim/dbgshim.cpp @@ -392,7 +392,7 @@ public: int numTries = 0; HRESULT hr; - while (numTries < 10) + while (numTries < 25) { // EnumerateCLRs uses the OS API CreateToolhelp32Snapshot which can return ERROR_BAD_LENGTH or // ERROR_PARTIAL_COPY. If we get either of those, we try wait 1/10th of a second try again (that @@ -517,7 +517,9 @@ public: bool coreclrExists = false; HRESULT hr = InvokeStartupCallback(&coreclrExists); - if (SUCCEEDED(hr)) + // Because the target process is suspended on create, the toolhelp apis fail with the below errors even + // with the retry logic in InternalEnumerateCLRs. + if (SUCCEEDED(hr) || (hr == HRESULT_FROM_WIN32(ERROR_PARTIAL_COPY)) || (hr == HRESULT_FROM_WIN32(ERROR_BAD_LENGTH))) { if (!coreclrExists && !m_canceled) {