| 1121 | } |
| 1122 | |
| 1123 | bool cmCTestMemCheckHandler::ProcessMemCheckCudaOutput( |
| 1124 | std::string const& str, std::string& log, std::vector<int>& results) |
| 1125 | { |
| 1126 | std::vector<std::string> lines; |
| 1127 | cmsys::SystemTools::Split(str, lines); |
| 1128 | bool unlimitedOutput = false; |
| 1129 | if (str.find("CTEST_FULL_OUTPUT") != std::string::npos || |
| 1130 | this->TestOptions.OutputSizeFailed == 0) { |
| 1131 | unlimitedOutput = true; |
| 1132 | } |
| 1133 | |
| 1134 | std::string::size_type cc; |
| 1135 | |
| 1136 | std::ostringstream ostr; |
| 1137 | log.clear(); |
| 1138 | |
| 1139 | int defects = 0; |
| 1140 | |
| 1141 | cmsys::RegularExpression memcheckLine("^========"); |
| 1142 | |
| 1143 | cmsys::RegularExpression leakExpr("== Leaked [0-9,]+ bytes at"); |
| 1144 | |
| 1145 | // list of matchers for output messages that contain variable content |
| 1146 | // (addresses, sizes, ...) or can be shortened in general. the first match is |
| 1147 | // used as a error name. |
| 1148 | std::vector<cmsys::RegularExpression> matchers{ |
| 1149 | // API errors |
| 1150 | "== Malloc/Free error encountered: (.*)", |
| 1151 | "== Program hit error ([^ ]*).* on CUDA API call to", |
| 1152 | "== Program hit ([^ ]*).* on CUDA API call to", |
| 1153 | // memcheck |
| 1154 | "== (Invalid .*) of size [0-9,]+", "== (Fatal UVM [CG]PU fault)", |
| 1155 | // racecheck |
| 1156 | "== .* (Potential .* hazard detected)", "== .* (Race reported)", |
| 1157 | // synccheck |
| 1158 | "== (Barrier error)", |
| 1159 | // initcheck |
| 1160 | "== (Uninitialized .* memory read)", "== (Unused memory)", |
| 1161 | "== (Host API memory access error)", |
| 1162 | // generic error: ignore ERROR SUMMARY, CUDA-MEMCHECK and others |
| 1163 | "== ([A-Z][a-z].*)" |
| 1164 | }; |
| 1165 | // matchers for messages that aren't defects, but caught by above matchers |
| 1166 | std::vector<cmsys::RegularExpression> false_positive_matchers{ |
| 1167 | "== Error: No attachable process found.*timed-out", |
| 1168 | "== Default timeout can be adjusted with --launch-timeout", |
| 1169 | "== Error: Target application terminated before first instrumented API", |
| 1170 | "== Tracking kernels launched by child processes requires" |
| 1171 | }; |
| 1172 | |
| 1173 | std::vector<std::string::size_type> nonMemcheckOutput; |
| 1174 | auto sttime = std::chrono::steady_clock::now(); |
| 1175 | cmCTestOptionalLog(this->CTest, DEBUG, |
| 1176 | "Start test: " << lines.size() << std::endl, this->Quiet); |
| 1177 | std::string::size_type totalOutputSize = 0; |
| 1178 | for (cc = 0; cc < lines.size(); cc++) { |
| 1179 | cmCTestOptionalLog(this->CTest, DEBUG, |
| 1180 | "test line " << lines[cc] << std::endl, this->Quiet); |