From a47ec3611f40b5d8018811df14f3464154d24aaf Mon Sep 17 00:00:00 2001 From: Nikos Gorogiannis Date: Mon, 10 Dec 2018 08:33:47 -0800 Subject: [PATCH] [starvation] tune logging and avoid dieing on non-struct locks Reviewed By: mbouaziz Differential Revision: D13398275 fbshipit-source-id: 83937ac59 --- infer/src/concurrency/ConcurrencyModels.ml | 4 ++-- infer/src/concurrency/starvationDomain.ml | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/infer/src/concurrency/ConcurrencyModels.ml b/infer/src/concurrency/ConcurrencyModels.ml index 16ff8991a..0468787dd 100644 --- a/infer/src/concurrency/ConcurrencyModels.ml +++ b/infer/src/concurrency/ConcurrencyModels.ml @@ -105,7 +105,7 @@ end = struct let qname_str = QualifiedCppName.to_qual_string qname in match List.find lock_models ~f:(fun mdl -> String.equal qname_str mdl.classname) with | None -> - L.debug Analysis Medium "is_recursive_lock_type: Could not find lock type %a@." + L.debug Analysis Verbose "is_recursive_lock_type: Could not find lock type %a@." QualifiedCppName.pp qname ; true | Some mdl -> @@ -215,7 +215,7 @@ end = struct let get_lock_effect pname actuals = let log_parse_error error = - L.internal_error "%s pname:%a actuals:%a@." error Typ.Procname.pp pname + L.debug Analysis Verbose "%s pname:%a actuals:%a@." error Typ.Procname.pp pname (PrettyPrintable.pp_collection ~pp_item:HilExp.pp) actuals in diff --git a/infer/src/concurrency/starvationDomain.ml b/infer/src/concurrency/starvationDomain.ml index 5b63a9fea..8818f58ad 100644 --- a/infer/src/concurrency/starvationDomain.ml +++ b/infer/src/concurrency/starvationDomain.ml @@ -259,8 +259,9 @@ let is_recursive_lock event tenv = | {Typ.desc= Tptr ({desc= Tstruct name}, _)} | {desc= Tstruct name} -> ConcurrencyModels.is_recursive_lock_type name | typ -> - L.die L.InternalError "Asked if non-struct type %a is a recursive lock type.@." - (Typ.pp_full Pp.text) typ + L.debug Analysis Verbose "Asked if non-struct type %a is a recursive lock type.@." + (Typ.pp_full Pp.text) typ ; + true in match event with | {Event.elem= LockAcquire lock_path} ->