diff options
author | Tobias Ribizel <tribizel@nvidia.com> | 2022-10-06 20:21:39 +0000 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-10-07 11:36:12 -0400 |
commit | 59fcbba65ed5c31d275dceed0952ccaf57113cbb (patch) | |
tree | 7a5e2a6794c705d845eea8cd1f8e4c15e358a5b6 /Source/CTest | |
parent | 2133cf2c8e575bfff000041505208e28bcdfd4a3 (diff) | |
download | cmake-59fcbba65ed5c31d275dceed0952ccaf57113cbb.tar.gz |
ctest_memcheck: ignore false-positives in CUDA's compute-sanitizer
Add a list of false-positive messages from CUDA's compute-sanitizer to
the CTest memcheck.
Fixes: #24001
Diffstat (limited to 'Source/CTest')
-rw-r--r-- | Source/CTest/cmCTestMemCheckHandler.cxx | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index 788845b3e8..6f6a6426a4 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -1177,6 +1177,13 @@ bool cmCTestMemCheckHandler::ProcessMemCheckCudaOutput( // generic error: ignore ERROR SUMMARY, CUDA-MEMCHECK and others "== ([A-Z][a-z].*)" }; + // matchers for messages that aren't defects, but caught by above matchers + std::vector<cmsys::RegularExpression> false_positive_matchers{ + "== Error: No attachable process found.*timed-out", + "== Default timeout can be adjusted with --launch-timeout", + "== Error: Target application terminated before first instrumented API", + "== Tracking kernels launched by child processes requires" + }; std::vector<std::string::size_type> nonMemcheckOutput; auto sttime = std::chrono::steady_clock::now(); @@ -1196,11 +1203,17 @@ bool cmCTestMemCheckHandler::ProcessMemCheckCudaOutput( if (leakExpr.find(line)) { failure = static_cast<int>(this->FindOrAddWarning("Memory leak")); } else { - for (auto& matcher : matchers) { - if (matcher.find(line)) { + auto match_predicate = + [&line](cmsys::RegularExpression& matcher) -> bool { + return matcher.find(line); + }; + auto const pos_matcher = + std::find_if(matchers.begin(), matchers.end(), match_predicate); + if (pos_matcher != matchers.end()) { + if (!std::any_of(false_positive_matchers.begin(), + false_positive_matchers.end(), match_predicate)) { failure = - static_cast<int>(this->FindOrAddWarning(matcher.match(1))); - break; + static_cast<int>(this->FindOrAddWarning(pos_matcher->match(1))); } } } |