From f88fe8fc3ba4e5473f27add1d70696b0ab2aadb9 Mon Sep 17 00:00:00 2001 From: Nikos Gorogiannis Date: Wed, 13 Jun 2018 12:11:05 -0700 Subject: [PATCH] [starvation] improve deadlock reports Summary: The deadlock reports (the actual string) were too low level, in order to avoid bug hash clashes. Now that we deduplicate this is less of an issue, so it's an opportunity to improve readability. ``` Potential deadlock. Trace 1 (starts at `void Interproc.interproc1Bad(InterprocA)`) first locks `this` in class `Interproc*` (line 9 in `void Interproc.interproc1Bad(InterprocA)`) and then locks `b` in class `InterprocA*` (line 14 in `void Interproc.interproc2Bad(InterprocA)`). Trace 2 (starts at `void InterprocA.interproc1Bad(Interproc)`), first locks `this` in class `InterprocA*` (line 37 in `void InterprocA.interproc1Bad(Interproc)`) and then locks `d` in class `Interproc*` (line 42 in `void InterprocA.interproc2Bad(Interproc)`). ``` Reviewed By: mbouaziz Differential Revision: D8395399 fbshipit-source-id: b4bb48c --- infer/src/concurrency/starvationDomain.ml | 14 +------------- infer/src/concurrency/starvationDomain.mli | 2 -- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/infer/src/concurrency/starvationDomain.ml b/infer/src/concurrency/starvationDomain.ml index 69945cb6f..d4e925b79 100644 --- a/infer/src/concurrency/starvationDomain.ml +++ b/infer/src/concurrency/starvationDomain.ml @@ -56,8 +56,6 @@ module type TraceElem = sig include PrettyPrintable.PrintableOrderedType with type t := t - val pp_no_trace : F.formatter -> t -> unit - val make : elem_t -> Location.t -> t val get_loc : t -> Location.t @@ -75,17 +73,7 @@ struct type t = {elem: Elem.t; loc: Location.t; trace: CallSite.t list [@compare.ignore]} [@@deriving compare] - let pp_no_trace fmt {elem; loc} = F.fprintf fmt "%a at %a" Elem.pp elem Location.pp loc - - let pp fmt e = - let pp_trace fmt = function - | [] -> - () - | trace -> - F.fprintf fmt " (trace: %a)" (Pp.semicolon_seq CallSite.pp) trace - in - F.fprintf fmt "%a%a" pp_no_trace e pp_trace e.trace - + let pp fmt {elem; loc} = F.fprintf fmt "%a at %a" Elem.pp elem Location.pp loc let make elem loc = {elem; loc; trace= []} diff --git a/infer/src/concurrency/starvationDomain.mli b/infer/src/concurrency/starvationDomain.mli index 95f92cb62..92abccd7c 100644 --- a/infer/src/concurrency/starvationDomain.mli +++ b/infer/src/concurrency/starvationDomain.mli @@ -27,8 +27,6 @@ module type TraceElem = sig include PrettyPrintable.PrintableOrderedType with type t := t - val pp_no_trace : F.formatter -> t -> unit - val make : elem_t -> Location.t -> t val get_loc : t -> Location.t