# Expected sanitizer findings for Slang.
#
# Known sanitizer findings that should not block PRs or nightly runs.
# Each non-comment, non-empty line is matched against sanitizer log output.
#
# Two matching modes:
#
#   SUMMARY match (default):
#     A plain line is a fixed substring matched against SUMMARY lines.
#     Use the error type + function name for stable matching.
#       Good:  null-pointer-use in slang::IRBlock::SuccessorList::reverse
#       Bad:   slang-ir.h:456    (fragile, breaks on any edit)
#       Bad:   null-pointer-use  (too broad, suppresses all null-pointer findings)
#
#   LEAK match (LEAK: prefix):
#     Lines starting with "LEAK:" match a function name against Direct
#     leak blocks (root allocations) in the log. A leak SUMMARY is
#     expected if any Direct leak block matches at least one pattern.
#     Indirect leaks (child allocations) are skipped since they share
#     the same root cause. This avoids relying on exact byte/allocation
#     counts in SUMMARY lines.
#       Good:  LEAK: _maybeBeginMacroInvocation
#       Bad:   AddressSanitizer: 20064 byte(s) leaked  (fragile counts)
#
# Track each entry with a bug/issue number so entries can be removed
# when the underlying issue is fixed. Stale entries that match nothing
# will produce CI warnings as a reminder to clean up.
#
# See also:
#   cmake/lsan-suppressions.txt        -- suppresses leak reports at LSan level
#   cmake/sanitizer-ignorelist.txt     -- suppresses UBSan checks at compile level
#   This file                          -- accepts real findings as known issues

# #11936: Record-replay replay path leaks objects created by replayed
# calls: the replay path invokes proxied methods with default-initialized
# out-parameters and discards the results, so replayed object-creating
# calls (sessions and filesystems via tryWrap, digest blobs via
# getSessionDescDigest) are never released. tryWrap matches the proxy
# wrapper allocations (proxy-base.cpp); callWithDefaults matches the
# discarded-out-parameter allocations made inside replayed calls
# (proxy-macros.h). Deliberately NOT matching generic allocation helpers
# like RawBlob::tryCreate -- that would silently accept unrelated future
# blob leaks.
LEAK: SlangRecord::tryWrap
LEAK: SlangRecord::callWithDefaults
# Also #11936: the replay-playback unit tests leak their TestCalculatorProxy
# objects (a reference taken during record/replay of proxied calls is never
# released; the handle registry itself stores raw pointers, so the imbalance
# is in the call path). The allocation site is the test function, so match
# the test-function name prefix.
LEAK: _replayContext

# #11938: Repro load leaks CacheFileSystem::PathInfo entries that have no
# unique identity: the post-load hand-off to the CacheFileSystem's owning
# unique-identity map skips them (see the TODO in slang-repro.cpp), so
# nobody owns them. Surfaced by the repro-validator unit tests.
LEAK: getPathInfoFromFile

# Historical entries:
#   #10828 LEAK: _maybeBeginMacroInvocation -- fixed by this PR: the
#     wrong-arg-count macro invocation error paths now free the
#     MacroInvocation.
#   #10893 TypeLayoutReflection use-after-free SUMMARY patterns
#     (List<ResourceInfo>::begin / slang-reflection-api.cpp /
#     slang-type-layout.h) -- stale: never matched in recent nightly
#     runs (e.g. 28644605608 and the scheduled master runs), so the
#     UBSan finding no longer reproduces there. Re-add (with current
#     line numbers) if #10893 resurfaces.
