Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlateralusX <lateralusx.github@gmail.com>2017-08-23 11:38:56 +0300
committerlateralusX <lateralusx.github@gmail.com>2017-09-25 16:41:32 +0300
commit76640001ebd9d400a59c78cf98d29c4616f6fd2e (patch)
treedaeb4046e8a8ec14ce0b0475ba34b02a53e81d43 /msvc/libmonoutils.vcxproj.filters
parent878b260edc6eefc7ec36244f8a30af6aa475fcf8 (diff)
Fix sporadic hang in Mono.Debugger.Soft test suite on Windows.
Mono.Debugger.Soft has low frequency hangs in InspectThreadSuspenedOnWaitOne test. This method launch the debuggee (dtest-app.exe), sets a breakpoint on a method just doing an infinite OS wait, validate that the breakpoint gets hit and resumes debuggee. After resume from breakpoint debuggee will hit the infinite OS wait and the debugger test will suspend and shutdown the process. In order for mono debugger to handle the shutdown request it will suspend all managed threads using mono_thread_suspend_all_other_threads. This method uses a pooling schema until all threads have reported that they are suspended. Since one of the threads are doing an infinite OS wait we entered the land of APC (Asynchron Procedure Calls) used on Windows to alert waitable threads. The reason for the hang is the fact that the OS won’t return from the wait until all queued APC’s have been executed. Since the loop sending async suspend requests to the threads mono_thread_suspend_all_other_threads can run faster (including suspending/resuming the thread that need to consume APC’s in the process) then the dequeue and execute of the queued APC’s, the wait won’t break, meaning that the thread won’t be able to set the mono suspend state causing the mono_thread_suspend_all_other_threads to run forever. This is highly timing dependent and will only reproduce sporadic, but I was able to isolate and do a solid repro locally while working on the fix. The fix makes sure we don’t post a new suspend APC if there is already one in flight with a pending unhandled interruption. This will make sure we won’t flood the APC queue on Windows preventing the thread from suspending.
Diffstat (limited to 'msvc/libmonoutils.vcxproj.filters')
-rw-r--r--msvc/libmonoutils.vcxproj.filters12
1 files changed, 9 insertions, 3 deletions
diff --git a/msvc/libmonoutils.vcxproj.filters b/msvc/libmonoutils.vcxproj.filters
index a8b85cafce8..e4b82690a18 100644
--- a/msvc/libmonoutils.vcxproj.filters
+++ b/msvc/libmonoutils.vcxproj.filters
@@ -193,6 +193,9 @@
<ClCompile Include="..\mono\utils\mono-os-mutex.c">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\mono\utils\mono-os-wait-win32.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\mono\utils\atomic.h">
@@ -417,9 +420,12 @@
<ClInclude Include="..\mono\utils\os-event.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="..\mono\utils\unlocked.h">
- <Filter>Header Files</Filter>
- </ClInclude>
+ <ClInclude Include="..\mono\utils\unlocked.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\mono\utils\mono-os-wait.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="Header Files">