From bc02bee7371a08053cd9ad50377a4273358d73b9 Mon Sep 17 00:00:00 2001 From: Sam Blackshear Date: Thu, 19 Oct 2017 06:19:27 -0700 Subject: [PATCH] [cleanup] rename thread-safety analysis Reviewed By: jvillard Differential Revision: D6087967 fbshipit-source-id: 22bfb6d --- Makefile | 4 +- infer/src/backend/specs.ml | 8 +- infer/src/backend/specs.mli | 2 +- infer/src/base/Config.ml | 32 ++--- infer/src/base/Config.mli | 6 +- infer/src/checkers/registerCheckers.ml | 12 +- .../ThreadSafety.ml => concurrency/RacerD.ml} | 83 +++++++------ .../RacerD.mli} | 0 .../RacerDConfig.ml} | 0 .../RacerDConfig.mli} | 0 .../RacerDDomain.ml} | 0 .../RacerDDomain.mli} | 0 infer/src/jbuild.in | 1 + .../build_systems/threadsafety_dedup/Makefile | 2 +- .../cpp/{threadsafety => racerd}/Makefile | 4 +- .../cpp/{threadsafety => racerd}/basics.cpp | 0 .../basics_no_mutex.cpp | 0 .../tests/codetoanalyze/cpp/racerd/issues.exp | 14 +++ .../locals_ownership.cpp | 0 .../{threadsafety => racerd}/lock_guard.cpp | 0 .../lock_guard_with_scope.cpp | 0 .../string_literal.cpp | 0 .../{threadsafety => racerd}/unique_lock.cpp | 0 .../cpp/{threadsafety => racerd}/variadic.cpp | 0 .../codetoanalyze/cpp/threadsafety/issues.exp | 14 --- .../codetoanalyze/java/checkers/Makefile | 2 +- .../{threadsafety => racerd}/.inferconfig | 0 .../java/{threadsafety => racerd}/Alias.java | 0 .../AndroidModels.java | 0 .../{threadsafety => racerd}/Annotations.java | 0 .../java/{threadsafety => racerd}/Arrays.java | 0 .../{threadsafety => racerd}/Builders.java | 0 .../Constructors.java | 0 .../{threadsafety => racerd}/Containers.java | 0 .../{threadsafety => racerd}/Dispatch.java | 0 .../java/{threadsafety => racerd}/Escape.java | 0 .../{threadsafety => racerd}/Inference.java | 0 .../java/{threadsafety => racerd}/Locks.java | 0 .../java/{threadsafety => racerd}/Makefile | 2 +- .../NotThreadSafeExample.java | 0 .../{threadsafety => racerd}/Ownership.java | 0 .../RaceWithMainThread.java | 0 .../ReadWriteRaces.java | 0 .../SkippedClass.java | 0 .../java/{threadsafety => racerd}/SubFld.java | 0 .../{threadsafety => racerd}/SwitchEnum.java | 0 .../ThreadSafeExample.java | 0 .../ThreadSafeMethods.java | 0 .../codetoanalyze/java/racerd/issues.exp | 116 ++++++++++++++++++ .../java/threadsafety/issues.exp | 116 ------------------ 50 files changed, 212 insertions(+), 206 deletions(-) rename infer/src/{checkers/ThreadSafety.ml => concurrency/RacerD.ml} (96%) rename infer/src/{checkers/ThreadSafety.mli => concurrency/RacerD.mli} (100%) rename infer/src/{checkers/ThreadSafetyConfig.ml => concurrency/RacerDConfig.ml} (100%) rename infer/src/{checkers/ThreadSafetyConfig.mli => concurrency/RacerDConfig.mli} (100%) rename infer/src/{checkers/ThreadSafetyDomain.ml => concurrency/RacerDDomain.ml} (100%) rename infer/src/{checkers/ThreadSafetyDomain.mli => concurrency/RacerDDomain.mli} (100%) rename infer/tests/codetoanalyze/cpp/{threadsafety => racerd}/Makefile (88%) rename infer/tests/codetoanalyze/cpp/{threadsafety => racerd}/basics.cpp (100%) rename infer/tests/codetoanalyze/cpp/{threadsafety => racerd}/basics_no_mutex.cpp (100%) create mode 100644 infer/tests/codetoanalyze/cpp/racerd/issues.exp rename infer/tests/codetoanalyze/cpp/{threadsafety => racerd}/locals_ownership.cpp (100%) rename infer/tests/codetoanalyze/cpp/{threadsafety => racerd}/lock_guard.cpp (100%) rename infer/tests/codetoanalyze/cpp/{threadsafety => racerd}/lock_guard_with_scope.cpp (100%) rename infer/tests/codetoanalyze/cpp/{threadsafety => racerd}/string_literal.cpp (100%) rename infer/tests/codetoanalyze/cpp/{threadsafety => racerd}/unique_lock.cpp (100%) rename infer/tests/codetoanalyze/cpp/{threadsafety => racerd}/variadic.cpp (100%) delete mode 100644 infer/tests/codetoanalyze/cpp/threadsafety/issues.exp rename infer/tests/codetoanalyze/java/{threadsafety => racerd}/.inferconfig (100%) rename infer/tests/codetoanalyze/java/{threadsafety => racerd}/Alias.java (100%) rename infer/tests/codetoanalyze/java/{threadsafety => racerd}/AndroidModels.java (100%) rename infer/tests/codetoanalyze/java/{threadsafety => racerd}/Annotations.java (100%) rename infer/tests/codetoanalyze/java/{threadsafety => racerd}/Arrays.java (100%) rename infer/tests/codetoanalyze/java/{threadsafety => racerd}/Builders.java (100%) rename infer/tests/codetoanalyze/java/{threadsafety => racerd}/Constructors.java (100%) rename infer/tests/codetoanalyze/java/{threadsafety => racerd}/Containers.java (100%) rename infer/tests/codetoanalyze/java/{threadsafety => racerd}/Dispatch.java (100%) rename infer/tests/codetoanalyze/java/{threadsafety => racerd}/Escape.java (100%) rename infer/tests/codetoanalyze/java/{threadsafety => racerd}/Inference.java (100%) rename infer/tests/codetoanalyze/java/{threadsafety => racerd}/Locks.java (100%) rename infer/tests/codetoanalyze/java/{threadsafety => racerd}/Makefile (88%) rename infer/tests/codetoanalyze/java/{threadsafety => racerd}/NotThreadSafeExample.java (100%) rename infer/tests/codetoanalyze/java/{threadsafety => racerd}/Ownership.java (100%) rename infer/tests/codetoanalyze/java/{threadsafety => racerd}/RaceWithMainThread.java (100%) rename infer/tests/codetoanalyze/java/{threadsafety => racerd}/ReadWriteRaces.java (100%) rename infer/tests/codetoanalyze/java/{threadsafety => racerd}/SkippedClass.java (100%) rename infer/tests/codetoanalyze/java/{threadsafety => racerd}/SubFld.java (100%) rename infer/tests/codetoanalyze/java/{threadsafety => racerd}/SwitchEnum.java (100%) rename infer/tests/codetoanalyze/java/{threadsafety => racerd}/ThreadSafeExample.java (100%) rename infer/tests/codetoanalyze/java/{threadsafety => racerd}/ThreadSafeMethods.java (100%) create mode 100644 infer/tests/codetoanalyze/java/racerd/issues.exp delete mode 100644 infer/tests/codetoanalyze/java/threadsafety/issues.exp diff --git a/Makefile b/Makefile index a3f11537b..b13ed77a7 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ BUILD_SYSTEMS_TESTS += \ DIRECT_TESTS += \ c_biabduction c_bufferoverrun c_errors c_frontend \ - cpp_bufferoverrun cpp_errors cpp_frontend cpp_liveness cpp_quandary cpp_siof cpp_threadsafety cpp_uninit cpp_nullable \ + cpp_bufferoverrun cpp_errors cpp_frontend cpp_liveness cpp_quandary cpp_racerd cpp_siof cpp_uninit cpp_nullable \ ifneq ($(BUCK),no) BUILD_SYSTEMS_TESTS += buck-clang-db buck_flavors buck_flavors_run buck_flavors_deterministic @@ -86,7 +86,7 @@ BUILD_SYSTEMS_TESTS += \ DIRECT_TESTS += \ java_checkers java_eradicate java_infer java_lab java_tracing java_quandary \ - java_threadsafety java_crashcontext java_harness + java_racerd java_crashcontext java_harness ifneq ($(ANT),no) BUILD_SYSTEMS_TESTS += ant endif diff --git a/infer/src/backend/specs.ml b/infer/src/backend/specs.ml index cd0c43e93..f46137fcf 100644 --- a/infer/src/backend/specs.ml +++ b/infer/src/backend/specs.ml @@ -336,7 +336,7 @@ type payload = ; quandary: QuandarySummary.t option ; resources: ResourceLeakDomain.summary option ; siof: SiofDomain.astate option - ; threadsafety: ThreadSafetyDomain.summary option + ; racerd: RacerDDomain.summary option ; buffer_overrun: BufferOverrunDomain.Summary.t option ; uninit: UninitDomain.summary option } @@ -465,7 +465,7 @@ let pp_payload pe fmt ; crashcontext_frame ; quandary ; siof - ; threadsafety + ; racerd ; buffer_overrun ; annot_map ; uninit } = @@ -481,7 +481,7 @@ let pp_payload pe fmt (pp_opt "TypeState" (TypeState.pp TypeState.unit_ext)) typestate (pp_opt "CrashContext" Crashcontext.pp_stacktree) crashcontext_frame (pp_opt "Quandary" QuandarySummary.pp) quandary (pp_opt "Siof" SiofDomain.pp) siof - (pp_opt "ThreadSafety" ThreadSafetyDomain.pp_summary) threadsafety + (pp_opt "RacerD" RacerDDomain.pp_summary) racerd (pp_opt "BufferOverrun" BufferOverrunDomain.Summary.pp) buffer_overrun (pp_opt "AnnotationReachability" AnnotReachabilityDomain.pp) annot_map (pp_opt "Uninitialised" UninitDomain.pp_summary) uninit @@ -695,7 +695,7 @@ let empty_payload = ; quandary= None ; resources= None ; siof= None - ; threadsafety= None + ; racerd= None ; buffer_overrun= None ; uninit= None } diff --git a/infer/src/backend/specs.mli b/infer/src/backend/specs.mli index 3e98010d7..899f3d8e3 100644 --- a/infer/src/backend/specs.mli +++ b/infer/src/backend/specs.mli @@ -136,7 +136,7 @@ type payload = ; quandary: QuandarySummary.t option ; resources: ResourceLeakDomain.summary option ; siof: SiofDomain.astate option - ; threadsafety: ThreadSafetyDomain.summary option + ; racerd: RacerDDomain.summary option ; buffer_overrun: BufferOverrunDomain.Summary.t option ; uninit: UninitDomain.summary option } diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index 152dc38be..5763cd5b6 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -242,9 +242,9 @@ let manual_java = "JAVA OPTIONS" let manual_quandary = "QUANDARY CHECKER OPTIONS" -let manual_siof = "SIOF CHECKER OPTIONS" +let manual_racerd = "RACERD CHECKER OPTIONS" -let manual_threadsafety = "THREADSAFETY CHECKER OPTIONS" +let manual_siof = "SIOF CHECKER OPTIONS" (** Maximum level of recursion during the analysis, after which a timeout is generated *) let max_recursion = 5 @@ -681,14 +681,16 @@ and ( annotation_reachability , liveness , printf_args , quandary + , racerd , repeated_calls , resource_leak , siof - , threadsafety , suggest_nullable , uninit ) = - let mk_checker ?(default= false) ~long doc = - let var = CLOpt.mk_bool ~long ~in_help:CLOpt.([(Analyze, manual_generic)]) ~default doc in + let mk_checker ?(default= false) ?(deprecated= []) ~long doc = + let var = + CLOpt.mk_bool ~long ~in_help:CLOpt.([(Analyze, manual_generic)]) ~default ~deprecated doc + in all_checkers := (var, long, doc, default) :: !all_checkers ; var in @@ -719,6 +721,9 @@ and ( annotation_reachability mk_checker ~long:"printf-args" ~default:true "the detection of mismatch between the Java printf format strings and the argument types For, example, this checker will warn about the type error in `printf(\"Hello %d\", \"world\")`" and quandary = mk_checker ~long:"quandary" ~default:true "the quandary taint analysis" + and racerd = + mk_checker ~long:"racerd" ~deprecated:["-threadsafety"] ~default:true + "the RacerD thread safety analysis" and repeated_calls = mk_checker ~long:"repeated-calls" "check for repeated calls" and resource_leak = mk_checker ~long:"resource-leak" "" and siof = @@ -726,7 +731,6 @@ and ( annotation_reachability "the Static Initialization Order Fiasco analysis (C++ only)" and suggest_nullable = mk_checker ~long:"suggest-nullable" ~default:false "Nullable annotation sugesstions analysis" - and threadsafety = mk_checker ~long:"threadsafety" ~default:true "the thread safety analysis" and uninit = mk_checker ~long:"uninit" "checker for use of uninitialized values" in let mk_only (var, long, doc, _) = let _ : bool ref = @@ -776,10 +780,10 @@ and ( annotation_reachability , liveness , printf_args , quandary + , racerd , repeated_calls , resource_leak , siof - , threadsafety , suggest_nullable , uninit ) @@ -1728,7 +1732,7 @@ and testing_mode = and threadsafe_aliases = CLOpt.mk_json ~long:"threadsafe-aliases" - ~in_help:CLOpt.([(Analyze, manual_threadsafety)]) + ~in_help:CLOpt.([(Analyze, manual_racerd)]) "Specify custom annotations that should be considered aliases of @ThreadSafe" and trace_join = @@ -1979,14 +1983,14 @@ let post_parsing_initialization command_opt = | _ -> () ) ; ( match !analyzer with - | Some BiAbduction | None + | Some BiAbduction -> disable_all_checkers () ; (* technically the biabduction checker doesn't run in this mode, but this gives an easy way to test if the biabduction *analysis* is active *) biabduction := true | Some Crashcontext -> disable_all_checkers () ; crashcontext := true - | Some (CaptureOnly | Checkers | CompileOnly | Linters) + | Some (CaptureOnly | Checkers | CompileOnly | Linters) | None -> () ) ; Option.value ~default:CLOpt.Run command_opt @@ -2342,6 +2346,8 @@ and quandary_sinks = !quandary_sinks and quiet = !quiet +and racerd = !racerd + and reactive_mode = !reactive || CLOpt.(equal_command Diff) command and reactive_capture = !reactive_capture @@ -2378,8 +2384,6 @@ and show_progress_bar = !progress_bar and siof = !siof -and uninit = !uninit - and siof_safe_methods = !siof_safe_methods and skip_analysis_in_path = !skip_analysis_in_path @@ -2418,8 +2422,6 @@ and test_filtering = !test_filtering and testing_mode = !testing_mode -and threadsafety = !threadsafety - and threadsafe_aliases = !threadsafe_aliases and trace_error = !trace_error @@ -2436,6 +2438,8 @@ and tv_limit = !tv_limit and type_size = !type_size +and uninit = !uninit + and unsafe_malloc = !unsafe_malloc and whole_seconds = !whole_seconds diff --git a/infer/src/base/Config.mli b/infer/src/base/Config.mli index 7731a460a..932c78e90 100644 --- a/infer/src/base/Config.mli +++ b/infer/src/base/Config.mli @@ -627,8 +627,6 @@ val show_progress_bar : bool val siof : bool -val uninit : bool - val siof_safe_methods : string list val skip_analysis_in_path : string list @@ -665,7 +663,7 @@ val test_filtering : bool val testing_mode : bool -val threadsafety : bool +val racerd : bool val threadsafe_aliases : Yojson.Basic.json @@ -681,6 +679,8 @@ val tv_limit : int val type_size : bool +val uninit : bool + val unsafe_malloc : bool val whole_seconds : bool diff --git a/infer/src/checkers/registerCheckers.ml b/infer/src/checkers/registerCheckers.ml index 02dc5a654..66317da1e 100644 --- a/infer/src/checkers/registerCheckers.ml +++ b/infer/src/checkers/registerCheckers.ml @@ -84,13 +84,13 @@ let all_checkers = Procedure ResourceLeaks.checker , Config.Java ) ] } ; {name= "SIOF"; active= Config.siof; callbacks= [(Procedure Siof.checker, Config.Clang)]} - ; { name= "thread safety" - ; active= Config.threadsafety + ; { name= "RacerD" + ; active= Config.racerd ; callbacks= - [ (Procedure ThreadSafety.analyze_procedure, Config.Clang) - ; (Procedure ThreadSafety.analyze_procedure, Config.Java) - ; (Cluster ThreadSafety.file_analysis, Config.Clang) - ; (Cluster ThreadSafety.file_analysis, Config.Java) ] } + [ (Procedure RacerD.analyze_procedure, Config.Clang) + ; (Procedure RacerD.analyze_procedure, Config.Java) + ; (Cluster RacerD.file_analysis, Config.Clang) + ; (Cluster RacerD.file_analysis, Config.Java) ] } ; { name= "uninitialized variables" ; active= Config.uninit ; callbacks= [(Procedure Uninit.checker, Config.Clang)] } ] diff --git a/infer/src/checkers/ThreadSafety.ml b/infer/src/concurrency/RacerD.ml similarity index 96% rename from infer/src/checkers/ThreadSafety.ml rename to infer/src/concurrency/RacerD.ml index 9126727d9..090b7b51d 100644 --- a/infer/src/checkers/ThreadSafety.ml +++ b/infer/src/concurrency/RacerD.ml @@ -13,17 +13,17 @@ module L = Logging module MF = MarkupFormatter module Summary = Summary.Make (struct - type payload = ThreadSafetyDomain.summary + type payload = RacerDDomain.summary let update_payload post (summary: Specs.summary) = - {summary with payload= {summary.payload with threadsafety= Some post}} + {summary with payload= {summary.payload with racerd= Some post}} - let read_payload (summary: Specs.summary) = summary.payload.threadsafety + let read_payload (summary: Specs.summary) = summary.payload.racerd end) module TransferFunctions (CFG : ProcCfg.S) = struct module CFG = CFG - module Domain = ThreadSafetyDomain + module Domain = RacerDDomain type extras = Typ.Procname.t -> Procdesc.t option @@ -238,7 +238,7 @@ module TransferFunctions (CFG : ProcCfg.S) = struct let rec aux acc = function [] -> acc | _ :: tail as all -> aux (List.rev all :: acc) tail in let prefixes = aux [] but_last_rev in List.for_all - ~f:(fun ap -> ThreadSafetyDomain.OwnershipDomain.is_owned (base, ap) attribute_map) + ~f:(fun ap -> RacerDDomain.OwnershipDomain.is_owned (base, ap) attribute_map) prefixes let propagate_attributes lhs_access_path rhs_exp attribute_map = @@ -963,7 +963,7 @@ let runs_on_ui_thread proc_desc = || Annotations.ia_is_on_unbind annot || Annotations.ia_is_on_unmount annot ) let threadsafe_annotations = - Annotations.thread_safe :: ThreadSafetyConfig.AnnotationAliases.of_json Config.threadsafe_aliases + Annotations.thread_safe :: RacerDConfig.AnnotationAliases.of_json Config.threadsafe_aliases (* returns true if the annotation is @ThreadSafe, @ThreadSafe(enableChecks = true), or is defined as an alias of @ThreadSafe in a .inferconfig file. *) @@ -1034,18 +1034,18 @@ let is_marked_thread_safe pdesc tenv = let pname = Procdesc.get_proc_name pdesc in is_thread_safe_class pname tenv || is_thread_safe_method pname tenv -let empty_post : ThreadSafetyDomain.summary = - { threads= ThreadSafetyDomain.ThreadsDomain.empty +let empty_post : RacerDDomain.summary = + { threads= RacerDDomain.ThreadsDomain.empty ; locks= false - ; accesses= ThreadSafetyDomain.AccessDomain.empty - ; return_ownership= ThreadSafetyDomain.OwnershipAbstractValue.unowned - ; return_attributes= ThreadSafetyDomain.AttributeSetDomain.empty } + ; accesses= RacerDDomain.AccessDomain.empty + ; return_ownership= RacerDDomain.OwnershipAbstractValue.unowned + ; return_attributes= RacerDDomain.AttributeSetDomain.empty } let analyze_procedure {Callbacks.proc_desc; get_proc_desc; tenv; summary} = let is_initializer tenv proc_name = Typ.Procname.is_constructor proc_name || FbThreadSafety.is_custom_init tenv proc_name in - let open ThreadSafetyDomain in + let open RacerDDomain in if should_analyze_proc proc_desc tenv then ( if not (Procdesc.did_preanalysis proc_desc) then Preanal.do_liveness proc_desc tenv ; let formal_map = FormalMap.make proc_desc in @@ -1091,7 +1091,7 @@ let analyze_procedure {Callbacks.proc_desc; get_proc_desc; tenv; summary} = (* express that the constructor owns [this] *) in let ownership = List.fold ~f:add_owned_formal owned_formals ~init:own_locals_in_cpp in - ({ThreadSafetyDomain.empty with ownership; threads}, IdAccessPathMapDomain.empty) + ({RacerDDomain.empty with ownership; threads}, IdAccessPathMapDomain.empty) else (* add Owned(formal_index) predicates for each formal to indicate that each one is owned if it is owned in the caller *) @@ -1102,7 +1102,7 @@ let analyze_procedure {Callbacks.proc_desc; get_proc_desc; tenv; summary} = List.fold ~f:add_owned_formal (FormalMap.get_formals_indexes formal_map) ~init:own_locals_in_cpp in - ({ThreadSafetyDomain.empty with ownership; threads}, IdAccessPathMapDomain.empty) + ({RacerDDomain.empty with ownership; threads}, IdAccessPathMapDomain.empty) in match Analyzer.compute_post proc_data ~initial ~debug:false with | Some ({threads; locks; accesses; ownership; attribute_map}, _) @@ -1122,9 +1122,9 @@ let analyze_procedure {Callbacks.proc_desc; get_proc_desc; tenv; summary} = -> summary ) else Summary.update_summary empty_post summary -module AccessListMap = Caml.Map.Make (ThreadSafetyDomain.Access) +module AccessListMap = Caml.Map.Make (RacerDDomain.Access) -type conflicts = ThreadSafetyDomain.TraceElem.t list +type conflicts = RacerDDomain.TraceElem.t list type report_kind = | WriteWriteRace of conflicts (** possibly-empty list of conflicting accesses *) @@ -1160,7 +1160,7 @@ let get_reporting_explanation report_kind tenv pname thread = | UnannotatedInterface, None -> Logging.die InternalError "Reporting non-threadsafe interface call, but can't find a @ThreadSafe annotation" - | _, Some threadsafe_explanation when ThreadSafetyDomain.ThreadsDomain.is_any thread + | _, Some threadsafe_explanation when RacerDDomain.ThreadsDomain.is_any thread -> F.asprintf "%s, so we assume that this method can run in parallel with other non-private methods in the class (incuding itself)." threadsafe_explanation @@ -1170,18 +1170,18 @@ let get_reporting_explanation report_kind tenv pname thread = threadsafe_explanation | _, None -> (* failed to explain based on @ThreadSafe annotation; have to justify using background thread *) - if ThreadSafetyDomain.ThreadsDomain.is_any thread then + if RacerDDomain.ThreadsDomain.is_any thread then F.asprintf "@\n Reporting because this access may occur on a background thread." else F.asprintf "@\n Reporting because another access to the same memory occurs on a background thread, although this access may not." let filter_by_access access_filter trace = - let open ThreadSafetyDomain in + let open RacerDDomain in PathDomain.Sinks.filter access_filter (PathDomain.sinks trace) |> PathDomain.update_sinks trace let get_all_accesses_with_pre pre_filter access_filter accesses = - let open ThreadSafetyDomain in + let open RacerDDomain in AccessDomain.fold (fun pre trace acc -> if pre_filter pre then PathDomain.join (filter_by_access access_filter trace) acc else acc) @@ -1194,17 +1194,17 @@ let pp_container_access fmt (access_path, access_pname) = (MF.monospaced_to_string (Typ.Procname.get_method access_pname)) let pp_access fmt sink = - match ThreadSafetyDomain.PathDomain.Sink.kind sink with + match RacerDDomain.PathDomain.Sink.kind sink with | Read access_path | Write access_path -> F.fprintf fmt "%a" (MF.wrap_monospaced AccessPath.pp) access_path | ContainerRead (access_path, access_pname) | ContainerWrite (access_path, access_pname) -> pp_container_access fmt (access_path, access_pname) | InterfaceCall _ as access - -> F.fprintf fmt "%a" ThreadSafetyDomain.Access.pp access + -> F.fprintf fmt "%a" RacerDDomain.Access.pp access let desc_of_sink sink = - let sink_pname = CallSite.pname (ThreadSafetyDomain.PathDomain.Sink.call_site sink) in - match ThreadSafetyDomain.PathDomain.Sink.kind sink with + let sink_pname = CallSite.pname (RacerDDomain.PathDomain.Sink.call_site sink) in + match RacerDDomain.PathDomain.Sink.kind sink with | Read _ | Write _ -> if Typ.Procname.equal sink_pname Typ.Procname.empty_block then F.asprintf "access to %a" pp_access sink @@ -1219,11 +1219,11 @@ let desc_of_sink sink = else F.asprintf "call to %a" Typ.Procname.pp sink_pname | InterfaceCall _ as access -> if Typ.Procname.equal sink_pname Typ.Procname.empty_block then - F.asprintf "%a" ThreadSafetyDomain.Access.pp access + F.asprintf "%a" RacerDDomain.Access.pp access else F.asprintf "call to %a" Typ.Procname.pp sink_pname let trace_of_pname orig_sink orig_pdesc callee_pname = - let open ThreadSafetyDomain in + let open RacerDDomain in let orig_access = PathDomain.Sink.kind orig_sink in match Summary.read_summary orig_pdesc callee_pname with | Some {accesses} @@ -1234,7 +1234,7 @@ let trace_of_pname orig_sink orig_pdesc callee_pname = -> PathDomain.empty let make_trace ~report_kind original_path pdesc = - let open ThreadSafetyDomain in + let open RacerDDomain in let loc_trace_of_path path = PathDomain.to_sink_loc_trace ~desc_of_sink path in let make_trace_for_sink sink = let trace_of_pname = trace_of_pname sink pdesc in @@ -1269,7 +1269,7 @@ let make_trace ~report_kind original_path pdesc = let report_thread_safety_violation tenv pdesc issue_type ~make_description ~report_kind access thread = - let open ThreadSafetyDomain in + let open RacerDDomain in let pname = Procdesc.get_proc_name pdesc in let report_one_path (_, sinks as path) = let initial_sink, _ = List.last_exn sinks in @@ -1317,8 +1317,7 @@ let make_unprotected_write_description pname final_sink_site initial_sink_site f Format.asprintf "Unprotected write. Non-private method %a%s %s %a outside of synchronization." (MF.wrap_monospaced pp_procname_short) pname (if CallSite.equal final_sink_site initial_sink_site then "" else " indirectly") - ( if ThreadSafetyDomain.TraceElem.is_container_write final_sink then "mutates" - else "writes to field" ) + (if RacerDDomain.TraceElem.is_container_write final_sink then "mutates" else "writes to field") pp_access final_sink let make_read_write_race_description ~read_is_sync conflicts pname final_sink_site @@ -1398,14 +1397,14 @@ let should_report_on_proc proc_desc tenv = *) let report_unsafe_accesses (aggregated_access_map: - ( ThreadSafetyDomain.TraceElem.t - * ThreadSafetyDomain.AccessPrecondition.t - * ThreadSafetyDomain.ThreadsDomain.astate + ( RacerDDomain.TraceElem.t + * RacerDDomain.AccessPrecondition.t + * RacerDDomain.ThreadsDomain.astate * Tenv.t * Procdesc.t ) list AccessListMap.t) = - let open ThreadSafetyDomain in + let open RacerDDomain in let is_duplicate_report access pname {reported_sites; reported_writes; reported_reads} = if Config.filtering then CallSite.Set.mem (TraceElem.call_site access) reported_sites || @@ -1591,21 +1590,21 @@ let report_unsafe_accesses aggregated_access_map empty_reported |> ignore -type ('a, 'b, 'c) dat = ThreadSafetyDomain.TraceElem.t * 'a * 'b * Tenv.t * 'c +type ('a, 'b, 'c) dat = RacerDDomain.TraceElem.t * 'a * 'b * Tenv.t * 'c module type QuotientedAccessListMap = sig type ('a, 'b, 'c) t val empty : ('a, 'b, 'c) t - val add : ThreadSafetyDomain.Access.t -> ('a, 'b, 'c) dat -> ('a, 'b, 'c) t -> ('a, 'b, 'c) t + val add : RacerDDomain.Access.t -> ('a, 'b, 'c) dat -> ('a, 'b, 'c) t -> ('a, 'b, 'c) t val quotient : ('a, 'b, 'c) t -> ('a, 'b, 'c) dat list AccessListMap.t end module SyntacticQuotientedAccessListMap : QuotientedAccessListMap = struct module M = Caml.Map.Make (struct - type t = ThreadSafetyDomain.Access.t + type t = RacerDDomain.Access.t type _var = Var.t @@ -1626,7 +1625,7 @@ module SyntacticQuotientedAccessListMap : QuotientedAccessListMap = struct , (Read ap2 | Write ap2 | ContainerRead (ap2, _) | ContainerWrite (ap2, _)) ) -> [%compare : (_var * Typ.t) * AccessPath.access list] ap1 ap2 | InterfaceCall _, _ | _, InterfaceCall _ - -> ThreadSafetyDomain.Access.compare x y + -> RacerDDomain.Access.compare x y end) type ('a, 'b, 'c) t = ('a, 'b, 'c) dat list M.t @@ -1715,7 +1714,7 @@ module MayAliasQuotientedAccessListMap : QuotientedAccessListMap = struct let k, vals = AccessListMap.min_binding m in let _, _, _, tenv, _ = List.find_exn vals ~f:(fun (elem, _, _, _, _) -> - ThreadSafetyDomain.Access.equal (ThreadSafetyDomain.TraceElem.kind elem) k ) + RacerDDomain.Access.equal (RacerDDomain.TraceElem.kind elem) k ) in (* assumption: the tenv for k is sufficient for k' too *) let k_part, non_k_part = @@ -1728,7 +1727,7 @@ module MayAliasQuotientedAccessListMap : QuotientedAccessListMap = struct , (ContainerRead (ap2, _) | ContainerWrite (ap2, _)) ) -> syntactic_equal_access_path tenv ap1 ap2 | _ - -> ThreadSafetyDomain.Access.equal k k') + -> RacerDDomain.Access.equal k k') m in if AccessListMap.is_empty k_part then L.(die InternalError) "may_alias is not reflexive!" ; @@ -1743,7 +1742,7 @@ end for now, just check for whether the access is within a switch-map that is auto-generated by Java. *) let should_filter_access access = - match ThreadSafetyDomain.Access.get_access_path access with + match RacerDDomain.Access.get_access_path access with | Some (_, path) -> let check_access_step = function | AccessPath.ArrayAccess _ @@ -1759,7 +1758,7 @@ let should_filter_access access = now, our abstraction is an access path like x.f.g whose concretization is the set of memory cells that x.f.g may point to during execution *) let make_results_table (module AccessListMap: QuotientedAccessListMap) file_env = - let open ThreadSafetyDomain in + let open RacerDDomain in let aggregate_post {threads; accesses} tenv pdesc acc = AccessDomain.fold (fun pre accesses acc -> diff --git a/infer/src/checkers/ThreadSafety.mli b/infer/src/concurrency/RacerD.mli similarity index 100% rename from infer/src/checkers/ThreadSafety.mli rename to infer/src/concurrency/RacerD.mli diff --git a/infer/src/checkers/ThreadSafetyConfig.ml b/infer/src/concurrency/RacerDConfig.ml similarity index 100% rename from infer/src/checkers/ThreadSafetyConfig.ml rename to infer/src/concurrency/RacerDConfig.ml diff --git a/infer/src/checkers/ThreadSafetyConfig.mli b/infer/src/concurrency/RacerDConfig.mli similarity index 100% rename from infer/src/checkers/ThreadSafetyConfig.mli rename to infer/src/concurrency/RacerDConfig.mli diff --git a/infer/src/checkers/ThreadSafetyDomain.ml b/infer/src/concurrency/RacerDDomain.ml similarity index 100% rename from infer/src/checkers/ThreadSafetyDomain.ml rename to infer/src/concurrency/RacerDDomain.ml diff --git a/infer/src/checkers/ThreadSafetyDomain.mli b/infer/src/concurrency/RacerDDomain.mli similarity index 100% rename from infer/src/checkers/ThreadSafetyDomain.mli rename to infer/src/concurrency/RacerDDomain.mli diff --git a/infer/src/jbuild.in b/infer/src/jbuild.in index da53a67bb..c0c73422e 100644 --- a/infer/src/jbuild.in +++ b/infer/src/jbuild.in @@ -14,6 +14,7 @@ let source_dirs = ; "base" ; "bufferoverrun" ; "checkers" + ; "concurrency" ; "eradicate" ; "harness" ; "integration" diff --git a/infer/tests/build_systems/threadsafety_dedup/Makefile b/infer/tests/build_systems/threadsafety_dedup/Makefile index 099132c27..f717d2bcd 100644 --- a/infer/tests/build_systems/threadsafety_dedup/Makefile +++ b/infer/tests/build_systems/threadsafety_dedup/Makefile @@ -9,7 +9,7 @@ TESTS_DIR = ../.. ANALYZER = checkers -INFER_OPTIONS = --project-root src --no-keep-going --threadsafety-only --filtering +INFER_OPTIONS = --project-root src --no-keep-going --racerd-only --filtering INFERPRINT_OPTIONS = --issues-tests SOURCES = src/DeDup.java diff --git a/infer/tests/codetoanalyze/cpp/threadsafety/Makefile b/infer/tests/codetoanalyze/cpp/racerd/Makefile similarity index 88% rename from infer/tests/codetoanalyze/cpp/threadsafety/Makefile rename to infer/tests/codetoanalyze/cpp/racerd/Makefile index a7451788e..177947750 100644 --- a/infer/tests/codetoanalyze/cpp/threadsafety/Makefile +++ b/infer/tests/codetoanalyze/cpp/racerd/Makefile @@ -10,7 +10,9 @@ TESTS_DIR = ../../.. ANALYZER = checkers # see explanations in cpp/errors/Makefile for the custom isystem CLANG_OPTIONS = -x c++ -std=c++11 -nostdinc++ -isystem$(ROOT_DIR) -isystem$(CLANG_INCLUDES)/c++/v1/ -c -INFER_OPTIONS = --threadsafety-only --debug-exceptions --project-root $(TESTS_DIR) + +INFER_OPTIONS = --racerd-only --debug-exceptions --project-root $(TESTS_DIR) + INFERPRINT_OPTIONS = --issues-tests SOURCES = $(wildcard *.cpp) diff --git a/infer/tests/codetoanalyze/cpp/threadsafety/basics.cpp b/infer/tests/codetoanalyze/cpp/racerd/basics.cpp similarity index 100% rename from infer/tests/codetoanalyze/cpp/threadsafety/basics.cpp rename to infer/tests/codetoanalyze/cpp/racerd/basics.cpp diff --git a/infer/tests/codetoanalyze/cpp/threadsafety/basics_no_mutex.cpp b/infer/tests/codetoanalyze/cpp/racerd/basics_no_mutex.cpp similarity index 100% rename from infer/tests/codetoanalyze/cpp/threadsafety/basics_no_mutex.cpp rename to infer/tests/codetoanalyze/cpp/racerd/basics_no_mutex.cpp diff --git a/infer/tests/codetoanalyze/cpp/racerd/issues.exp b/infer/tests/codetoanalyze/cpp/racerd/issues.exp new file mode 100644 index 000000000..fabcc4f7a --- /dev/null +++ b/infer/tests/codetoanalyze/cpp/racerd/issues.exp @@ -0,0 +1,14 @@ +codetoanalyze/cpp/racerd/basics.cpp, basics::Basic_get2, 3, THREAD_SAFETY_VIOLATION, [,access to `&this.suspiciously_written`,,access to `&this.suspiciously_written`] +codetoanalyze/cpp/racerd/basics.cpp, basics::Basic_get4, 0, THREAD_SAFETY_VIOLATION, [,access to `&this.suspiciously_read`,,access to `&this.suspiciously_read`] +codetoanalyze/cpp/racerd/basics.cpp, basics::Basic_get5, 0, THREAD_SAFETY_VIOLATION, [,call to basics::Basic_get_private_suspiciously_read,access to `&this.suspiciously_read`,,access to `&this.suspiciously_read`] +codetoanalyze/cpp/racerd/locals_ownership.cpp, locals::Ownership_test2_bad, 5, THREAD_SAFETY_VIOLATION, [,access to `&x.f`,,access to `&x.f`] +codetoanalyze/cpp/racerd/locals_ownership.cpp, locals::Ownership_test3_bad, 5, THREAD_SAFETY_VIOLATION, [,access to `&x.f`,,access to `&x.f`] +codetoanalyze/cpp/racerd/lock_guard.cpp, basics::LockGuard_get2, 3, THREAD_SAFETY_VIOLATION, [,access to `&this.suspiciously_written`,,access to `&this.suspiciously_written`] +codetoanalyze/cpp/racerd/lock_guard.cpp, basics::LockGuard_get4, 0, THREAD_SAFETY_VIOLATION, [,access to `&this.suspiciously_read`,,access to `&this.suspiciously_read`] +codetoanalyze/cpp/racerd/lock_guard.cpp, basics::LockGuard_test1, 2, THREAD_SAFETY_VIOLATION, [,access to `&this.suspiciously_read`,,access to `&this.suspiciously_read`] +codetoanalyze/cpp/racerd/lock_guard_with_scope.cpp, basics::LockGuardWithScope_get2, 3, THREAD_SAFETY_VIOLATION, [,access to `&this.suspiciously_written`,,access to `&this.suspiciously_written`] +codetoanalyze/cpp/racerd/lock_guard_with_scope.cpp, basics::LockGuardWithScope_get4, 0, THREAD_SAFETY_VIOLATION, [,access to `&this.suspiciously_read`,,access to `&this.suspiciously_read`] +codetoanalyze/cpp/racerd/unique_lock.cpp, basics::UniqueLock_get2, 3, THREAD_SAFETY_VIOLATION, [,access to `&this.suspiciously_written1`,,access to `&this.suspiciously_written1`] +codetoanalyze/cpp/racerd/unique_lock.cpp, basics::UniqueLock_get2, 4, THREAD_SAFETY_VIOLATION, [,access to `&this.suspiciously_written2`,,access to `&this.suspiciously_written2`] +codetoanalyze/cpp/racerd/unique_lock.cpp, basics::UniqueLock_get4, 1, THREAD_SAFETY_VIOLATION, [,access to `&this.suspiciously_read1`,,access to `&this.suspiciously_read1`] +codetoanalyze/cpp/racerd/unique_lock.cpp, basics::UniqueLock_get4, 2, THREAD_SAFETY_VIOLATION, [,access to `&this.suspiciously_read2`,,access to `&this.suspiciously_read2`] diff --git a/infer/tests/codetoanalyze/cpp/threadsafety/locals_ownership.cpp b/infer/tests/codetoanalyze/cpp/racerd/locals_ownership.cpp similarity index 100% rename from infer/tests/codetoanalyze/cpp/threadsafety/locals_ownership.cpp rename to infer/tests/codetoanalyze/cpp/racerd/locals_ownership.cpp diff --git a/infer/tests/codetoanalyze/cpp/threadsafety/lock_guard.cpp b/infer/tests/codetoanalyze/cpp/racerd/lock_guard.cpp similarity index 100% rename from infer/tests/codetoanalyze/cpp/threadsafety/lock_guard.cpp rename to infer/tests/codetoanalyze/cpp/racerd/lock_guard.cpp diff --git a/infer/tests/codetoanalyze/cpp/threadsafety/lock_guard_with_scope.cpp b/infer/tests/codetoanalyze/cpp/racerd/lock_guard_with_scope.cpp similarity index 100% rename from infer/tests/codetoanalyze/cpp/threadsafety/lock_guard_with_scope.cpp rename to infer/tests/codetoanalyze/cpp/racerd/lock_guard_with_scope.cpp diff --git a/infer/tests/codetoanalyze/cpp/threadsafety/string_literal.cpp b/infer/tests/codetoanalyze/cpp/racerd/string_literal.cpp similarity index 100% rename from infer/tests/codetoanalyze/cpp/threadsafety/string_literal.cpp rename to infer/tests/codetoanalyze/cpp/racerd/string_literal.cpp diff --git a/infer/tests/codetoanalyze/cpp/threadsafety/unique_lock.cpp b/infer/tests/codetoanalyze/cpp/racerd/unique_lock.cpp similarity index 100% rename from infer/tests/codetoanalyze/cpp/threadsafety/unique_lock.cpp rename to infer/tests/codetoanalyze/cpp/racerd/unique_lock.cpp diff --git a/infer/tests/codetoanalyze/cpp/threadsafety/variadic.cpp b/infer/tests/codetoanalyze/cpp/racerd/variadic.cpp similarity index 100% rename from infer/tests/codetoanalyze/cpp/threadsafety/variadic.cpp rename to infer/tests/codetoanalyze/cpp/racerd/variadic.cpp diff --git a/infer/tests/codetoanalyze/cpp/threadsafety/issues.exp b/infer/tests/codetoanalyze/cpp/threadsafety/issues.exp deleted file mode 100644 index 10ba86ee6..000000000 --- a/infer/tests/codetoanalyze/cpp/threadsafety/issues.exp +++ /dev/null @@ -1,14 +0,0 @@ -codetoanalyze/cpp/threadsafety/basics.cpp, basics::Basic_get2, 3, THREAD_SAFETY_VIOLATION, [,access to `&this.suspiciously_written`,,access to `&this.suspiciously_written`] -codetoanalyze/cpp/threadsafety/basics.cpp, basics::Basic_get4, 0, THREAD_SAFETY_VIOLATION, [,access to `&this.suspiciously_read`,,access to `&this.suspiciously_read`] -codetoanalyze/cpp/threadsafety/basics.cpp, basics::Basic_get5, 0, THREAD_SAFETY_VIOLATION, [,call to basics::Basic_get_private_suspiciously_read,access to `&this.suspiciously_read`,,access to `&this.suspiciously_read`] -codetoanalyze/cpp/threadsafety/locals_ownership.cpp, locals::Ownership_test2_bad, 5, THREAD_SAFETY_VIOLATION, [,access to `&x.f`,,access to `&x.f`] -codetoanalyze/cpp/threadsafety/locals_ownership.cpp, locals::Ownership_test3_bad, 5, THREAD_SAFETY_VIOLATION, [,access to `&x.f`,,access to `&x.f`] -codetoanalyze/cpp/threadsafety/lock_guard.cpp, basics::LockGuard_get2, 3, THREAD_SAFETY_VIOLATION, [,access to `&this.suspiciously_written`,,access to `&this.suspiciously_written`] -codetoanalyze/cpp/threadsafety/lock_guard.cpp, basics::LockGuard_get4, 0, THREAD_SAFETY_VIOLATION, [,access to `&this.suspiciously_read`,,access to `&this.suspiciously_read`] -codetoanalyze/cpp/threadsafety/lock_guard.cpp, basics::LockGuard_test1, 2, THREAD_SAFETY_VIOLATION, [,access to `&this.suspiciously_read`,,access to `&this.suspiciously_read`] -codetoanalyze/cpp/threadsafety/lock_guard_with_scope.cpp, basics::LockGuardWithScope_get2, 3, THREAD_SAFETY_VIOLATION, [,access to `&this.suspiciously_written`,,access to `&this.suspiciously_written`] -codetoanalyze/cpp/threadsafety/lock_guard_with_scope.cpp, basics::LockGuardWithScope_get4, 0, THREAD_SAFETY_VIOLATION, [,access to `&this.suspiciously_read`,,access to `&this.suspiciously_read`] -codetoanalyze/cpp/threadsafety/unique_lock.cpp, basics::UniqueLock_get2, 3, THREAD_SAFETY_VIOLATION, [,access to `&this.suspiciously_written1`,,access to `&this.suspiciously_written1`] -codetoanalyze/cpp/threadsafety/unique_lock.cpp, basics::UniqueLock_get2, 4, THREAD_SAFETY_VIOLATION, [,access to `&this.suspiciously_written2`,,access to `&this.suspiciously_written2`] -codetoanalyze/cpp/threadsafety/unique_lock.cpp, basics::UniqueLock_get4, 1, THREAD_SAFETY_VIOLATION, [,access to `&this.suspiciously_read1`,,access to `&this.suspiciously_read1`] -codetoanalyze/cpp/threadsafety/unique_lock.cpp, basics::UniqueLock_get4, 2, THREAD_SAFETY_VIOLATION, [,access to `&this.suspiciously_read2`,,access to `&this.suspiciously_read2`] diff --git a/infer/tests/codetoanalyze/java/checkers/Makefile b/infer/tests/codetoanalyze/java/checkers/Makefile index 465f794ae..136308e36 100644 --- a/infer/tests/codetoanalyze/java/checkers/Makefile +++ b/infer/tests/codetoanalyze/java/checkers/Makefile @@ -11,7 +11,7 @@ ANALYZER = checkers INFER_OPTIONS = \ --debug-exceptions --dynamic-dispatch none --no-default-checkers \ --annotation-reachability --fragment-retains-view --immutable-cast --printf-args --quandary \ - --suggest-nullable --threadsafety \ + --suggest-nullable --racerd \ INFERPRINT_OPTIONS = --issues-tests SOURCES = $(wildcard *.java) diff --git a/infer/tests/codetoanalyze/java/threadsafety/.inferconfig b/infer/tests/codetoanalyze/java/racerd/.inferconfig similarity index 100% rename from infer/tests/codetoanalyze/java/threadsafety/.inferconfig rename to infer/tests/codetoanalyze/java/racerd/.inferconfig diff --git a/infer/tests/codetoanalyze/java/threadsafety/Alias.java b/infer/tests/codetoanalyze/java/racerd/Alias.java similarity index 100% rename from infer/tests/codetoanalyze/java/threadsafety/Alias.java rename to infer/tests/codetoanalyze/java/racerd/Alias.java diff --git a/infer/tests/codetoanalyze/java/threadsafety/AndroidModels.java b/infer/tests/codetoanalyze/java/racerd/AndroidModels.java similarity index 100% rename from infer/tests/codetoanalyze/java/threadsafety/AndroidModels.java rename to infer/tests/codetoanalyze/java/racerd/AndroidModels.java diff --git a/infer/tests/codetoanalyze/java/threadsafety/Annotations.java b/infer/tests/codetoanalyze/java/racerd/Annotations.java similarity index 100% rename from infer/tests/codetoanalyze/java/threadsafety/Annotations.java rename to infer/tests/codetoanalyze/java/racerd/Annotations.java diff --git a/infer/tests/codetoanalyze/java/threadsafety/Arrays.java b/infer/tests/codetoanalyze/java/racerd/Arrays.java similarity index 100% rename from infer/tests/codetoanalyze/java/threadsafety/Arrays.java rename to infer/tests/codetoanalyze/java/racerd/Arrays.java diff --git a/infer/tests/codetoanalyze/java/threadsafety/Builders.java b/infer/tests/codetoanalyze/java/racerd/Builders.java similarity index 100% rename from infer/tests/codetoanalyze/java/threadsafety/Builders.java rename to infer/tests/codetoanalyze/java/racerd/Builders.java diff --git a/infer/tests/codetoanalyze/java/threadsafety/Constructors.java b/infer/tests/codetoanalyze/java/racerd/Constructors.java similarity index 100% rename from infer/tests/codetoanalyze/java/threadsafety/Constructors.java rename to infer/tests/codetoanalyze/java/racerd/Constructors.java diff --git a/infer/tests/codetoanalyze/java/threadsafety/Containers.java b/infer/tests/codetoanalyze/java/racerd/Containers.java similarity index 100% rename from infer/tests/codetoanalyze/java/threadsafety/Containers.java rename to infer/tests/codetoanalyze/java/racerd/Containers.java diff --git a/infer/tests/codetoanalyze/java/threadsafety/Dispatch.java b/infer/tests/codetoanalyze/java/racerd/Dispatch.java similarity index 100% rename from infer/tests/codetoanalyze/java/threadsafety/Dispatch.java rename to infer/tests/codetoanalyze/java/racerd/Dispatch.java diff --git a/infer/tests/codetoanalyze/java/threadsafety/Escape.java b/infer/tests/codetoanalyze/java/racerd/Escape.java similarity index 100% rename from infer/tests/codetoanalyze/java/threadsafety/Escape.java rename to infer/tests/codetoanalyze/java/racerd/Escape.java diff --git a/infer/tests/codetoanalyze/java/threadsafety/Inference.java b/infer/tests/codetoanalyze/java/racerd/Inference.java similarity index 100% rename from infer/tests/codetoanalyze/java/threadsafety/Inference.java rename to infer/tests/codetoanalyze/java/racerd/Inference.java diff --git a/infer/tests/codetoanalyze/java/threadsafety/Locks.java b/infer/tests/codetoanalyze/java/racerd/Locks.java similarity index 100% rename from infer/tests/codetoanalyze/java/threadsafety/Locks.java rename to infer/tests/codetoanalyze/java/racerd/Locks.java diff --git a/infer/tests/codetoanalyze/java/threadsafety/Makefile b/infer/tests/codetoanalyze/java/racerd/Makefile similarity index 88% rename from infer/tests/codetoanalyze/java/threadsafety/Makefile rename to infer/tests/codetoanalyze/java/racerd/Makefile index 2466f085c..378fcfc6c 100644 --- a/infer/tests/codetoanalyze/java/threadsafety/Makefile +++ b/infer/tests/codetoanalyze/java/racerd/Makefile @@ -8,7 +8,7 @@ TESTS_DIR = ../../.. ANALYZER = checkers -INFER_OPTIONS = --threadsafety-only --debug-exceptions +INFER_OPTIONS = --racerd-only --debug-exceptions INFERPRINT_OPTIONS = --issues-tests SOURCES = $(wildcard *.java) diff --git a/infer/tests/codetoanalyze/java/threadsafety/NotThreadSafeExample.java b/infer/tests/codetoanalyze/java/racerd/NotThreadSafeExample.java similarity index 100% rename from infer/tests/codetoanalyze/java/threadsafety/NotThreadSafeExample.java rename to infer/tests/codetoanalyze/java/racerd/NotThreadSafeExample.java diff --git a/infer/tests/codetoanalyze/java/threadsafety/Ownership.java b/infer/tests/codetoanalyze/java/racerd/Ownership.java similarity index 100% rename from infer/tests/codetoanalyze/java/threadsafety/Ownership.java rename to infer/tests/codetoanalyze/java/racerd/Ownership.java diff --git a/infer/tests/codetoanalyze/java/threadsafety/RaceWithMainThread.java b/infer/tests/codetoanalyze/java/racerd/RaceWithMainThread.java similarity index 100% rename from infer/tests/codetoanalyze/java/threadsafety/RaceWithMainThread.java rename to infer/tests/codetoanalyze/java/racerd/RaceWithMainThread.java diff --git a/infer/tests/codetoanalyze/java/threadsafety/ReadWriteRaces.java b/infer/tests/codetoanalyze/java/racerd/ReadWriteRaces.java similarity index 100% rename from infer/tests/codetoanalyze/java/threadsafety/ReadWriteRaces.java rename to infer/tests/codetoanalyze/java/racerd/ReadWriteRaces.java diff --git a/infer/tests/codetoanalyze/java/threadsafety/SkippedClass.java b/infer/tests/codetoanalyze/java/racerd/SkippedClass.java similarity index 100% rename from infer/tests/codetoanalyze/java/threadsafety/SkippedClass.java rename to infer/tests/codetoanalyze/java/racerd/SkippedClass.java diff --git a/infer/tests/codetoanalyze/java/threadsafety/SubFld.java b/infer/tests/codetoanalyze/java/racerd/SubFld.java similarity index 100% rename from infer/tests/codetoanalyze/java/threadsafety/SubFld.java rename to infer/tests/codetoanalyze/java/racerd/SubFld.java diff --git a/infer/tests/codetoanalyze/java/threadsafety/SwitchEnum.java b/infer/tests/codetoanalyze/java/racerd/SwitchEnum.java similarity index 100% rename from infer/tests/codetoanalyze/java/threadsafety/SwitchEnum.java rename to infer/tests/codetoanalyze/java/racerd/SwitchEnum.java diff --git a/infer/tests/codetoanalyze/java/threadsafety/ThreadSafeExample.java b/infer/tests/codetoanalyze/java/racerd/ThreadSafeExample.java similarity index 100% rename from infer/tests/codetoanalyze/java/threadsafety/ThreadSafeExample.java rename to infer/tests/codetoanalyze/java/racerd/ThreadSafeExample.java diff --git a/infer/tests/codetoanalyze/java/threadsafety/ThreadSafeMethods.java b/infer/tests/codetoanalyze/java/racerd/ThreadSafeMethods.java similarity index 100% rename from infer/tests/codetoanalyze/java/threadsafety/ThreadSafeMethods.java rename to infer/tests/codetoanalyze/java/racerd/ThreadSafeMethods.java diff --git a/infer/tests/codetoanalyze/java/racerd/issues.exp b/infer/tests/codetoanalyze/java/racerd/issues.exp new file mode 100644 index 000000000..8d6807fb2 --- /dev/null +++ b/infer/tests/codetoanalyze/java/racerd/issues.exp @@ -0,0 +1,116 @@ +codetoanalyze/java/racerd/Alias.java, void Alias.bar(A,A), 5, THREAD_SAFETY_VIOLATION, [,access to `&b.A.f`,,access to `&this.Alias.a.A.f`] +codetoanalyze/java/racerd/Alias.java, void Alias.foo(), 6, THREAD_SAFETY_VIOLATION, [,access to `&this.Alias.b.A.f`,,access to `&this.Alias.a.A.f`] +codetoanalyze/java/racerd/AndroidModels.java, void AndroidModels.someResourceMethodsNotFunctionalBad(), 2, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.AndroidModels.mField`] +codetoanalyze/java/racerd/Annotations.java, boolean Annotations.FP_functionalAcrossUnboxingOk(), 2, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Annotations.mBool2`] +codetoanalyze/java/racerd/Annotations.java, double Annotations.functionalDoubleBad(), 2, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Annotations.mDouble`] +codetoanalyze/java/racerd/Annotations.java, int Annotations.FP_functionalAcrossBoxingLongOk(), 2, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Annotations.mBoxedLong2`] +codetoanalyze/java/racerd/Annotations.java, int Annotations.functionalAcrossUnboxingLongBad(), 2, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Annotations.mLong2`] +codetoanalyze/java/racerd/Annotations.java, long Annotations.functionaLongBad(), 2, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Annotations.mLong`] +codetoanalyze/java/racerd/Annotations.java, void Annotations.conditional2_bad(boolean), 5, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Annotations.ii`] +codetoanalyze/java/racerd/Annotations.java, void Annotations.functionalAndNonfunctionalBad(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Annotations.mInt`] +codetoanalyze/java/racerd/Annotations.java, void Annotations.mutateOffUiThreadBad(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Annotations.f`] +codetoanalyze/java/racerd/Annotations.java, void Annotations.mutateSubfieldOfConfinedBad(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Annotations.encapsulatedField.codetoanalyze.java.checkers.Obj.f`] +codetoanalyze/java/racerd/Annotations.java, void Annotations.read_from_non_confined_method_Bad(), 2, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.Annotations.zz`,,access to `&this.codetoanalyze.java.checkers.Annotations.zz`] +codetoanalyze/java/racerd/Annotations.java, void Annotations.read_off_UI_thread_Bad(), 1, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.Annotations.f`,,call to void Annotations.setF(Object),access to `&this.codetoanalyze.java.checkers.Annotations.f`] +codetoanalyze/java/racerd/Annotations.java, void ThreadSafeAlias.threadSafeAliasBad1(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.ThreadSafeAlias.field`] +codetoanalyze/java/racerd/Annotations.java, void ThreadSafeAlias.threadSafeAliasBad2(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.ThreadSafeAlias.field`] +codetoanalyze/java/racerd/Arrays.java, String Arrays.readWriteRaceBad(String), 4, THREAD_SAFETY_VIOLATION, [,access to `&this.Arrays.strArr1.[_]`,,access to `&this.Arrays.strArr1.[_]`] +codetoanalyze/java/racerd/Arrays.java, void Arrays.arrayParameterWriteBad(int[]), 1, THREAD_SAFETY_VIOLATION, [access to `&name1.[_]`] +codetoanalyze/java/racerd/Arrays.java, void Arrays.writeWriteRaceBad(String), 1, THREAD_SAFETY_VIOLATION, [access to `&this.Arrays.strArr1.[_]`] +codetoanalyze/java/racerd/Builders.java, Builders$Obj Builders.buildThenMutateBad(Builders$Obj), 2, THREAD_SAFETY_VIOLATION, [,call to Builders$Obj$Builder Builders$Obj$Builder.setFromObj(Builders$Obj),access to `&input.codetoanalyze.java.checkers.Builders$Obj.g`,,access to `&o.codetoanalyze.java.checkers.Builders$Obj.g`] +codetoanalyze/java/racerd/Builders.java, Builders$Obj Builders.buildThenMutateBad(Builders$Obj), 3, THREAD_SAFETY_VIOLATION, [access to `&input.codetoanalyze.java.checkers.Builders$Obj.g`] +codetoanalyze/java/racerd/Builders.java, Builders$Obj Builders.mutateBad(Builders$Obj), 1, THREAD_SAFETY_VIOLATION, [access to `&o.codetoanalyze.java.checkers.Builders$Obj.g`] +codetoanalyze/java/racerd/Builders.java, void TopLevelBuilder.setG(String), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.TopLevelBuilder.g`] +codetoanalyze/java/racerd/Constructors.java, Constructors Constructors.singletonBad(), 2, THREAD_SAFETY_VIOLATION, [call to Constructors.(Object),access to `&#GB$Constructors.Constructors.staticField`] +codetoanalyze/java/racerd/Constructors.java, Constructors.(), 1, THREAD_SAFETY_VIOLATION, [access to `&#GB$Constructors.Constructors.staticField`] +codetoanalyze/java/racerd/Constructors.java, Constructors.(Constructors), 1, THREAD_SAFETY_VIOLATION, [access to `&o.Constructors.field`] +codetoanalyze/java/racerd/Containers.java, boolean Containers.listReadBad(String), 1, THREAD_SAFETY_VIOLATION, [,Read of container `&this.codetoanalyze.java.checkers.Containers.mList` via call to `contains`,,Write to container `&this.codetoanalyze.java.checkers.Containers.mList` via call to `set`] +codetoanalyze/java/racerd/Containers.java, int Containers.readSimpleArrayMap(), 1, THREAD_SAFETY_VIOLATION, [,Read of container `&this.codetoanalyze.java.checkers.Containers.si_map` via call to `get`,,Write to container `&this.codetoanalyze.java.checkers.Containers.si_map` via call to `put`] +codetoanalyze/java/racerd/Containers.java, void Containers.addToSimpleArrayMapBad(SimpleArrayMap), 1, THREAD_SAFETY_VIOLATION, [Write to container `&map` via call to `put`] +codetoanalyze/java/racerd/Containers.java, void Containers.addToSparseArrayBad(SparseArray), 1, THREAD_SAFETY_VIOLATION, [Write to container `&sparseArray` via call to `put`] +codetoanalyze/java/racerd/Containers.java, void Containers.addToSparseArrayCompatBad(SparseArrayCompat), 1, THREAD_SAFETY_VIOLATION, [Write to container `&sparseArray` via call to `put`] +codetoanalyze/java/racerd/Containers.java, void Containers.containerWrapperUnownedWriteBad(Object), 1, THREAD_SAFETY_VIOLATION, [call to Object ContainerWrapper.write(Object),call to Object ContainerWrapper._write(Object),Write to container `&this.codetoanalyze.java.checkers.ContainerWrapper.children` via call to `add`] +codetoanalyze/java/racerd/Containers.java, void Containers.listAddAllBad(Collection), 1, THREAD_SAFETY_VIOLATION, [Write to container `&this.codetoanalyze.java.checkers.Containers.mList` via call to `addAll`] +codetoanalyze/java/racerd/Containers.java, void Containers.listAddBad1(String), 1, THREAD_SAFETY_VIOLATION, [Write to container `&this.codetoanalyze.java.checkers.Containers.mList` via call to `add`] +codetoanalyze/java/racerd/Containers.java, void Containers.listAddBad2(int,String), 1, THREAD_SAFETY_VIOLATION, [Write to container `&this.codetoanalyze.java.checkers.Containers.mList` via call to `add`] +codetoanalyze/java/racerd/Containers.java, void Containers.listClearBad(), 1, THREAD_SAFETY_VIOLATION, [Write to container `&this.codetoanalyze.java.checkers.Containers.mList` via call to `clear`] +codetoanalyze/java/racerd/Containers.java, void Containers.listRemoveBad1(int), 1, THREAD_SAFETY_VIOLATION, [Write to container `&this.codetoanalyze.java.checkers.Containers.mList` via call to `remove`] +codetoanalyze/java/racerd/Containers.java, void Containers.listRemoveBad2(String), 1, THREAD_SAFETY_VIOLATION, [Write to container `&this.codetoanalyze.java.checkers.Containers.mList` via call to `remove`] +codetoanalyze/java/racerd/Containers.java, void Containers.listSetBad(int,String), 1, THREAD_SAFETY_VIOLATION, [Write to container `&this.codetoanalyze.java.checkers.Containers.mList` via call to `set`] +codetoanalyze/java/racerd/Containers.java, void Containers.listSubclassWriteBad(ArrayList,int), 1, THREAD_SAFETY_VIOLATION, [Write to container `&list` via call to `remove`] +codetoanalyze/java/racerd/Containers.java, void Containers.mapClearBad(), 1, THREAD_SAFETY_VIOLATION, [Write to container `&this.codetoanalyze.java.checkers.Containers.mMap` via call to `clear`] +codetoanalyze/java/racerd/Containers.java, void Containers.mapPutAllBad(Map), 1, THREAD_SAFETY_VIOLATION, [Write to container `&this.codetoanalyze.java.checkers.Containers.mMap` via call to `putAll`] +codetoanalyze/java/racerd/Containers.java, void Containers.mapPutBad(String,String), 1, THREAD_SAFETY_VIOLATION, [Write to container `&this.codetoanalyze.java.checkers.Containers.mMap` via call to `put`] +codetoanalyze/java/racerd/Containers.java, void Containers.mapRemoveBad(String), 1, THREAD_SAFETY_VIOLATION, [Write to container `&this.codetoanalyze.java.checkers.Containers.mMap` via call to `remove`] +codetoanalyze/java/racerd/Containers.java, void Containers.mapSubclassWriteBad(HashMap,String), 1, THREAD_SAFETY_VIOLATION, [Write to container `&m` via call to `remove`] +codetoanalyze/java/racerd/Containers.java, void Containers.poolBad(), 5, THREAD_SAFETY_VIOLATION, [Write to container `&this.codetoanalyze.java.checkers.Containers.simplePool` via call to `release`] +codetoanalyze/java/racerd/Dispatch.java, void Dispatch.callUnannotatedInterfaceBad(UnannotatedInterface), 1, INTERFACE_NOT_THREAD_SAFE, [Call to un-annotated interface method void UnannotatedInterface.foo()] +codetoanalyze/java/racerd/Dispatch.java, void Dispatch.callUnannotatedInterfaceIndirectBad(NotThreadSafe,UnannotatedInterface), 1, INTERFACE_NOT_THREAD_SAFE, [call to void NotThreadSafe.notThreadSafeOk(UnannotatedInterface),Call to un-annotated interface method void UnannotatedInterface.foo()] +codetoanalyze/java/racerd/Inference.java, int Inference.read4OutsideSyncBad(), 1, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.Inference.mField4`,,access to `&this.codetoanalyze.java.checkers.Inference.mField4`] +codetoanalyze/java/racerd/Inference.java, int Inference.unprotectedRead1Bad(), 1, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.Inference.mField1`,,access to `&this.codetoanalyze.java.checkers.Inference.mField1`] +codetoanalyze/java/racerd/Inference.java, int Inference.unprotectedRead2Bad(), 1, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.Inference.mField2`,,access to `&this.codetoanalyze.java.checkers.Inference.mField2`] +codetoanalyze/java/racerd/Locks.java, void Locks.FP_unlockOneLock(), 4, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Locks.f`] +codetoanalyze/java/racerd/Locks.java, void Locks.afterReentrantLockUnlockBad(), 3, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Locks.f`] +codetoanalyze/java/racerd/Locks.java, void Locks.afterUnlockBad(), 3, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Locks.f`] +codetoanalyze/java/racerd/Locks.java, void Locks.afterWriteLockUnlockBad(), 3, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Locks.f`] +codetoanalyze/java/racerd/Locks.java, void Locks.lockInOneBranchBad(boolean), 4, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Locks.f`] +codetoanalyze/java/racerd/Locks.java, void Locks.negatedReentrantLockTryLockBad(), 2, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Locks.f`] +codetoanalyze/java/racerd/Locks.java, void Locks.tryLockNoCheckBad(), 2, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Locks.f`] +codetoanalyze/java/racerd/Locks.java, void Locks.tryLockWrongBranchBad(), 3, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Locks.f`] +codetoanalyze/java/racerd/Ownership.java, Ownership.(Obj,Object), 1, THREAD_SAFETY_VIOLATION, [access to `&obj.codetoanalyze.java.checkers.Obj.f`] +codetoanalyze/java/racerd/Ownership.java, int Ownership.readGlobalBad(), 1, THREAD_SAFETY_VIOLATION, [,access to `&#GB$codetoanalyze.java.checkers.Ownership.codetoanalyze.java.checkers.Ownership.global`,,access to `&#GB$codetoanalyze.java.checkers.Ownership.codetoanalyze.java.checkers.Ownership.global`] +codetoanalyze/java/racerd/Ownership.java, void Ownership.cantOwnThisBad(), 1, THREAD_SAFETY_VIOLATION, [call to void Ownership.setField(Obj),access to `&this.codetoanalyze.java.checkers.Ownership.field`] +codetoanalyze/java/racerd/Ownership.java, void Ownership.castThenCallBad(), 2, THREAD_SAFETY_VIOLATION, [call to void Ownership.castThenCall(Obj),call to void Subclass.doWrite(),access to `&this.codetoanalyze.java.checkers.Obj.f`] +codetoanalyze/java/racerd/Ownership.java, void Ownership.castThenReturnBad(), 2, THREAD_SAFETY_VIOLATION, [access to `n$5.codetoanalyze.java.checkers.Obj.f`] +codetoanalyze/java/racerd/Ownership.java, void Ownership.conditionalAliasBad(Obj), 1, THREAD_SAFETY_VIOLATION, [call to void Ownership.conditionalAlias(Obj,Obj),access to `&alias.codetoanalyze.java.checkers.Obj.f`] +codetoanalyze/java/racerd/Ownership.java, void Ownership.notOwnedInCalleeBad(Obj), 1, THREAD_SAFETY_VIOLATION, [call to void Ownership.mutateIfNotNull(Obj),access to `&o.codetoanalyze.java.checkers.Obj.f`] +codetoanalyze/java/racerd/Ownership.java, void Ownership.notPropagatingOwnershipToAccessPathRootedAtFormalBad(Obj), 1, THREAD_SAFETY_VIOLATION, [access to `&m.codetoanalyze.java.checkers.Obj.g`] +codetoanalyze/java/racerd/Ownership.java, void Ownership.notPropagatingOwnershipToUnownedLocalAccessPathBad(), 2, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.Ownership.field`,,call to void Ownership.setField(Obj),access to `&this.codetoanalyze.java.checkers.Ownership.field`] +codetoanalyze/java/racerd/Ownership.java, void Ownership.notPropagatingOwnershipToUnownedLocalAccessPathBad(), 3, THREAD_SAFETY_VIOLATION, [access to `&m.codetoanalyze.java.checkers.Obj.g`] +codetoanalyze/java/racerd/Ownership.java, void Ownership.ownInOneBranchBad(Obj,boolean), 5, THREAD_SAFETY_VIOLATION, [access to `&formal.codetoanalyze.java.checkers.Obj.f`] +codetoanalyze/java/racerd/Ownership.java, void Ownership.reassignParamToUnownedBad(), 1, THREAD_SAFETY_VIOLATION, [call to void Ownership.reassignParamToUnowned(Obj),access to `&o.codetoanalyze.java.checkers.Obj.f`] +codetoanalyze/java/racerd/Ownership.java, void Ownership.reassignToFormalBad(Obj), 2, THREAD_SAFETY_VIOLATION, [access to `&formal.codetoanalyze.java.checkers.Obj.g`] +codetoanalyze/java/racerd/Ownership.java, void Ownership.reassignToFormalBad(Obj), 3, THREAD_SAFETY_VIOLATION, [,access to `&formal.codetoanalyze.java.checkers.Obj.g`,,access to `&formal.codetoanalyze.java.checkers.Obj.g`] +codetoanalyze/java/racerd/Ownership.java, void Ownership.writeToNotOwnedInCalleeBad1(Obj), 1, THREAD_SAFETY_VIOLATION, [call to void Ownership.writeToFormal(Obj),access to `&formal.codetoanalyze.java.checkers.Obj.f`] +codetoanalyze/java/racerd/Ownership.java, void Ownership.writeToNotOwnedInCalleeBad2(), 2, THREAD_SAFETY_VIOLATION, [call to void Ownership.writeToFormal(Obj),access to `&formal.codetoanalyze.java.checkers.Obj.f`] +codetoanalyze/java/racerd/Ownership.java, void Ownership.writeToNotOwnedInCalleeBad3(Obj), 1, THREAD_SAFETY_VIOLATION, [call to void Ownership.callWriteToFormal(Obj),call to void Ownership.writeToFormal(Obj),access to `&formal.codetoanalyze.java.checkers.Obj.f`] +codetoanalyze/java/racerd/Ownership.java, void Ownership.writeToOwnedInCalleeOk2(), 4, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.Ownership.field`,,access to `&this.codetoanalyze.java.checkers.Ownership.field`] +codetoanalyze/java/racerd/RaceWithMainThread.java, void RaceWithMainThread.conditional2_bad(boolean), 6, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.RaceWithMainThread.ff`] +codetoanalyze/java/racerd/RaceWithMainThread.java, void RaceWithMainThread.conditional_isMainThread_ElseBranch_Bad(), 7, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.RaceWithMainThread.ff`] +codetoanalyze/java/racerd/RaceWithMainThread.java, void RaceWithMainThread.conditional_isMainThread_Negation_Bad(), 3, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.RaceWithMainThread.ff`] +codetoanalyze/java/racerd/RaceWithMainThread.java, void RaceWithMainThread.conditional_isUiThread_ElseBranch_Bad(), 7, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.RaceWithMainThread.ff`] +codetoanalyze/java/racerd/RaceWithMainThread.java, void RaceWithMainThread.confusedAssertBad(boolean), 7, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.RaceWithMainThread.mFld`] +codetoanalyze/java/racerd/RaceWithMainThread.java, void RaceWithMainThread.readProtectedUnthreadedBad(), 3, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.RaceWithMainThread.f`,,access to `&this.codetoanalyze.java.checkers.RaceWithMainThread.f`] +codetoanalyze/java/racerd/RaceWithMainThread.java, void RaceWithMainThread.read_unprotected_unthreaded1_Bad(), 2, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.RaceWithMainThread.f1`,,access to `&this.codetoanalyze.java.checkers.RaceWithMainThread.f1`] +codetoanalyze/java/racerd/RaceWithMainThread.java, void RaceWithMainThread.read_unprotected_unthreaded_Bad(), 2, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.RaceWithMainThread.f`,,access to `&this.codetoanalyze.java.checkers.RaceWithMainThread.f`] +codetoanalyze/java/racerd/ReadWriteRaces.java, Object ReadWriteRaces.callUnprotecteReadInCallee(), 1, THREAD_SAFETY_VIOLATION, [,call to Object ReadWriteRaces.unprotectedReadInCallee(),access to `&this.codetoanalyze.java.checkers.ReadWriteRaces.field1`,,access to `&this.codetoanalyze.java.checkers.ReadWriteRaces.field1`] +codetoanalyze/java/racerd/ReadWriteRaces.java, Object ReadWriteRaces.unprotectedRead1(), 1, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.ReadWriteRaces.field1`,,access to `&this.codetoanalyze.java.checkers.ReadWriteRaces.field1`] +codetoanalyze/java/racerd/ReadWriteRaces.java, Object ReadWriteRaces.unprotectedRead2(), 1, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.ReadWriteRaces.field2`,,access to `&this.codetoanalyze.java.checkers.ReadWriteRaces.field2`] +codetoanalyze/java/racerd/ReadWriteRaces.java, Object ReadWriteRaces.unprotectedRead3(), 1, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.ReadWriteRaces.field3`,,call to void ReadWriteRaces.syncWrite3(),access to `&this.codetoanalyze.java.checkers.ReadWriteRaces.field3`] +codetoanalyze/java/racerd/ReadWriteRaces.java, void ReadWriteRaces.m1(), 2, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.ReadWriteRaces.racy`,,access to `&this.codetoanalyze.java.checkers.ReadWriteRaces.racy`] +codetoanalyze/java/racerd/ReadWriteRaces.java, void ReadWriteRaces.m2(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.ReadWriteRaces.racy`] +codetoanalyze/java/racerd/ReadWriteRaces.java, void ReadWriteRaces.m3(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.ReadWriteRaces.racy`] +codetoanalyze/java/racerd/ReadWriteRaces.java, void ReadWriteRaces.readInCalleeOutsideSyncBad(int), 1, THREAD_SAFETY_VIOLATION, [,call to int C.get(),access to `&this.codetoanalyze.java.checkers.C.x`,,call to void C.set(int),access to `&this.codetoanalyze.java.checkers.C.x`] +codetoanalyze/java/racerd/SubFld.java, int SubFld.getG(), 6, THREAD_SAFETY_VIOLATION, [,call to int SuperFld.getG(),access to `&this.SuperFld.g`,,access to `&this.SuperFld.g`] +codetoanalyze/java/racerd/ThreadSafeExample.java, Object ThreadSafeExample.FP_lazyInitOk(), 6, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.ThreadSafeExample.sStaticField`,,access to `&this.codetoanalyze.java.checkers.ThreadSafeExample.sStaticField`] +codetoanalyze/java/racerd/ThreadSafeExample.java, void ExtendsThreadSafeExample.newmethodBad(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.ExtendsThreadSafeExample.field`] +codetoanalyze/java/racerd/ThreadSafeExample.java, void ExtendsThreadSafeExample.tsOK(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.ExtendsThreadSafeExample.field`] +codetoanalyze/java/racerd/ThreadSafeExample.java, void ThreadSafeExample.callPublicMethodBad(), 1, THREAD_SAFETY_VIOLATION, [call to void ThreadSafeExample.assignInPrivateMethodOk(),access to `&this.codetoanalyze.java.checkers.ThreadSafeExample.f`] +codetoanalyze/java/racerd/ThreadSafeExample.java, void ThreadSafeExample.callVisibleForTestingBad(), 1, THREAD_SAFETY_VIOLATION, [call to void ThreadSafeExample.visibleForTestingNotPublicOk(),access to `&this.codetoanalyze.java.checkers.ThreadSafeExample.f`] +codetoanalyze/java/racerd/ThreadSafeExample.java, void ThreadSafeExample.deeperTraceBad(), 1, THREAD_SAFETY_VIOLATION, [call to void ThreadSafeExample.callAssignInPrivateMethod(),call to void ThreadSafeExample.assignInPrivateMethodOk(),access to `&this.codetoanalyze.java.checkers.ThreadSafeExample.f`] +codetoanalyze/java/racerd/ThreadSafeExample.java, void ThreadSafeExample.oddBad(), 1, THREAD_SAFETY_VIOLATION, [call to void ThreadSafeExample.evenOk(),access to `&this.codetoanalyze.java.checkers.ThreadSafeExample.f`] +codetoanalyze/java/racerd/ThreadSafeExample.java, void ThreadSafeExample.recursiveBad(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.ThreadSafeExample.f`] +codetoanalyze/java/racerd/ThreadSafeExample.java, void ThreadSafeExample.tsBad(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.ThreadSafeExample.f`] +codetoanalyze/java/racerd/ThreadSafeExample.java, void YesThreadSafeExtendsNotThreadSafeExample.subsubmethodBad(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.YesThreadSafeExtendsNotThreadSafeExample.subsubfield`] +codetoanalyze/java/racerd/ThreadSafeMethods.java, Object ThreadSafeMethods.readSameFieldAsThreadSafeMethod1Bad(), 1, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field1`,,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field1`] +codetoanalyze/java/racerd/ThreadSafeMethods.java, Object ThreadSafeMethods.readSameFieldAsThreadSafeMethod2Bad(), 1, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field4`,,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field4`] +codetoanalyze/java/racerd/ThreadSafeMethods.java, Object ThreadSafeMethods.readSameFieldAsThreadSafeMethodWhileSynchronized1Bad(), 1, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field1`,,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field1`] +codetoanalyze/java/racerd/ThreadSafeMethods.java, Object ThreadSafeMethods.threadSafeMethodReadBad(), 1, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field2`,,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field2`] +codetoanalyze/java/racerd/ThreadSafeMethods.java, Object ThreadSafeMethodsSubclass.readThreadSafeFieldOfOverrideBad(), 1, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethodsSubclass.subclassField`,,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethodsSubclass.subclassField`] +codetoanalyze/java/racerd/ThreadSafeMethods.java, void ThreadSafeMethods.threadSafeMethodWriteBad(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field1`] +codetoanalyze/java/racerd/ThreadSafeMethods.java, void ThreadSafeMethods.threadSafePrivateMethodBad(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field2`] +codetoanalyze/java/racerd/ThreadSafeMethods.java, void ThreadSafeMethods.threadSafeVisibleForTestingMethodBad(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field3`] +codetoanalyze/java/racerd/ThreadSafeMethods.java, void ThreadSafeMethods.writeSameFieldAsThreadSafeMethod1Bad(), 2, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field1`,,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field1`] +codetoanalyze/java/racerd/ThreadSafeMethods.java, void ThreadSafeMethods.writeSameFieldAsThreadSafeMethod2Bad(), 1, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field4`,,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field4`] +codetoanalyze/java/racerd/ThreadSafeMethods.java, void ThreadSafeMethodsSubclass.safeMethodOverride(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.ThreadSafeMethodsSubclass.subclassField`] +codetoanalyze/java/racerd/ThreadSafeMethods.java, void ThreadSafeMethodsSubclass.writeThreadSafeFieldOfOverrideBad(), 1, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethodsSubclass.subclassField`,,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethodsSubclass.subclassField`] diff --git a/infer/tests/codetoanalyze/java/threadsafety/issues.exp b/infer/tests/codetoanalyze/java/threadsafety/issues.exp deleted file mode 100644 index ee4181573..000000000 --- a/infer/tests/codetoanalyze/java/threadsafety/issues.exp +++ /dev/null @@ -1,116 +0,0 @@ -codetoanalyze/java/threadsafety/Alias.java, void Alias.bar(A,A), 5, THREAD_SAFETY_VIOLATION, [,access to `&b.A.f`,,access to `&this.Alias.a.A.f`] -codetoanalyze/java/threadsafety/Alias.java, void Alias.foo(), 6, THREAD_SAFETY_VIOLATION, [,access to `&this.Alias.b.A.f`,,access to `&this.Alias.a.A.f`] -codetoanalyze/java/threadsafety/AndroidModels.java, void AndroidModels.someResourceMethodsNotFunctionalBad(), 2, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.AndroidModels.mField`] -codetoanalyze/java/threadsafety/Annotations.java, boolean Annotations.FP_functionalAcrossUnboxingOk(), 2, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Annotations.mBool2`] -codetoanalyze/java/threadsafety/Annotations.java, double Annotations.functionalDoubleBad(), 2, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Annotations.mDouble`] -codetoanalyze/java/threadsafety/Annotations.java, int Annotations.FP_functionalAcrossBoxingLongOk(), 2, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Annotations.mBoxedLong2`] -codetoanalyze/java/threadsafety/Annotations.java, int Annotations.functionalAcrossUnboxingLongBad(), 2, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Annotations.mLong2`] -codetoanalyze/java/threadsafety/Annotations.java, long Annotations.functionaLongBad(), 2, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Annotations.mLong`] -codetoanalyze/java/threadsafety/Annotations.java, void Annotations.conditional2_bad(boolean), 5, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Annotations.ii`] -codetoanalyze/java/threadsafety/Annotations.java, void Annotations.functionalAndNonfunctionalBad(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Annotations.mInt`] -codetoanalyze/java/threadsafety/Annotations.java, void Annotations.mutateOffUiThreadBad(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Annotations.f`] -codetoanalyze/java/threadsafety/Annotations.java, void Annotations.mutateSubfieldOfConfinedBad(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Annotations.encapsulatedField.codetoanalyze.java.checkers.Obj.f`] -codetoanalyze/java/threadsafety/Annotations.java, void Annotations.read_from_non_confined_method_Bad(), 2, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.Annotations.zz`,,access to `&this.codetoanalyze.java.checkers.Annotations.zz`] -codetoanalyze/java/threadsafety/Annotations.java, void Annotations.read_off_UI_thread_Bad(), 1, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.Annotations.f`,,call to void Annotations.setF(Object),access to `&this.codetoanalyze.java.checkers.Annotations.f`] -codetoanalyze/java/threadsafety/Annotations.java, void ThreadSafeAlias.threadSafeAliasBad1(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.ThreadSafeAlias.field`] -codetoanalyze/java/threadsafety/Annotations.java, void ThreadSafeAlias.threadSafeAliasBad2(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.ThreadSafeAlias.field`] -codetoanalyze/java/threadsafety/Arrays.java, String Arrays.readWriteRaceBad(String), 4, THREAD_SAFETY_VIOLATION, [,access to `&this.Arrays.strArr1.[_]`,,access to `&this.Arrays.strArr1.[_]`] -codetoanalyze/java/threadsafety/Arrays.java, void Arrays.arrayParameterWriteBad(int[]), 1, THREAD_SAFETY_VIOLATION, [access to `&name1.[_]`] -codetoanalyze/java/threadsafety/Arrays.java, void Arrays.writeWriteRaceBad(String), 1, THREAD_SAFETY_VIOLATION, [access to `&this.Arrays.strArr1.[_]`] -codetoanalyze/java/threadsafety/Builders.java, Builders$Obj Builders.buildThenMutateBad(Builders$Obj), 2, THREAD_SAFETY_VIOLATION, [,call to Builders$Obj$Builder Builders$Obj$Builder.setFromObj(Builders$Obj),access to `&input.codetoanalyze.java.checkers.Builders$Obj.g`,,access to `&o.codetoanalyze.java.checkers.Builders$Obj.g`] -codetoanalyze/java/threadsafety/Builders.java, Builders$Obj Builders.buildThenMutateBad(Builders$Obj), 3, THREAD_SAFETY_VIOLATION, [access to `&input.codetoanalyze.java.checkers.Builders$Obj.g`] -codetoanalyze/java/threadsafety/Builders.java, Builders$Obj Builders.mutateBad(Builders$Obj), 1, THREAD_SAFETY_VIOLATION, [access to `&o.codetoanalyze.java.checkers.Builders$Obj.g`] -codetoanalyze/java/threadsafety/Builders.java, void TopLevelBuilder.setG(String), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.TopLevelBuilder.g`] -codetoanalyze/java/threadsafety/Constructors.java, Constructors Constructors.singletonBad(), 2, THREAD_SAFETY_VIOLATION, [call to Constructors.(Object),access to `&#GB$Constructors.Constructors.staticField`] -codetoanalyze/java/threadsafety/Constructors.java, Constructors.(), 1, THREAD_SAFETY_VIOLATION, [access to `&#GB$Constructors.Constructors.staticField`] -codetoanalyze/java/threadsafety/Constructors.java, Constructors.(Constructors), 1, THREAD_SAFETY_VIOLATION, [access to `&o.Constructors.field`] -codetoanalyze/java/threadsafety/Containers.java, boolean Containers.listReadBad(String), 1, THREAD_SAFETY_VIOLATION, [,Read of container `&this.codetoanalyze.java.checkers.Containers.mList` via call to `contains`,,Write to container `&this.codetoanalyze.java.checkers.Containers.mList` via call to `set`] -codetoanalyze/java/threadsafety/Containers.java, int Containers.readSimpleArrayMap(), 1, THREAD_SAFETY_VIOLATION, [,Read of container `&this.codetoanalyze.java.checkers.Containers.si_map` via call to `get`,,Write to container `&this.codetoanalyze.java.checkers.Containers.si_map` via call to `put`] -codetoanalyze/java/threadsafety/Containers.java, void Containers.addToSimpleArrayMapBad(SimpleArrayMap), 1, THREAD_SAFETY_VIOLATION, [Write to container `&map` via call to `put`] -codetoanalyze/java/threadsafety/Containers.java, void Containers.addToSparseArrayBad(SparseArray), 1, THREAD_SAFETY_VIOLATION, [Write to container `&sparseArray` via call to `put`] -codetoanalyze/java/threadsafety/Containers.java, void Containers.addToSparseArrayCompatBad(SparseArrayCompat), 1, THREAD_SAFETY_VIOLATION, [Write to container `&sparseArray` via call to `put`] -codetoanalyze/java/threadsafety/Containers.java, void Containers.containerWrapperUnownedWriteBad(Object), 1, THREAD_SAFETY_VIOLATION, [call to Object ContainerWrapper.write(Object),call to Object ContainerWrapper._write(Object),Write to container `&this.codetoanalyze.java.checkers.ContainerWrapper.children` via call to `add`] -codetoanalyze/java/threadsafety/Containers.java, void Containers.listAddAllBad(Collection), 1, THREAD_SAFETY_VIOLATION, [Write to container `&this.codetoanalyze.java.checkers.Containers.mList` via call to `addAll`] -codetoanalyze/java/threadsafety/Containers.java, void Containers.listAddBad1(String), 1, THREAD_SAFETY_VIOLATION, [Write to container `&this.codetoanalyze.java.checkers.Containers.mList` via call to `add`] -codetoanalyze/java/threadsafety/Containers.java, void Containers.listAddBad2(int,String), 1, THREAD_SAFETY_VIOLATION, [Write to container `&this.codetoanalyze.java.checkers.Containers.mList` via call to `add`] -codetoanalyze/java/threadsafety/Containers.java, void Containers.listClearBad(), 1, THREAD_SAFETY_VIOLATION, [Write to container `&this.codetoanalyze.java.checkers.Containers.mList` via call to `clear`] -codetoanalyze/java/threadsafety/Containers.java, void Containers.listRemoveBad1(int), 1, THREAD_SAFETY_VIOLATION, [Write to container `&this.codetoanalyze.java.checkers.Containers.mList` via call to `remove`] -codetoanalyze/java/threadsafety/Containers.java, void Containers.listRemoveBad2(String), 1, THREAD_SAFETY_VIOLATION, [Write to container `&this.codetoanalyze.java.checkers.Containers.mList` via call to `remove`] -codetoanalyze/java/threadsafety/Containers.java, void Containers.listSetBad(int,String), 1, THREAD_SAFETY_VIOLATION, [Write to container `&this.codetoanalyze.java.checkers.Containers.mList` via call to `set`] -codetoanalyze/java/threadsafety/Containers.java, void Containers.listSubclassWriteBad(ArrayList,int), 1, THREAD_SAFETY_VIOLATION, [Write to container `&list` via call to `remove`] -codetoanalyze/java/threadsafety/Containers.java, void Containers.mapClearBad(), 1, THREAD_SAFETY_VIOLATION, [Write to container `&this.codetoanalyze.java.checkers.Containers.mMap` via call to `clear`] -codetoanalyze/java/threadsafety/Containers.java, void Containers.mapPutAllBad(Map), 1, THREAD_SAFETY_VIOLATION, [Write to container `&this.codetoanalyze.java.checkers.Containers.mMap` via call to `putAll`] -codetoanalyze/java/threadsafety/Containers.java, void Containers.mapPutBad(String,String), 1, THREAD_SAFETY_VIOLATION, [Write to container `&this.codetoanalyze.java.checkers.Containers.mMap` via call to `put`] -codetoanalyze/java/threadsafety/Containers.java, void Containers.mapRemoveBad(String), 1, THREAD_SAFETY_VIOLATION, [Write to container `&this.codetoanalyze.java.checkers.Containers.mMap` via call to `remove`] -codetoanalyze/java/threadsafety/Containers.java, void Containers.mapSubclassWriteBad(HashMap,String), 1, THREAD_SAFETY_VIOLATION, [Write to container `&m` via call to `remove`] -codetoanalyze/java/threadsafety/Containers.java, void Containers.poolBad(), 5, THREAD_SAFETY_VIOLATION, [Write to container `&this.codetoanalyze.java.checkers.Containers.simplePool` via call to `release`] -codetoanalyze/java/threadsafety/Dispatch.java, void Dispatch.callUnannotatedInterfaceBad(UnannotatedInterface), 1, INTERFACE_NOT_THREAD_SAFE, [Call to un-annotated interface method void UnannotatedInterface.foo()] -codetoanalyze/java/threadsafety/Dispatch.java, void Dispatch.callUnannotatedInterfaceIndirectBad(NotThreadSafe,UnannotatedInterface), 1, INTERFACE_NOT_THREAD_SAFE, [call to void NotThreadSafe.notThreadSafeOk(UnannotatedInterface),Call to un-annotated interface method void UnannotatedInterface.foo()] -codetoanalyze/java/threadsafety/Inference.java, int Inference.read4OutsideSyncBad(), 1, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.Inference.mField4`,,access to `&this.codetoanalyze.java.checkers.Inference.mField4`] -codetoanalyze/java/threadsafety/Inference.java, int Inference.unprotectedRead1Bad(), 1, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.Inference.mField1`,,access to `&this.codetoanalyze.java.checkers.Inference.mField1`] -codetoanalyze/java/threadsafety/Inference.java, int Inference.unprotectedRead2Bad(), 1, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.Inference.mField2`,,access to `&this.codetoanalyze.java.checkers.Inference.mField2`] -codetoanalyze/java/threadsafety/Locks.java, void Locks.FP_unlockOneLock(), 4, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Locks.f`] -codetoanalyze/java/threadsafety/Locks.java, void Locks.afterReentrantLockUnlockBad(), 3, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Locks.f`] -codetoanalyze/java/threadsafety/Locks.java, void Locks.afterUnlockBad(), 3, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Locks.f`] -codetoanalyze/java/threadsafety/Locks.java, void Locks.afterWriteLockUnlockBad(), 3, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Locks.f`] -codetoanalyze/java/threadsafety/Locks.java, void Locks.lockInOneBranchBad(boolean), 4, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Locks.f`] -codetoanalyze/java/threadsafety/Locks.java, void Locks.negatedReentrantLockTryLockBad(), 2, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Locks.f`] -codetoanalyze/java/threadsafety/Locks.java, void Locks.tryLockNoCheckBad(), 2, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Locks.f`] -codetoanalyze/java/threadsafety/Locks.java, void Locks.tryLockWrongBranchBad(), 3, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.Locks.f`] -codetoanalyze/java/threadsafety/Ownership.java, Ownership.(Obj,Object), 1, THREAD_SAFETY_VIOLATION, [access to `&obj.codetoanalyze.java.checkers.Obj.f`] -codetoanalyze/java/threadsafety/Ownership.java, int Ownership.readGlobalBad(), 1, THREAD_SAFETY_VIOLATION, [,access to `&#GB$codetoanalyze.java.checkers.Ownership.codetoanalyze.java.checkers.Ownership.global`,,access to `&#GB$codetoanalyze.java.checkers.Ownership.codetoanalyze.java.checkers.Ownership.global`] -codetoanalyze/java/threadsafety/Ownership.java, void Ownership.cantOwnThisBad(), 1, THREAD_SAFETY_VIOLATION, [call to void Ownership.setField(Obj),access to `&this.codetoanalyze.java.checkers.Ownership.field`] -codetoanalyze/java/threadsafety/Ownership.java, void Ownership.castThenCallBad(), 2, THREAD_SAFETY_VIOLATION, [call to void Ownership.castThenCall(Obj),call to void Subclass.doWrite(),access to `&this.codetoanalyze.java.checkers.Obj.f`] -codetoanalyze/java/threadsafety/Ownership.java, void Ownership.castThenReturnBad(), 2, THREAD_SAFETY_VIOLATION, [access to `n$5.codetoanalyze.java.checkers.Obj.f`] -codetoanalyze/java/threadsafety/Ownership.java, void Ownership.conditionalAliasBad(Obj), 1, THREAD_SAFETY_VIOLATION, [call to void Ownership.conditionalAlias(Obj,Obj),access to `&alias.codetoanalyze.java.checkers.Obj.f`] -codetoanalyze/java/threadsafety/Ownership.java, void Ownership.notOwnedInCalleeBad(Obj), 1, THREAD_SAFETY_VIOLATION, [call to void Ownership.mutateIfNotNull(Obj),access to `&o.codetoanalyze.java.checkers.Obj.f`] -codetoanalyze/java/threadsafety/Ownership.java, void Ownership.notPropagatingOwnershipToAccessPathRootedAtFormalBad(Obj), 1, THREAD_SAFETY_VIOLATION, [access to `&m.codetoanalyze.java.checkers.Obj.g`] -codetoanalyze/java/threadsafety/Ownership.java, void Ownership.notPropagatingOwnershipToUnownedLocalAccessPathBad(), 2, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.Ownership.field`,,call to void Ownership.setField(Obj),access to `&this.codetoanalyze.java.checkers.Ownership.field`] -codetoanalyze/java/threadsafety/Ownership.java, void Ownership.notPropagatingOwnershipToUnownedLocalAccessPathBad(), 3, THREAD_SAFETY_VIOLATION, [access to `&m.codetoanalyze.java.checkers.Obj.g`] -codetoanalyze/java/threadsafety/Ownership.java, void Ownership.ownInOneBranchBad(Obj,boolean), 5, THREAD_SAFETY_VIOLATION, [access to `&formal.codetoanalyze.java.checkers.Obj.f`] -codetoanalyze/java/threadsafety/Ownership.java, void Ownership.reassignParamToUnownedBad(), 1, THREAD_SAFETY_VIOLATION, [call to void Ownership.reassignParamToUnowned(Obj),access to `&o.codetoanalyze.java.checkers.Obj.f`] -codetoanalyze/java/threadsafety/Ownership.java, void Ownership.reassignToFormalBad(Obj), 2, THREAD_SAFETY_VIOLATION, [access to `&formal.codetoanalyze.java.checkers.Obj.g`] -codetoanalyze/java/threadsafety/Ownership.java, void Ownership.reassignToFormalBad(Obj), 3, THREAD_SAFETY_VIOLATION, [,access to `&formal.codetoanalyze.java.checkers.Obj.g`,,access to `&formal.codetoanalyze.java.checkers.Obj.g`] -codetoanalyze/java/threadsafety/Ownership.java, void Ownership.writeToNotOwnedInCalleeBad1(Obj), 1, THREAD_SAFETY_VIOLATION, [call to void Ownership.writeToFormal(Obj),access to `&formal.codetoanalyze.java.checkers.Obj.f`] -codetoanalyze/java/threadsafety/Ownership.java, void Ownership.writeToNotOwnedInCalleeBad2(), 2, THREAD_SAFETY_VIOLATION, [call to void Ownership.writeToFormal(Obj),access to `&formal.codetoanalyze.java.checkers.Obj.f`] -codetoanalyze/java/threadsafety/Ownership.java, void Ownership.writeToNotOwnedInCalleeBad3(Obj), 1, THREAD_SAFETY_VIOLATION, [call to void Ownership.callWriteToFormal(Obj),call to void Ownership.writeToFormal(Obj),access to `&formal.codetoanalyze.java.checkers.Obj.f`] -codetoanalyze/java/threadsafety/Ownership.java, void Ownership.writeToOwnedInCalleeOk2(), 4, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.Ownership.field`,,access to `&this.codetoanalyze.java.checkers.Ownership.field`] -codetoanalyze/java/threadsafety/RaceWithMainThread.java, void RaceWithMainThread.conditional2_bad(boolean), 6, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.RaceWithMainThread.ff`] -codetoanalyze/java/threadsafety/RaceWithMainThread.java, void RaceWithMainThread.conditional_isMainThread_ElseBranch_Bad(), 7, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.RaceWithMainThread.ff`] -codetoanalyze/java/threadsafety/RaceWithMainThread.java, void RaceWithMainThread.conditional_isMainThread_Negation_Bad(), 3, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.RaceWithMainThread.ff`] -codetoanalyze/java/threadsafety/RaceWithMainThread.java, void RaceWithMainThread.conditional_isUiThread_ElseBranch_Bad(), 7, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.RaceWithMainThread.ff`] -codetoanalyze/java/threadsafety/RaceWithMainThread.java, void RaceWithMainThread.confusedAssertBad(boolean), 7, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.RaceWithMainThread.mFld`] -codetoanalyze/java/threadsafety/RaceWithMainThread.java, void RaceWithMainThread.readProtectedUnthreadedBad(), 3, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.RaceWithMainThread.f`,,access to `&this.codetoanalyze.java.checkers.RaceWithMainThread.f`] -codetoanalyze/java/threadsafety/RaceWithMainThread.java, void RaceWithMainThread.read_unprotected_unthreaded1_Bad(), 2, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.RaceWithMainThread.f1`,,access to `&this.codetoanalyze.java.checkers.RaceWithMainThread.f1`] -codetoanalyze/java/threadsafety/RaceWithMainThread.java, void RaceWithMainThread.read_unprotected_unthreaded_Bad(), 2, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.RaceWithMainThread.f`,,access to `&this.codetoanalyze.java.checkers.RaceWithMainThread.f`] -codetoanalyze/java/threadsafety/ReadWriteRaces.java, Object ReadWriteRaces.callUnprotecteReadInCallee(), 1, THREAD_SAFETY_VIOLATION, [,call to Object ReadWriteRaces.unprotectedReadInCallee(),access to `&this.codetoanalyze.java.checkers.ReadWriteRaces.field1`,,access to `&this.codetoanalyze.java.checkers.ReadWriteRaces.field1`] -codetoanalyze/java/threadsafety/ReadWriteRaces.java, Object ReadWriteRaces.unprotectedRead1(), 1, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.ReadWriteRaces.field1`,,access to `&this.codetoanalyze.java.checkers.ReadWriteRaces.field1`] -codetoanalyze/java/threadsafety/ReadWriteRaces.java, Object ReadWriteRaces.unprotectedRead2(), 1, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.ReadWriteRaces.field2`,,access to `&this.codetoanalyze.java.checkers.ReadWriteRaces.field2`] -codetoanalyze/java/threadsafety/ReadWriteRaces.java, Object ReadWriteRaces.unprotectedRead3(), 1, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.ReadWriteRaces.field3`,,call to void ReadWriteRaces.syncWrite3(),access to `&this.codetoanalyze.java.checkers.ReadWriteRaces.field3`] -codetoanalyze/java/threadsafety/ReadWriteRaces.java, void ReadWriteRaces.m1(), 2, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.ReadWriteRaces.racy`,,access to `&this.codetoanalyze.java.checkers.ReadWriteRaces.racy`] -codetoanalyze/java/threadsafety/ReadWriteRaces.java, void ReadWriteRaces.m2(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.ReadWriteRaces.racy`] -codetoanalyze/java/threadsafety/ReadWriteRaces.java, void ReadWriteRaces.m3(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.ReadWriteRaces.racy`] -codetoanalyze/java/threadsafety/ReadWriteRaces.java, void ReadWriteRaces.readInCalleeOutsideSyncBad(int), 1, THREAD_SAFETY_VIOLATION, [,call to int C.get(),access to `&this.codetoanalyze.java.checkers.C.x`,,call to void C.set(int),access to `&this.codetoanalyze.java.checkers.C.x`] -codetoanalyze/java/threadsafety/SubFld.java, int SubFld.getG(), 6, THREAD_SAFETY_VIOLATION, [,call to int SuperFld.getG(),access to `&this.SuperFld.g`,,access to `&this.SuperFld.g`] -codetoanalyze/java/threadsafety/ThreadSafeExample.java, Object ThreadSafeExample.FP_lazyInitOk(), 6, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.ThreadSafeExample.sStaticField`,,access to `&this.codetoanalyze.java.checkers.ThreadSafeExample.sStaticField`] -codetoanalyze/java/threadsafety/ThreadSafeExample.java, void ExtendsThreadSafeExample.newmethodBad(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.ExtendsThreadSafeExample.field`] -codetoanalyze/java/threadsafety/ThreadSafeExample.java, void ExtendsThreadSafeExample.tsOK(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.ExtendsThreadSafeExample.field`] -codetoanalyze/java/threadsafety/ThreadSafeExample.java, void ThreadSafeExample.callPublicMethodBad(), 1, THREAD_SAFETY_VIOLATION, [call to void ThreadSafeExample.assignInPrivateMethodOk(),access to `&this.codetoanalyze.java.checkers.ThreadSafeExample.f`] -codetoanalyze/java/threadsafety/ThreadSafeExample.java, void ThreadSafeExample.callVisibleForTestingBad(), 1, THREAD_SAFETY_VIOLATION, [call to void ThreadSafeExample.visibleForTestingNotPublicOk(),access to `&this.codetoanalyze.java.checkers.ThreadSafeExample.f`] -codetoanalyze/java/threadsafety/ThreadSafeExample.java, void ThreadSafeExample.deeperTraceBad(), 1, THREAD_SAFETY_VIOLATION, [call to void ThreadSafeExample.callAssignInPrivateMethod(),call to void ThreadSafeExample.assignInPrivateMethodOk(),access to `&this.codetoanalyze.java.checkers.ThreadSafeExample.f`] -codetoanalyze/java/threadsafety/ThreadSafeExample.java, void ThreadSafeExample.oddBad(), 1, THREAD_SAFETY_VIOLATION, [call to void ThreadSafeExample.evenOk(),access to `&this.codetoanalyze.java.checkers.ThreadSafeExample.f`] -codetoanalyze/java/threadsafety/ThreadSafeExample.java, void ThreadSafeExample.recursiveBad(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.ThreadSafeExample.f`] -codetoanalyze/java/threadsafety/ThreadSafeExample.java, void ThreadSafeExample.tsBad(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.ThreadSafeExample.f`] -codetoanalyze/java/threadsafety/ThreadSafeExample.java, void YesThreadSafeExtendsNotThreadSafeExample.subsubmethodBad(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.YesThreadSafeExtendsNotThreadSafeExample.subsubfield`] -codetoanalyze/java/threadsafety/ThreadSafeMethods.java, Object ThreadSafeMethods.readSameFieldAsThreadSafeMethod1Bad(), 1, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field1`,,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field1`] -codetoanalyze/java/threadsafety/ThreadSafeMethods.java, Object ThreadSafeMethods.readSameFieldAsThreadSafeMethod2Bad(), 1, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field4`,,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field4`] -codetoanalyze/java/threadsafety/ThreadSafeMethods.java, Object ThreadSafeMethods.readSameFieldAsThreadSafeMethodWhileSynchronized1Bad(), 1, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field1`,,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field1`] -codetoanalyze/java/threadsafety/ThreadSafeMethods.java, Object ThreadSafeMethods.threadSafeMethodReadBad(), 1, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field2`,,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field2`] -codetoanalyze/java/threadsafety/ThreadSafeMethods.java, Object ThreadSafeMethodsSubclass.readThreadSafeFieldOfOverrideBad(), 1, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethodsSubclass.subclassField`,,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethodsSubclass.subclassField`] -codetoanalyze/java/threadsafety/ThreadSafeMethods.java, void ThreadSafeMethods.threadSafeMethodWriteBad(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field1`] -codetoanalyze/java/threadsafety/ThreadSafeMethods.java, void ThreadSafeMethods.threadSafePrivateMethodBad(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field2`] -codetoanalyze/java/threadsafety/ThreadSafeMethods.java, void ThreadSafeMethods.threadSafeVisibleForTestingMethodBad(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field3`] -codetoanalyze/java/threadsafety/ThreadSafeMethods.java, void ThreadSafeMethods.writeSameFieldAsThreadSafeMethod1Bad(), 2, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field1`,,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field1`] -codetoanalyze/java/threadsafety/ThreadSafeMethods.java, void ThreadSafeMethods.writeSameFieldAsThreadSafeMethod2Bad(), 1, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field4`,,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethods.field4`] -codetoanalyze/java/threadsafety/ThreadSafeMethods.java, void ThreadSafeMethodsSubclass.safeMethodOverride(), 1, THREAD_SAFETY_VIOLATION, [access to `&this.codetoanalyze.java.checkers.ThreadSafeMethodsSubclass.subclassField`] -codetoanalyze/java/threadsafety/ThreadSafeMethods.java, void ThreadSafeMethodsSubclass.writeThreadSafeFieldOfOverrideBad(), 1, THREAD_SAFETY_VIOLATION, [,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethodsSubclass.subclassField`,,access to `&this.codetoanalyze.java.checkers.ThreadSafeMethodsSubclass.subclassField`]