gecko-dev/testing/cppunittest.toml
Yannis Juglaret 072d3d69de Bug 1839299 - Use a finer-grained strategy to protect RtlLookupFunctionEntry against deadlocks. r=win-reviewers,rkraesig
On 64-bit Windows (x86_64, aarch64), stack walking relies on
RtlLookupFunctionEntry to navigate from one frame to the next. This
function acquires up to two ntdll internal locks when it is called.

The profiler and the background hang monitor both need to walk the
stacks of suspended threads. This can lead to deadlock situations,
which so far we have avoided with stack walk suppressions. We guard some
critical paths to mark them as suppressing stack walk, and we forbid
stack walking when any thread is currently on such path.

While stack walk suppression has helped remove most deadlock situations,
some can remain because it is hard to detect and manually annotate all
the paths that could lead to a deadlock situation. Another drawback is
that stack walk suppression disables stack walking for much larger
portions of code than required. For example, we disable stack walking
for LdrLoadDll, so we cannot collect stacks while we are loading a DLL.
Yet, the lock that could lead to a deadlock situation is only held
during a very small portion of the whole time spent in LdrLoadDll.

This patch addresses these two issues by implementing a finer-grained
strategy to avoid deadlock situations. We acquire the pointers to the
internel ntdll locks through a single-stepped execution of
RtlLookupFunctionEntry. This allows us to try to acquire the locks
non-blockingly so that we can guarantee safe stack walking with no
deadlock.

If we fail to collect pointers to the locks, we fall back to using stack
walk suppressions like before. This way we get the best of both worlds:
if we are confident that the situation is under control, we will use the
new strategy and get better profiler accuracy and no deadlock; in case
of doubt, we can still use the profiler thanks to stack walk
suppressions.

Differential Revision: https://phabricator.services.mozilla.com/D223498
2024-10-17 13:47:04 +00:00

193 lines
2.4 KiB
TOML

[DEFAULT]
["ShowSSEConfig"]
["TestAlgorithm"]
["TestArray"]
["TestArrayUtils"]
["TestAtomicBitfields"]
["TestAtomics"]
["TestBaseProfiler"]
skip-if = ["tsan"] # Bug 1804081
["TestBinarySearch"]
["TestBitSet"]
["TestBloomFilter"]
["TestBufferList"]
["TestCasting"]
["TestCeilingFloor"]
["TestCheckedInt"]
["TestCompactPair"]
["TestCountPopulation"]
["TestCountZeroes"]
["TestCrossProcessWin"]
run-if = ["os == 'win'"]
["TestDefineEnum"]
["TestDllBlocklistAssumptions"]
run-if = ["os == 'win'"]
["TestDllInterceptor"]
run-if = ["os == 'win'"]
["TestDllInterceptorCrossProcess"]
run-if = [
"os == 'win' && processor == 'x86'",
"os == 'win' && processor == 'x86_64'",
]
["TestDoublyLinkedList"]
["TestEndian"]
["TestEnumSet"]
["TestEnumTypeTraits"]
["TestEnumeratedArray"]
["TestFastBernoulliTrial"]
["TestFloatingPoint"]
["TestFunctionRef"]
["TestFunctionTypeTraits"]
["TestHashTable"]
["TestIATPatcher"]
run-if = ["os == 'win'"]
skip-if = ["win11_2009 && bits == 32"] # fails on windows10x32
["TestIntegerPrintfMacros"]
["TestIntegerRange"]
["TestJSONWriter"]
["TestLauncherRegistryInfo"]
run-if = ["os == 'win'"]
["TestLinkedList"]
["TestMMPolicy"]
run-if = ["os == 'win'"]
["TestMacroArgs"]
["TestMacroForEach"]
["TestMathAlgorithms"]
["TestMaybe"]
["TestMemoryPressureWatcherLinux"]
skip-if = ["os != 'linux'"]
["TestMozJemallocUtils"]
["TestNativeNt"]
run-if = ["os == 'win'"]
["TestNonDereferenceable"]
["TestNotNull"]
["TestOleAut32Initialization"]
run-if = ["os == 'win'"]
["TestPEExportSection"]
run-if = ["os == 'win'"]
["TestPoisonArea"]
skip-if = [
"asan", # Not built on sanitizer builds
"tsan",
]
["TestPrintf"]
["TestRandomNum"]
["TestRange"]
["TestRefPtr"]
["TestResult"]
["TestRollingMean"]
["TestSHA1"]
["TestSIMD"]
["TestSPSCQueue"]
["TestSafeThreadLocal"]
run-if = ["os == 'win'"]
["TestSameBinary"]
run-if = ["os == 'win'"]
["TestSaturate"]
["TestScopeExit"]
["TestSegmentedVector"]
["TestSmallPointerArray"]
["TestSplayTree"]
["TestStackCookie"]
run-if = ["os == 'win'"]
["TestStackWalkInitialization"]
run-if = ["os == 'win' && processor == 'x86_64'"]
["TestTextUtils"]
["TestThreadSafeWeakPtr"]
["TestTimeStampWin"]
run-if = ["os == 'win'"]
["TestTypedEnum"]
["TestUniquePtr"]
["TestUriValidation"]
run-if = ["os == 'win'"]
["TestUtf8"]
["TestVariant"]
["TestVector"]
["TestWeakPtr"]
["TestWinArchDefs"]
run-if = ["os == 'win'"]
["TestWrappingOperations"]
["TestXorShift128PlusRNG"]