summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-10-10 14:19:48 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-10-10 14:19:56 (GMT)
commit1fea40c85a61d43ba11c40813e5f477d647ab292 (patch)
tree5730959041dfa3f20fcff5d77a9018e78bf376b8
parentb36f23035e7953a60a1c14991c7fc9d463b0ed2c (diff)
parent59fcbba65ed5c31d275dceed0952ccaf57113cbb (diff)
downloadCMake-1fea40c85a61d43ba11c40813e5f477d647ab292.zip
CMake-1fea40c85a61d43ba11c40813e5f477d647ab292.tar.gz
CMake-1fea40c85a61d43ba11c40813e5f477d647ab292.tar.bz2
Merge topic 'cuda_sanitizer_false_positives'
59fcbba65e ctest_memcheck: ignore false-positives in CUDA's compute-sanitizer Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7760
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.cxx21
-rw-r--r--Tests/RunCMake/ctest_memcheck/testCudaSanitizer.cmake9
2 files changed, 26 insertions, 4 deletions
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index 788845b..6f6a642 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)));
}
}
}
diff --git a/Tests/RunCMake/ctest_memcheck/testCudaSanitizer.cmake b/Tests/RunCMake/ctest_memcheck/testCudaSanitizer.cmake
index adc7a1a..850f72c 100644
--- a/Tests/RunCMake/ctest_memcheck/testCudaSanitizer.cmake
+++ b/Tests/RunCMake/ctest_memcheck/testCudaSanitizer.cmake
@@ -277,3 +277,12 @@ file(APPEND "${LOG_FILE}"
=========
========= RACECHECK SUMMARY: 12 hazards displayed (0 errors, 12 warnings)
")
+
+# false-positives
+file(APPEND "${LOG_FILE}"
+"========= COMPUTE-SANITIZER
+========= Error: Target application terminated before first instrumented API call
+========= Tracking kernels launched by child processes requires the --target-processes all option.
+========= Error: No attachable process found. compute-sanitizer timed-out.
+========= Default timeout can be adjusted with --launch-timeout. Awaiting target completion.
+")