[starvation] tune logging and avoid dieing on non-struct locks

Reviewed By: mbouaziz

Differential Revision: D13398275

fbshipit-source-id: 83937ac59
master
Nikos Gorogiannis 6 years ago committed by Facebook Github Bot
parent dde9723926
commit a47ec3611f

@ -105,7 +105,7 @@ end = struct
let qname_str = QualifiedCppName.to_qual_string qname in let qname_str = QualifiedCppName.to_qual_string qname in
match List.find lock_models ~f:(fun mdl -> String.equal qname_str mdl.classname) with match List.find lock_models ~f:(fun mdl -> String.equal qname_str mdl.classname) with
| None -> | 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 ; QualifiedCppName.pp qname ;
true true
| Some mdl -> | Some mdl ->
@ -215,7 +215,7 @@ end = struct
let get_lock_effect pname actuals = let get_lock_effect pname actuals =
let log_parse_error error = 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) (PrettyPrintable.pp_collection ~pp_item:HilExp.pp)
actuals actuals
in in

@ -259,8 +259,9 @@ let is_recursive_lock event tenv =
| {Typ.desc= Tptr ({desc= Tstruct name}, _)} | {desc= Tstruct name} -> | {Typ.desc= Tptr ({desc= Tstruct name}, _)} | {desc= Tstruct name} ->
ConcurrencyModels.is_recursive_lock_type name ConcurrencyModels.is_recursive_lock_type name
| typ -> | typ ->
L.die L.InternalError "Asked if non-struct type %a is a recursive lock type.@." L.debug Analysis Verbose "Asked if non-struct type %a is a recursive lock type.@."
(Typ.pp_full Pp.text) typ (Typ.pp_full Pp.text) typ ;
true
in in
match event with match event with
| {Event.elem= LockAcquire lock_path} -> | {Event.elem= LockAcquire lock_path} ->

Loading…
Cancel
Save