Add tsan suppression

This commit is contained in:
Fletcher Dunn
2026-05-03 22:34:19 -07:00
parent db30f1b139
commit e15f7e3fa3
2 changed files with 25 additions and 0 deletions
+4
View File
@@ -89,6 +89,10 @@ def main() -> int:
repo_root = Path(__file__).resolve().parents[1]
env = compiler_env(args.compiler, os.environ)
if args.sanitizer == "tsan":
supp = repo_root / "tests" / "tsan.supp"
env["TSAN_OPTIONS"] = f"suppressions={supp}"
cmake_args = [
"cmake",
"-S",
+21
View File
@@ -0,0 +1,21 @@
# TSan suppression file for GameNetworkingSockets tests.
#
# Lock-order inversion: ConnectionLock -> TableLock in BInitConnection
#
# The normal lock order is TableLock first, then ConnectionLock (acquire the
# table lock to look up a connection by handle, then lock the connection).
# BInitConnection inverts this: it holds the new connection's ConnectionLock
# and then acquires the TableLock to register the connection in the table.
#
# This is safe because:
# 1) The SteamNetworkingGlobalLock is held across both paths, so only one
# thread can be in either code path at a time -- actual concurrent
# deadlock is impossible.
# 2) The connection being registered is brand new and not yet in the table,
# so no thread holding the TableLock could be waiting on this
# connection's lock.
#
# The reverse direction (TableLock -> ConnectionLock) already uses TryLock
# with a retry loop in InternalGetConnectionByHandle specifically to handle
# the rare case where the order is inverted.
deadlock:SteamNetworkingSocketsLib::CSteamNetworkConnectionBase::BInitConnection