From b5094cda9b65ef81643cee5fb682afacbf5c4928 Mon Sep 17 00:00:00 2001 From: Nikos Gorogiannis Date: Thu, 15 Nov 2018 01:50:09 -0800 Subject: [PATCH] [starvation] suppress the number of reports suppressed Summary: Currently, if there are several reports on the same line, the most important one is reported together with a message containing how many reports were suppressed. This is sometimes causing the bug hash we use believe that a report is introduced (eg if the number of suppressed reports changes). Reviewed By: mbouaziz Differential Revision: D13067306 fbshipit-source-id: 1cc0c6d3a --- infer/src/concurrency/starvation.ml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/infer/src/concurrency/starvation.ml b/infer/src/concurrency/starvation.ml index 59f98f657..e6318e130 100644 --- a/infer/src/concurrency/starvation.ml +++ b/infer/src/concurrency/starvation.ml @@ -231,11 +231,10 @@ end = struct if Reporting.is_suppressed tenv pdesc issue_type then () else Reporting.log_issue_external pname Exceptions.Error ~loc ~ltr issue_type message in - let mk_deduped_report reports ({message} as report) = + let mk_deduped_report ({message} as report) = { report with - message= - Printf.sprintf "%s %d more report(s) on the same line suppressed." message - (List.length reports - 1) } + message= Printf.sprintf "%s Additional report(s) on the same line were suppressed." message + } in let log_reports compare loc = function | [] -> @@ -244,7 +243,7 @@ end = struct log_report loc report | reports -> List.max_elt ~compare reports - |> Option.iter ~f:(fun (_, rep) -> mk_deduped_report reports rep |> log_report loc) + |> Option.iter ~f:(fun (_, rep) -> mk_deduped_report rep |> log_report loc) in let filter_map_deadlock = function {problem= Deadlock l} as r -> Some (l, r) | _ -> None in let filter_map_starvation = function