diff --git a/lib/dialyzer/doc/src/dialyzer.xml b/lib/dialyzer/doc/src/dialyzer.xml index 1b111b73ba38..95778b73410c 100644 --- a/lib/dialyzer/doc/src/dialyzer.xml +++ b/lib/dialyzer/doc/src/dialyzer.xml @@ -372,13 +372,6 @@ dialyzer --plts plt_1 ... plt_n -- files_to_analyze

Suppress warnings for unused functions.

- -Wrace_conditions (***) - -

Include warnings for possible race conditions. Notice that the - analysis that finds data races performs intra-procedural data flow - analysis and can sometimes explode in time. Enable it at your own - risk.

-
-Wunderspecs (***)

Warn about underspecified functions (the specification is strictly diff --git a/lib/dialyzer/src/Makefile b/lib/dialyzer/src/Makefile index 5e69bd147efd..df540a431b28 100644 --- a/lib/dialyzer/src/Makefile +++ b/lib/dialyzer/src/Makefile @@ -64,8 +64,6 @@ MODULES = \ dialyzer_gui_wx \ dialyzer_options \ dialyzer_plt \ - dialyzer_race_data_server \ - dialyzer_races \ dialyzer_succ_typings \ dialyzer_timing \ dialyzer_typesig \ diff --git a/lib/dialyzer/src/dialyzer.app.src b/lib/dialyzer/src/dialyzer.app.src index 93d004d2e7f4..cc340a7fd93d 100644 --- a/lib/dialyzer/src/dialyzer.app.src +++ b/lib/dialyzer/src/dialyzer.app.src @@ -40,8 +40,6 @@ dialyzer_gui_wx, dialyzer_options, dialyzer_plt, - dialyzer_race_data_server, - dialyzer_races, dialyzer_succ_typings, dialyzer_typesig, dialyzer_utils, diff --git a/lib/dialyzer/src/dialyzer.erl b/lib/dialyzer/src/dialyzer.erl index 32dcb25544a5..255407792fc1 100644 --- a/lib/dialyzer/src/dialyzer.erl +++ b/lib/dialyzer/src/dialyzer.erl @@ -503,10 +503,6 @@ message_to_string({opaque_size, [SizeType, Size]}, I, _E) -> message_to_string({opaque_call, [M, F, Args, Culprit, OpaqueType]}, I, _E) -> io_lib:format("The call ~s:~ts~ts breaks the opacity of the term ~ts :: ~ts\n", [M, F, a(Args, I), c(Culprit, I), t(OpaqueType, I)]); -%%----- Warnings for concurrency errors -------------------- -message_to_string({race_condition, [M, F, Args, Reason]}, I, _E) -> - %% There is a possibly huge type in Reason. - io_lib:format("The call ~w:~tw~ts ~ts\n", [M, F, a(Args, I), Reason]); %%----- Warnings for behaviour errors -------------------- message_to_string({callback_type_mismatch, [B, F, A, ST, CT]}, I, _E) -> io_lib:format("The inferred return type of ~tw/~w ~ts has nothing in" diff --git a/lib/dialyzer/src/dialyzer.hrl b/lib/dialyzer/src/dialyzer.hrl index 26ba0afea42b..9338d76ef2c1 100644 --- a/lib/dialyzer/src/dialyzer.hrl +++ b/lib/dialyzer/src/dialyzer.hrl @@ -52,7 +52,6 @@ -define(WARN_CONTRACT_RANGE, warn_contract_range). -define(WARN_CALLGRAPH, warn_callgraph). -define(WARN_UNMATCHED_RETURN, warn_umatched_return). --define(WARN_RACE_CONDITION, warn_race_condition). -define(WARN_BEHAVIOUR, warn_behaviour). -define(WARN_UNDEFINED_CALLBACK, warn_undefined_callbacks). -define(WARN_UNKNOWN, warn_unknown). @@ -71,7 +70,7 @@ | ?WARN_FUN_APP | ?WARN_MAP_CONSTRUCTION | ?WARN_MATCHING | ?WARN_NON_PROPER_LIST | ?WARN_NOT_CALLED | ?WARN_OPAQUE - | ?WARN_RACE_CONDITION | ?WARN_RETURN_NO_RETURN + | ?WARN_RETURN_NO_RETURN | ?WARN_RETURN_ONLY_EXIT | ?WARN_UNDEFINED_CALLBACK | ?WARN_UNKNOWN | ?WARN_UNMATCHED_RETURN. @@ -126,7 +125,6 @@ | 'no_undefined_callbacks' | 'no_underspecs' | 'no_unused' - | 'race_conditions' | 'underspecs' | 'unknown' | 'unmatched_returns' @@ -180,7 +178,6 @@ start_from = byte_code :: start_from(), plt :: dialyzer_plt:plt(), use_contracts = true :: boolean(), - race_detection = false :: boolean(), behaviours_chk = false :: boolean(), timing = false :: boolean() | 'debug', timing_server = none :: dialyzer_timing:timing_server(), diff --git a/lib/dialyzer/src/dialyzer_analysis_callgraph.erl b/lib/dialyzer/src/dialyzer_analysis_callgraph.erl index de03192c47be..75da4457dde1 100644 --- a/lib/dialyzer/src/dialyzer_analysis_callgraph.erl +++ b/lib/dialyzer/src/dialyzer_analysis_callgraph.erl @@ -68,9 +68,8 @@ start(Parent, LegalWarnings, Analysis) -> TimingServer = dialyzer_timing:init(Analysis#analysis.timing), - RacesOn = ordsets:is_element(?WARN_RACE_CONDITION, LegalWarnings), Analysis0 = - Analysis#analysis{race_detection = RacesOn, timing_server = TimingServer}, + Analysis#analysis{timing_server = TimingServer}, Analysis1 = expand_files(Analysis0), Analysis2 = run_analysis(Analysis1, LegalWarnings), State = #server_state{parent = Parent}, @@ -145,17 +144,11 @@ analysis_start(Parent, Analysis, LegalWarnings) -> Exports = dialyzer_codeserver:get_exports(NewCServer), NonExports = sets:subtract(sets:from_list(AllNodes, [{version, 2}]), Exports), NonExportsList = sets:to_list(NonExports), - NewCallgraph = - case Analysis#analysis.race_detection of - true -> dialyzer_callgraph:put_race_detection(true, Callgraph); - false -> Callgraph - end, - State2 = analyze_callgraph(NewCallgraph, State1), + State2 = analyze_callgraph(Callgraph, State1), #analysis_state{plt = Plt2, doc_plt = DocPlt, codeserver = Codeserver0} = State2, {Codeserver, Plt3} = move_data(Codeserver0, Plt2), - dialyzer_callgraph:dispose_race_server(NewCallgraph), %% Since the PLT is never used, a dummy is sent: DummyPlt = dialyzer_plt:new(), send_codeserver_plt(Parent, Codeserver, DummyPlt), diff --git a/lib/dialyzer/src/dialyzer_callgraph.erl b/lib/dialyzer/src/dialyzer_callgraph.erl index 506a785885e8..f610cb0b2c6e 100644 --- a/lib/dialyzer/src/dialyzer_callgraph.erl +++ b/lib/dialyzer/src/dialyzer_callgraph.erl @@ -42,9 +42,6 @@ get_depends_on/2, %% get_required_by/2, in_neighbours/2, - renew_race_info/4, - renew_race_code/2, - renew_race_public_tables/2, reset_from_funs/2, scan_core_tree/2, strip_module_deps/2, @@ -52,12 +49,6 @@ to_dot/2, to_ps/3]). --export([cleanup/1, get_digraph/1, get_named_tables/1, get_public_tables/1, - get_race_code/1, get_race_detection/1, race_code_new/1, - put_digraph/2, put_race_code/2, put_race_detection/2, - put_named_tables/2, put_public_tables/2, put_behaviour_api_calls/2, - get_behaviour_api_calls/1, dispose_race_server/1, duplicate/1]). - -export_type([callgraph/0, mfa_or_funlbl/0, callgraph_edge/0, mod_deps/0]). -include("dialyzer.hrl"). @@ -89,24 +80,15 @@ %% whenever applicable. %%----------------------------------------------------------------------------- -%% Types with comment 'race' are due to dialyzer_races.erl. -record(callgraph, {digraph = digraph:new() :: digraph:graph(), - active_digraph :: active_digraph() - | 'undefined', % race - esc :: ets:tid() - | 'undefined', % race - letrec_map :: ets:tid() - | 'undefined', % race + active_digraph :: active_digraph() | 'undefined', + esc :: ets:tid(), + letrec_map :: ets:tid(), name_map :: ets:tid(), rev_name_map :: ets:tid(), - rec_var_map :: ets:tid() - | 'undefined', % race - self_rec :: ets:tid() - | 'undefined', % race - calls :: ets:tid() - | 'undefined', % race - race_detection = false :: boolean(), - race_data_server = dialyzer_race_data_server:new() :: pid()}). + rec_var_map :: ets:tid(), + self_rec :: ets:tid(), + calls :: ets:tid()}). %% Exported Types @@ -620,134 +602,6 @@ digraph_reaching_subgraph(Funs, DG) -> Vertices = digraph_utils:reaching(Funs, DG), digraph_utils:subgraph(DG, Vertices). -%%---------------------------------------------------------------------- -%% Races -%%---------------------------------------------------------------------- - --spec renew_race_info(callgraph(), dict:dict(), [label()], [string()]) -> - callgraph(). - -renew_race_info(#callgraph{race_data_server = RaceDataServer} = CG, - RaceCode, PublicTables, NamedTables) -> - ok = dialyzer_race_data_server:cast( - {renew_race_info, {RaceCode, PublicTables, NamedTables}}, - RaceDataServer), - CG. - --spec renew_race_code(dialyzer_races:races(), callgraph()) -> callgraph(). - -renew_race_code(Races, #callgraph{race_data_server = RaceDataServer} = CG) -> - Fun = dialyzer_races:get_curr_fun(Races), - FunArgs = dialyzer_races:get_curr_fun_args(Races), - Code = lists:reverse(dialyzer_races:get_race_list(Races)), - ok = dialyzer_race_data_server:cast( - {renew_race_code, {Fun, FunArgs, Code}}, - RaceDataServer), - CG. - --spec renew_race_public_tables(label(), callgraph()) -> callgraph(). - -renew_race_public_tables(VarLabel, - #callgraph{race_data_server = RaceDataServer} = CG) -> - ok = - dialyzer_race_data_server:cast({renew_race_public_tables, VarLabel}, RaceDataServer), - CG. - --spec cleanup(callgraph()) -> callgraph(). - -cleanup(#callgraph{digraph = Digraph, - name_map = NameMap, - rev_name_map = RevNameMap, - race_data_server = RaceDataServer}) -> - #callgraph{digraph = Digraph, - name_map = NameMap, - rev_name_map = RevNameMap, - race_data_server = dialyzer_race_data_server:duplicate(RaceDataServer)}. - --spec duplicate(callgraph()) -> callgraph(). - -duplicate(#callgraph{race_data_server = RaceDataServer} = Callgraph) -> - Callgraph#callgraph{ - race_data_server = dialyzer_race_data_server:duplicate(RaceDataServer)}. - --spec dispose_race_server(callgraph()) -> ok. - -dispose_race_server(#callgraph{race_data_server = RaceDataServer}) -> - dialyzer_race_data_server:stop(RaceDataServer). - --spec get_digraph(callgraph()) -> digraph:graph(). - -get_digraph(#callgraph{digraph = Digraph}) -> - Digraph. - --spec get_named_tables(callgraph()) -> [string()]. - -get_named_tables(#callgraph{race_data_server = RaceDataServer}) -> - dialyzer_race_data_server:call(get_named_tables, RaceDataServer). - --spec get_public_tables(callgraph()) -> [label()]. - -get_public_tables(#callgraph{race_data_server = RaceDataServer}) -> - dialyzer_race_data_server:call(get_public_tables, RaceDataServer). - --spec get_race_code(callgraph()) -> dict:dict(). - -get_race_code(#callgraph{race_data_server = RaceDataServer}) -> - dialyzer_race_data_server:call(get_race_code, RaceDataServer). - --spec get_race_detection(callgraph()) -> boolean(). - -get_race_detection(#callgraph{race_detection = RD}) -> - RD. - --spec get_behaviour_api_calls(callgraph()) -> [{mfa(), mfa()}]. - -get_behaviour_api_calls(#callgraph{race_data_server = RaceDataServer}) -> - dialyzer_race_data_server:call(get_behaviour_api_calls, RaceDataServer). - --spec race_code_new(callgraph()) -> callgraph(). - -race_code_new(#callgraph{race_data_server = RaceDataServer} = CG) -> - ok = dialyzer_race_data_server:cast(race_code_new, RaceDataServer), - CG. - --spec put_digraph(digraph:graph(), callgraph()) -> callgraph(). - -put_digraph(Digraph, Callgraph) -> - Callgraph#callgraph{digraph = Digraph}. - --spec put_race_code(dict:dict(), callgraph()) -> callgraph(). - -put_race_code(RaceCode, #callgraph{race_data_server = RaceDataServer} = CG) -> - ok = dialyzer_race_data_server:cast({put_race_code, RaceCode}, RaceDataServer), - CG. - --spec put_race_detection(boolean(), callgraph()) -> callgraph(). - -put_race_detection(RaceDetection, Callgraph) -> - Callgraph#callgraph{race_detection = RaceDetection}. - --spec put_named_tables([string()], callgraph()) -> callgraph(). - -put_named_tables(NamedTables, - #callgraph{race_data_server = RaceDataServer} = CG) -> - ok = dialyzer_race_data_server:cast({put_named_tables, NamedTables}, RaceDataServer), - CG. - --spec put_public_tables([label()], callgraph()) -> callgraph(). - -put_public_tables(PublicTables, - #callgraph{race_data_server = RaceDataServer} = CG) -> - ok = dialyzer_race_data_server:cast({put_public_tables, PublicTables}, RaceDataServer), - CG. - --spec put_behaviour_api_calls([{mfa(), mfa()}], callgraph()) -> callgraph(). - -put_behaviour_api_calls(Calls, - #callgraph{race_data_server = RaceDataServer} = CG) -> - ok = dialyzer_race_data_server:cast({put_behaviour_api_calls, Calls}, RaceDataServer), - CG. - %%============================================================================= %% Utilities for 'dot' %%============================================================================= diff --git a/lib/dialyzer/src/dialyzer_cl_parse.erl b/lib/dialyzer/src/dialyzer_cl_parse.erl index ff7930f21a7c..b78bfd442d62 100644 --- a/lib/dialyzer/src/dialyzer_cl_parse.erl +++ b/lib/dialyzer/src/dialyzer_cl_parse.erl @@ -544,8 +544,6 @@ warning_options_msg() -> value or do not match against one of many possible return value(s). -Werror_handling *** Include warnings for functions that only return by means of an exception. - -Wrace_conditions *** - Include warnings for possible race conditions. -Wunderspecs *** Warn about underspecified functions (those whose -spec is strictly more allowing than the success typing). diff --git a/lib/dialyzer/src/dialyzer_dataflow.erl b/lib/dialyzer/src/dialyzer_dataflow.erl index 63b430671c96..b333b67ab232 100644 --- a/lib/dialyzer/src/dialyzer_dataflow.erl +++ b/lib/dialyzer/src/dialyzer_dataflow.erl @@ -24,16 +24,6 @@ -export([get_fun_types/5, get_warnings/5, format_args/3]). -%% Data structure interfaces. --export([state__add_warning/2, state__cleanup/1, - state__duplicate/1, dispose_state/1, - state__get_callgraph/1, state__get_races/1, - state__get_records/1, state__put_callgraph/2, - state__put_races/2, state__records_only/1, - state__find_function/2]). - --export_type([state/0]). - -include("dialyzer.hrl"). -import(erl_types, @@ -89,31 +79,19 @@ -define(BITS, 128). -%% Types with comment 'race' are due to dialyzer_races.erl. --record(state, {callgraph :: dialyzer_callgraph:callgraph() - | 'undefined', % race - codeserver :: dialyzer_codeserver:codeserver() - | 'undefined', % race - envs :: env_tab() - | 'undefined', % race - fun_tab :: fun_tab() - | 'undefined', % race - fun_homes :: dict:dict(label(), mfa()) - | 'undefined', % race - reachable_funs :: sets:set(label()) - | 'undefined', % race - plt :: dialyzer_plt:plt() - | 'undefined', % race - opaques :: [type()] - | 'undefined', % race - races = dialyzer_races:new() :: dialyzer_races:races(), +-record(state, {callgraph :: dialyzer_callgraph:callgraph(), + codeserver :: dialyzer_codeserver:codeserver(), + envs :: env_tab(), + fun_tab :: fun_tab(), + fun_homes :: dict:dict(label(), mfa()), + reachable_funs :: sets:set(label()), + plt :: dialyzer_plt:plt(), + opaques :: [type()], records = dict:new() :: types(), - tree_map :: dict:dict(label(), cerl:cerl()) - | 'undefined', % race + tree_map :: dict:dict(label(), cerl:cerl()), warning_mode = false :: boolean(), warnings = [] :: [raw_warning()], - work :: {[_], [_], sets:set()} - | 'undefined', % race + work :: {[_], [_], sets:set()}, module :: module(), curr_fun :: curr_fun() }). @@ -132,9 +110,7 @@ -type type_tab() :: #{key() => type()}. -type subst_tab() :: #{key() => cerl:cerl()}. -%% Exported Types - --opaque state() :: #state{}. +-type state() :: #state{}. %%-------------------------------------------------------------------- @@ -149,8 +125,7 @@ get_warnings(Tree, Plt, Callgraph, Codeserver, Records) -> State1 = analyze_module(Tree, Plt, Callgraph, Codeserver, Records, true), State2 = state__renew_warnings(state__get_warnings(State1), State1), - State3 = state__get_race_warnings(State2), - {State3#state.warnings, state__all_fun_types(State3)}. + {State2#state.warnings, state__all_fun_types(State2)}. -spec get_fun_types(cerl:c_module(), dialyzer_plt:plt(), dialyzer_callgraph:callgraph(), @@ -172,15 +147,13 @@ analyze_module(Tree, Plt, Callgraph, Codeserver, Records, GetWarnings) -> Module = cerl:atom_val(cerl:module_name(Tree)), TopFun = cerl:ann_c_fun([{label, top}], [], Tree), State = state__new(Callgraph, Codeserver, TopFun, Plt, Module, Records), - State1 = state__race_analysis(not GetWarnings, State), - State2 = analyze_loop(State1), + State1 = analyze_loop(State), case GetWarnings of true -> - State3 = state__set_warning_mode(State2), - State4 = analyze_loop(State3), - dialyzer_races:race(State4); + State2 = state__set_warning_mode(State1), + analyze_loop(State2); false -> - State2 + State1 end. analyze_loop(State) -> @@ -209,32 +182,16 @@ analyze_loop(State) -> Vars = cerl:fun_vars(Fun), Map1 = enter_type_lists(Vars, ArgTypes, Map), Body = cerl:fun_body(Fun), - FunLabel = get_label(Fun), - IsRaceAnalysisEnabled = is_race_analysis_enabled(State), - NewState3 = - case IsRaceAnalysisEnabled of - true -> - NewState2 = state__renew_curr_fun( - state__lookup_name(FunLabel, NewState1), FunLabel, - NewState1), - state__renew_race_list([], 0, NewState2); - false -> NewState1 - end, - {NewState4, _Map2, BodyType} = - traverse(Body, Map1, NewState3), + {NewState2, _Map2, BodyType} = + traverse(Body, Map1, NewState1), ?debug("Done analyzing: ~w:~ts\n", [NewState1#state.curr_fun, t_to_string(t_fun(ArgTypes, BodyType))]), - NewState5 = - case IsRaceAnalysisEnabled of - true -> renew_race_code(NewState4); - false -> NewState4 - end, - NewState6 = - state__update_fun_entry(Fun, ArgTypes, BodyType, NewState5), + NewState3 = + state__update_fun_entry(Fun, ArgTypes, BodyType, NewState2), ?debug("done adding stuff for ~tw\n", [state__lookup_name(get_label(Fun), State)]), - analyze_loop(NewState6) + analyze_loop(NewState3) end end end. @@ -544,16 +501,6 @@ handle_apply_or_call([{TypeOfApply, {Fun, Sig, Contr, LocalRet}}|Left], ?debug("ContrRet: ~ts\n", [erl_types:t_to_string(ContrRet)]), ?debug("LocalRet: ~ts\n", [erl_types:t_to_string(LocalRet)]), - State1 = - case is_race_analysis_enabled(State) of - true -> - Ann = cerl:get_ann(Tree), - File = get_file(Ann, State), - Location = get_location(Tree), - dialyzer_races:store_race_call(Fun, ArgTypes, Args, - {File, Location}, State); - false -> State - end, FailedConj = any_none([RetWithoutLocal|NewArgTypes]), IsFailBif = t_is_none(BifRange(BifArgs)), IsFailSig = t_is_none(SigRange), @@ -575,7 +522,7 @@ handle_apply_or_call([{TypeOfApply, {Fun, Sig, Contr, LocalRet}}|Left], %% This Msg will be post_processed by dialyzer_succ_typings Msg = {contract_range, [Contract, M1, F1, A1, ArgStrings, CRet]}, - state__add_warning(State1, ?WARN_CONTRACT_RANGE, Tree, Msg); + state__add_warning(State, ?WARN_CONTRACT_RANGE, Tree, Msg); false -> FailedSig = any_none(NewArgsSig), FailedContract = @@ -586,7 +533,7 @@ handle_apply_or_call([{TypeOfApply, {Fun, Sig, Contr, LocalRet}}|Left], FailReason = apply_fail_reason(FailedSig, FailedBif, FailedContract), Msg = get_apply_fail_msg(Fun, Args, ArgTypes, NewArgTypes, InfSig, - Contr, CArgs, State1, FailReason, Opaques), + Contr, CArgs, State, FailReason, Opaques), WarnType = case Msg of {call, _} -> ?WARN_FAILING_CALL; {apply, _} -> ?WARN_FAILING_CALL; @@ -608,9 +555,9 @@ handle_apply_or_call([{TypeOfApply, {Fun, Sig, Contr, LocalRet}}|Left], Tree end, Frc = {erlang, is_record, 3} =:= state__lookup_name(Fun, State), - state__add_warning(State1, WarnType, LocTree, Msg, Frc) + state__add_warning(State, WarnType, LocTree, Msg, Frc) end; - false -> State1 + false -> State end, State3 = case TypeOfApply of @@ -1001,17 +948,9 @@ handle_case(Tree, Map, State) -> case t_is_none_or_unit(ArgType) of true -> SMA; false -> - State2 = - case is_race_analysis_enabled(State) of - true -> - {RaceList, RaceListSize} = get_race_list_and_size(State1), - state__renew_race_list([beg_case|RaceList], - RaceListSize + 1, State1); - false -> State1 - end, Map2 = join_maps_begin(Map1), {MapList, State3, Type, Warns} = - handle_clauses(Clauses, Arg, ArgType, ArgType, State2, + handle_clauses(Clauses, Arg, ArgType, ArgType, State1, [], Map2, [], [], []), %% Non-Erlang BEAM languages, such as Elixir, expand language constructs %% into case statements. In that case, we do not want to warn on @@ -1048,45 +987,22 @@ handle_cons(Tree, Map, State) -> %%---------------------------------------- handle_let(Tree, Map, State) -> - IsRaceAnalysisEnabled = is_race_analysis_enabled(State), Arg = cerl:let_arg(Tree), Vars = cerl:let_vars(Tree), {Map0, State0} = case cerl:is_c_var(Arg) of true -> [Var] = Vars, - {enter_subst(Var, Arg, Map), - case IsRaceAnalysisEnabled of - true -> - {RaceList, RaceListSize} = get_race_list_and_size(State), - state__renew_race_list( - [dialyzer_races:let_tag_new(Var, Arg)|RaceList], - RaceListSize + 1, State); - false -> State - end}; + {enter_subst(Var, Arg, Map), State}; false -> {Map, State} end, Body = cerl:let_body(Tree), {State1, Map1, ArgTypes} = SMA = traverse(Arg, Map0, State0), - State2 = - case IsRaceAnalysisEnabled andalso cerl:is_c_call(Arg) of - true -> - Mod = cerl:call_module(Arg), - Name = cerl:call_name(Arg), - case cerl:is_literal(Mod) andalso - cerl:concrete(Mod) =:= ets andalso - cerl:is_literal(Name) andalso - cerl:concrete(Name) =:= new of - true -> renew_race_public_tables(Vars, State1); - false -> State1 - end; - false -> State1 - end, case t_is_none_or_unit(ArgTypes) of true -> SMA; false -> Map2 = enter_type_lists(Vars, t_to_tlist(ArgTypes), Map1), - traverse(Body, Map2, State2) + traverse(Body, Map2, State1) end. %%---------------------------------------- @@ -1263,62 +1179,24 @@ field_name(Elements, ErrorPat, FieldNames) -> %% Clauses %% handle_clauses([C|Left], Arg, ArgType, OrigArgType, State, CaseTypes, MapIn, - Acc, ClauseAcc, WarnAcc0) -> - IsRaceAnalysisEnabled = is_race_analysis_enabled(State), - State1 = - case IsRaceAnalysisEnabled of - true -> - {RaceList, RaceListSize} = get_race_list_and_size(State), - state__renew_race_list( - [dialyzer_races:beg_clause_new(Arg, cerl:clause_pats(C), - cerl:clause_guard(C))| - RaceList], RaceListSize + 1, - State); - false -> State - end, - {State2, ClauseMap, BodyType, NewArgType, WarnAcc} = - do_clause(C, Arg, ArgType, OrigArgType, MapIn, State1, WarnAcc0), - {NewClauseAcc, State3} = - case IsRaceAnalysisEnabled of - true -> - {RaceList1, RaceListSize1} = get_race_list_and_size(State2), - EndClause = dialyzer_races:end_clause_new(Arg, cerl:clause_pats(C), - cerl:clause_guard(C)), - {[EndClause|ClauseAcc], - state__renew_race_list([EndClause|RaceList1], - RaceListSize1 + 1, State2)}; - false -> {ClauseAcc, State2} - end, + Acc, NewClauseAcc, WarnAcc0) -> + {State1, ClauseMap, BodyType, NewArgType, WarnAcc} = + do_clause(C, Arg, ArgType, OrigArgType, MapIn, State, WarnAcc0), {NewCaseTypes, NewAcc} = case t_is_none(BodyType) of true -> {CaseTypes, Acc}; false -> {[BodyType|CaseTypes], [ClauseMap|Acc]} end, - handle_clauses(Left, Arg, NewArgType, OrigArgType, State3, + handle_clauses(Left, Arg, NewArgType, OrigArgType, State1, NewCaseTypes, MapIn, NewAcc, NewClauseAcc, WarnAcc); handle_clauses([], _Arg, _ArgType, _OrigArgType, State, CaseTypes, _MapIn, Acc, - ClauseAcc, WarnAcc) -> - State1 = - case is_race_analysis_enabled(State) of - true -> - {RaceList, RaceListSize} = get_race_list_and_size(State), - state__renew_race_list( - [dialyzer_races:end_case_new(ClauseAcc)|RaceList], - RaceListSize + 1, State); - false -> State - end, - {lists:reverse(Acc), State1, t_sup(CaseTypes), WarnAcc}. + _ClauseAcc, WarnAcc) -> + {lists:reverse(Acc), State, t_sup(CaseTypes), WarnAcc}. do_clause(C, Arg, ArgType0, OrigArgType, Map, State, Warns) -> Pats = cerl:clause_pats(C), Guard = cerl:clause_guard(C), Body = cerl:clause_body(C), - State1 = - case is_race_analysis_enabled(State) of - true -> - state__renew_fun_args(Pats, State); - false -> State - end, Map0 = mark_as_fresh(Pats, Map), Map1 = bind_subst(Arg, Pats, Map0), BindRes = @@ -1331,15 +1209,15 @@ do_clause(C, Arg, ArgType0, OrigArgType, Map, State, Warns) -> true -> [ArgType0 || _ <- Pats]; false -> t_to_tlist(ArgType0) end, - bind_pat_vars(Pats, ArgTypes, [], Map1, State1) + bind_pat_vars(Pats, ArgTypes, [], Map1, State) end, case BindRes of {error, ErrorType, NewPats, Type, OpaqueTerm} -> ?debug("Failed binding pattern: ~ts\nto ~ts\n", - [cerl_prettypr:format(C), format_type(ArgType0, State1)]), - case state__warning_mode(State1) of + [cerl_prettypr:format(C), format_type(ArgType0, State)]), + case state__warning_mode(State) of false -> - {State1, Map, t_none(), ArgType0, Warns}; + {State, Map, t_none(), ArgType0, Warns}; true -> {Msg, Force} = case t_is_none(ArgType0) of @@ -1352,9 +1230,9 @@ do_clause(C, Arg, ArgType0, OrigArgType, Map, State, Warns) -> false -> t_to_tlist(OrigArgType) end, PatString = format_patterns(Pats), - ArgTypeString = format_type(OrigArgType, State1), + ArgTypeString = format_type(OrigArgType, State), BindResOrig = - bind_pat_vars(Pats, OrigArgTypes, [], Map1, State1), + bind_pat_vars(Pats, OrigArgTypes, [], Map1, State), Tag = case BindResOrig of {error, bind, _, _, _} -> pattern_match; @@ -1365,7 +1243,7 @@ do_clause(C, Arg, ArgType0, OrigArgType, Map, State, Warns) -> PatTypes = case BindResOrig of {error, opaque, _, _, OpaqueType} -> [PatString, ArgTypeString, - format_type(OpaqueType, State1)]; + format_type(OpaqueType, State)]; _ -> [PatString, ArgTypeString] end, {{Tag, PatTypes}, false}; @@ -1409,10 +1287,10 @@ do_clause(C, Arg, ArgType0, OrigArgType, Map, State, Warns) -> opaque -> format_patterns(NewPats) end, PatTypes = case ErrorType of - bind -> [PatString, format_type(ArgType0, State1)]; - record -> [PatString, format_type(Type, State1)]; - opaque -> [PatString, format_type(Type, State1), - format_type(OpaqueTerm, State1)] + bind -> [PatString, format_type(ArgType0, State)]; + record -> [PatString, format_type(Type, State)]; + opaque -> [PatString, format_type(Type, State), + format_type(OpaqueTerm, State)] end, FailedTag = case ErrorType of bind -> pattern_match; @@ -1427,20 +1305,20 @@ do_clause(C, Arg, ArgType0, OrigArgType, Map, State, Warns) -> {record_match, _} -> ?WARN_MATCHING; {pattern_match_cov, _} -> ?WARN_MATCHING end, - {State1, Map, t_none(), ArgType0, [{WarnType, C, Msg, Force}|Warns]} + {State, Map, t_none(), ArgType0, [{WarnType, C, Msg, Force}|Warns]} end; {Map2, PatTypes} -> %% Try to bind the argument. Will only succeed if %% it is a simple structured term. Map3 = case bind_pat_vars_reverse([Arg], [t_product(PatTypes)], - [], Map2, State1) of + [], Map2, State) of {error, _, _, _, _} -> Map2; {NewMap, _} -> NewMap end, GenType = dialyzer_typesig:get_safe_underapprox(Pats, Guard), NewArgType = t_subtract(t_product(t_to_tlist(ArgType0)), GenType), - case bind_guard(Guard, Map3, State1) of + case bind_guard(Guard, Map3, State) of {error, Reason} -> ?debug("Failed guard: ~ts\n", [cerl_prettypr:format(C, [{hook, cerl_typean:pp_hook()}])]), @@ -1449,7 +1327,7 @@ do_clause(C, Arg, ArgType0, OrigArgType, Map, State, Warns) -> case Pats =:= [] of true -> {guard_fail, []}; false -> - {guard_fail_pat, [PatString, format_type(ArgType0, State1)]} + {guard_fail_pat, [PatString, format_type(ArgType0, State)]} end, Warn = case Reason of @@ -1467,9 +1345,9 @@ do_clause(C, Arg, ArgType0, OrigArgType, Map, State, Warns) -> {?WARN_MATCHING, C, Msg, false} end end, - {State1, Map, t_none(), NewArgType, [Warn|Warns]}; + {State, Map, t_none(), NewArgType, [Warn|Warns]}; Map4 -> - {RetState, RetMap, BodyType} = traverse(Body, Map4, State1), + {RetState, RetMap, BodyType} = traverse(Body, Map4, State), {RetState, RetMap, BodyType, NewArgType, Warns} end end. @@ -3014,7 +2892,7 @@ state__new(Callgraph, Codeserver, Tree, Plt, Module, Records) -> dict:new(), Funs), #state{callgraph = Callgraph, codeserver = Codeserver, envs = Env, fun_tab = FunTab, fun_homes = FunHomes, opaques = Opaques, - plt = Plt, races = dialyzer_races:new(), records = Records, + plt = Plt, records = Records, warning_mode = false, warnings = [], work = Work, tree_map = TreeMap, module = Module, reachable_funs = sets:new([{version, 2}])}. @@ -3022,7 +2900,7 @@ state__warning_mode(#state{warning_mode = WM}) -> WM. state__set_warning_mode(#state{tree_map = TreeMap, fun_tab = FunTab, - races = Races, callgraph = Callgraph, + callgraph = Callgraph, reachable_funs = ReachableFuns} = State) -> ?debug("==========\nStarting warning pass\n==========\n", []), Funs = dict:fetch_keys(TreeMap), @@ -3032,37 +2910,11 @@ state__set_warning_mode(#state{tree_map = TreeMap, fun_tab = FunTab, dialyzer_callgraph:lookup_name(Fun, Callgraph) =/= error orelse sets:is_element(Fun, ReachableFuns)], State#state{work = init_work(Work), - fun_tab = FunTab, warning_mode = true, - races = dialyzer_races:put_race_analysis(true, Races)}. - -state__race_analysis(Analysis, #state{races = Races} = State) -> - State#state{races = dialyzer_races:put_race_analysis(Analysis, Races)}. - -state__renew_curr_fun(CurrFun, CurrFunLabel, - #state{races = Races} = State) -> - State#state{races = dialyzer_races:put_curr_fun(CurrFun, CurrFunLabel, - Races)}. - -state__renew_fun_args(Args, #state{races = Races} = State) -> - case state__warning_mode(State) of - true -> State; - false -> - State#state{races = dialyzer_races:put_fun_args(Args, Races)} - end. - -state__renew_race_list(RaceList, RaceListSize, - #state{races = Races} = State) -> - State#state{races = dialyzer_races:put_race_list(RaceList, RaceListSize, - Races)}. + fun_tab = FunTab, warning_mode = true}. state__renew_warnings(Warnings, State) -> State#state{warnings = Warnings}. --spec state__add_warning(raw_warning(), state()) -> state(). - -state__add_warning(Warn, #state{warnings = Warnings} = State) -> - State#state{warnings = [Warn|Warnings]}. - state__add_warning(State, Tag, Tree, Msg) -> state__add_warning(State, Tag, Tree, Msg, false). @@ -3113,15 +2965,6 @@ state__set_curr_fun(undefined, State) -> state__set_curr_fun(FunLbl, State) -> State#state{curr_fun = find_function(FunLbl, State)}. --spec state__find_function(mfa_or_funlbl(), state()) -> mfa_or_funlbl(). - -state__find_function(FunLbl, State) -> - find_function(FunLbl, State). - -state__get_race_warnings(#state{races = Races} = State) -> - {Races1, State1} = dialyzer_races:get_race_warnings(Races, State), - State1#state{races = Races1}. - state__get_warnings(#state{tree_map = TreeMap, fun_tab = FunTab, callgraph = Callgraph, plt = Plt, reachable_funs = ReachableFuns} = State) -> @@ -3449,101 +3292,12 @@ forward_args(Fun, ArgTypes, #state{work = Work, fun_tab = FunTab} = State) -> State#state{work = NewWork, fun_tab = NewFunTab} end. --spec state__cleanup(state()) -> state(). - -state__cleanup(#state{callgraph = Callgraph, - races = Races, - records = Records}) -> - #state{callgraph = dialyzer_callgraph:cleanup(Callgraph), - races = dialyzer_races:cleanup(Races), - records = Records}. - --spec state__duplicate(state()) -> state(). - -state__duplicate(#state{callgraph = Callgraph} = State) -> - State#state{callgraph = dialyzer_callgraph:duplicate(Callgraph)}. - --spec dispose_state(state()) -> ok. - -dispose_state(#state{callgraph = Callgraph}) -> - dialyzer_callgraph:dispose_race_server(Callgraph). - --spec state__get_callgraph(state()) -> dialyzer_callgraph:callgraph(). - -state__get_callgraph(#state{callgraph = Callgraph}) -> - Callgraph. - --spec state__get_races(state()) -> dialyzer_races:races(). - -state__get_races(#state{races = Races}) -> - Races. - --spec state__get_records(state()) -> types(). - -state__get_records(#state{records = Records}) -> - Records. - --spec state__put_callgraph(dialyzer_callgraph:callgraph(), state()) -> - state(). - -state__put_callgraph(Callgraph, State) -> - State#state{callgraph = Callgraph}. - --spec state__put_races(dialyzer_races:races(), state()) -> state(). - -state__put_races(Races, State) -> - State#state{races = Races}. - --spec state__records_only(state()) -> state(). - -state__records_only(#state{records = Records}) -> - #state{records = Records}. - -spec state__translate_file(file:filename(), state()) -> file:filename(). state__translate_file(FakeFile, State) -> #state{codeserver = CodeServer, module = Module} = State, dialyzer_codeserver:translate_fake_file(CodeServer, Module, FakeFile). -%%% =========================================================================== -%%% -%%% Races -%%% -%%% =========================================================================== - -is_race_analysis_enabled(#state{races = Races, callgraph = Callgraph}) -> - RaceDetection = dialyzer_callgraph:get_race_detection(Callgraph), - RaceAnalysis = dialyzer_races:get_race_analysis(Races), - RaceDetection andalso RaceAnalysis. - -get_race_list_and_size(#state{races = Races}) -> - dialyzer_races:get_race_list_and_size(Races). - -renew_race_code(#state{races = Races, callgraph = Callgraph, - warning_mode = WarningMode} = State) -> - case WarningMode of - true -> State; - false -> - NewCallgraph = dialyzer_callgraph:renew_race_code(Races, Callgraph), - State#state{callgraph = NewCallgraph} - end. - -renew_race_public_tables([Var], #state{races = Races, callgraph = Callgraph, - warning_mode = WarningMode} = State) -> - case WarningMode of - true -> State; - false -> - Table = dialyzer_races:get_new_table(Races), - case Table of - no_t -> State; - _Other -> - VarLabel = get_label(Var), - NewCallgraph = - dialyzer_callgraph:renew_race_public_tables(VarLabel, Callgraph), - State#state{callgraph = NewCallgraph} - end - end. - %%% =========================================================================== %%% %%% Worklist diff --git a/lib/dialyzer/src/dialyzer_gui_wx.erl b/lib/dialyzer/src/dialyzer_gui_wx.erl index 3a24f140e019..3b04b56f8066 100644 --- a/lib/dialyzer/src/dialyzer_gui_wx.erl +++ b/lib/dialyzer/src/dialyzer_gui_wx.erl @@ -242,7 +242,6 @@ create_window(Wx, #options{init_plts = InitPltFiles} = DialyzerOptions) -> {?WARN_OPAQUE, ?menuID_WARN_OPAQUE}, {?WARN_FAILING_CALL, ?menuID_WARN_FAIL_FUN_CALLS}, {?WARN_CALLGRAPH, ?menuID_WARN_UNEXPORTED_FUN}, - {?WARN_RACE_CONDITION, ?menuID_WARN_RACE_CONDITIONS}, %% For contracts. {?WARN_CONTRACT_TYPES,?menuID_WARN_WRONG_CONTRACTS}, {?WARN_CONTRACT_SYNTAX, ?menuID_WARN_CONTRACT_SYNTAX} @@ -313,8 +312,6 @@ createWarningsMenu() -> "Functions of no return"), addCheckedItem(WarningsMenu, ?menuID_WARN_UNEXPORTED_FUN, "Call to unexported function"), - _ = wxMenu:appendCheckItem(WarningsMenu, ?menuID_WARN_RACE_CONDITIONS, - "Possible race conditions"), addCheckedItem(WarningsMenu, ?menuID_WARN_WRONG_CONTRACTS, "Wrong contracts"), addCheckedItem(WarningsMenu, ?menuID_WARN_CONTRACT_SYNTAX, "Wrong contract syntax"), diff --git a/lib/dialyzer/src/dialyzer_gui_wx.hrl b/lib/dialyzer/src/dialyzer_gui_wx.hrl index fe763a9abcfe..0a6ca9e8b21d 100644 --- a/lib/dialyzer/src/dialyzer_gui_wx.hrl +++ b/lib/dialyzer/src/dialyzer_gui_wx.hrl @@ -31,9 +31,8 @@ -define(menuID_WARN_ERROR_HANDLING_FUN, 206). -define(menuID_WARN_NO_RETURN_FUN, 207). -define(menuID_WARN_UNEXPORTED_FUN, 208). --define(menuID_WARN_RACE_CONDITIONS, 209). --define(menuID_WARN_WRONG_CONTRACTS, 210). --define(menuID_WARN_CONTRACT_SYNTAX, 211). +-define(menuID_WARN_WRONG_CONTRACTS, 209). +-define(menuID_WARN_CONTRACT_SYNTAX, 210). -define(menuID_PLT_INIT_EMPTY, 300). -define(menuID_PLT_SHOW_CONTENTS, 301). diff --git a/lib/dialyzer/src/dialyzer_options.erl b/lib/dialyzer/src/dialyzer_options.erl index dd90630b4b03..5cd7523cec21 100644 --- a/lib/dialyzer/src/dialyzer_options.erl +++ b/lib/dialyzer/src/dialyzer_options.erl @@ -333,8 +333,6 @@ build_warnings([Opt|Opts], Warnings) -> ordsets:add_element(?WARN_UNMATCHED_RETURN, Warnings); error_handling -> ordsets:add_element(?WARN_RETURN_ONLY_EXIT, Warnings); - race_conditions -> - ordsets:add_element(?WARN_RACE_CONDITION, Warnings); no_missing_calls -> ordsets:del_element(?WARN_CALLGRAPH, Warnings); specdiffs -> diff --git a/lib/dialyzer/src/dialyzer_race_data_server.erl b/lib/dialyzer/src/dialyzer_race_data_server.erl deleted file mode 100644 index 953cebfdf17d..000000000000 --- a/lib/dialyzer/src/dialyzer_race_data_server.erl +++ /dev/null @@ -1,127 +0,0 @@ -%% -*- erlang-indent-level: 2 -*- -%% -%% Licensed under the Apache License, Version 2.0 (the "License"); -%% you may not use this file except in compliance with the License. -%% You may obtain a copy of the License at -%% -%% http://www.apache.org/licenses/LICENSE-2.0 -%% -%% Unless required by applicable law or agreed to in writing, software -%% distributed under the License is distributed on an "AS IS" BASIS, -%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -%% See the License for the specific language governing permissions and -%% limitations under the License. - -%%%------------------------------------------------------------------- -%%% File : dialyzer_race_data_server.erl -%%% Author : Tobias Lindahl -%%% Description : -%%% -%%% Created : 18 Sep 2015 by Luca Favatella -%%%------------------------------------------------------------------- --module(dialyzer_race_data_server). - --export([new/0, - duplicate/1, - stop/1, - call/2, - cast/2]). - --include("dialyzer.hrl"). - -%%---------------------------------------------------------------------- - --record(state, {race_code = dict:new() :: dict:dict(), - public_tables = [] :: [label()], - named_tables = [] :: [string()], - beh_api_calls = [] :: [{mfa(), mfa()}]}). - -%%---------------------------------------------------------------------- - --spec new() -> pid(). - -new() -> - spawn_link(fun() -> loop(#state{}) end). - --spec duplicate(pid()) -> pid(). - -duplicate(Server) -> - call(dup, Server). - --spec stop(pid()) -> ok. - -stop(Server) -> - cast(stop, Server). - --spec call(atom(), pid()) -> term(). - -call(Query, Server) -> - Ref = make_ref(), - Server ! {call, self(), Ref, Query}, - receive - {Ref, Reply} -> Reply - end. - --spec cast(atom() | {atom(), term()}, pid()) -> ok. - -cast(Message, Server) -> - Server ! {cast, Message}, - ok. - -%%---------------------------------------------------------------------- - -loop(State) -> - receive - {call, From, Ref, Query} -> - Reply = handle_call(Query, State), - From ! {Ref, Reply}, - loop(State); - {cast, stop} -> - ok; - {cast, Message} -> - NewState = handle_cast(Message, State), - loop(NewState) - end. - -handle_cast(race_code_new, State) -> - State#state{race_code = dict:new()}; -handle_cast({Tag, Data}, State) -> - case Tag of - renew_race_info -> renew_race_info_handler(Data, State); - renew_race_code -> renew_race_code_handler(Data, State); - renew_race_public_tables -> renew_race_public_tables_handler(Data, State); - put_race_code -> State#state{race_code = Data}; - put_public_tables -> State#state{public_tables = Data}; - put_named_tables -> State#state{named_tables = Data}; - put_behaviour_api_calls -> State#state{beh_api_calls = Data} - end. - -handle_call(Query, - #state{race_code = RaceCode, - public_tables = PublicTables, - named_tables = NamedTables, - beh_api_calls = BehApiCalls} - = State) -> - case Query of - dup -> spawn_link(fun() -> loop(State) end); - get_race_code -> RaceCode; - get_public_tables -> PublicTables; - get_named_tables -> NamedTables; - get_behaviour_api_calls -> BehApiCalls - end. - -%%---------------------------------------------------------------------- - -renew_race_info_handler({RaceCode, PublicTables, NamedTables}, - #state{} = State) -> - State#state{race_code = RaceCode, - public_tables = PublicTables, - named_tables = NamedTables}. - -renew_race_code_handler({Fun, FunArgs, Code}, - #state{race_code = RaceCode} = State) -> - State#state{race_code = dict:store(Fun, [FunArgs, Code], RaceCode)}. - -renew_race_public_tables_handler(VarLabel, - #state{public_tables = PT} = State) -> - State#state{public_tables = ordsets:add_element(VarLabel, PT)}. diff --git a/lib/dialyzer/src/dialyzer_races.erl b/lib/dialyzer/src/dialyzer_races.erl deleted file mode 100644 index adefc16f9905..000000000000 --- a/lib/dialyzer/src/dialyzer_races.erl +++ /dev/null @@ -1,2483 +0,0 @@ -%% -*- erlang-indent-level: 2 -*- -%% -%% Licensed under the Apache License, Version 2.0 (the "License"); -%% you may not use this file except in compliance with the License. -%% You may obtain a copy of the License at -%% -%% http://www.apache.org/licenses/LICENSE-2.0 -%% -%% Unless required by applicable law or agreed to in writing, software -%% distributed under the License is distributed on an "AS IS" BASIS, -%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -%% See the License for the specific language governing permissions and -%% limitations under the License. - -%%%---------------------------------------------------------------------- -%%% File : dialyzer_races.erl -%%% Author : Maria Christakis -%%% Description : Utility functions for race condition detection -%%% -%%% Created : 21 Nov 2008 by Maria Christakis -%%%---------------------------------------------------------------------- --module(dialyzer_races). - -%% Race Analysis - --export([store_race_call/5, race/1, get_race_warnings/2, format_args/4]). - -%% Record Interfaces - --export([beg_clause_new/3, cleanup/1, end_case_new/1, end_clause_new/3, - get_curr_fun/1, get_curr_fun_args/1, get_new_table/1, - get_race_analysis/1, get_race_list/1, get_race_list_size/1, - get_race_list_and_size/1, - let_tag_new/2, new/0, put_curr_fun/3, put_fun_args/2, - put_race_analysis/2, put_race_list/3]). - --export_type([races/0, core_vars/0]). - --include("dialyzer.hrl"). - -%%% =========================================================================== -%%% -%%% Definitions -%%% -%%% =========================================================================== - --define(local, 5). --define(no_arg, no_arg). --define(no_label, no_label). --define(bypassed, bypassed). - --define(WARN_WHEREIS_REGISTER, warn_whereis_register). --define(WARN_WHEREIS_UNREGISTER, warn_whereis_unregister). --define(WARN_ETS_LOOKUP_INSERT, warn_ets_lookup_insert). --define(WARN_MNESIA_DIRTY_READ_WRITE, warn_mnesia_dirty_read_write). --define(WARN_NO_WARN, warn_no_warn). - -%%% =========================================================================== -%%% -%%% Local Types -%%% -%%% =========================================================================== - --type label_type() :: label() | [label()] | {label()} | ?no_label. --type args() :: [label_type() | [string()]]. --type core_vars() :: cerl:cerl() | ?no_arg | ?bypassed. --type var_to_map1() :: core_vars() | [cerl:cerl()]. --type var_to_map2() :: cerl:cerl() | [cerl:cerl()] | ?bypassed. --type core_args() :: [core_vars()] | 'empty'. --type op() :: 'bind' | 'unbind'. - --type dep_calls() :: 'whereis' | 'ets_lookup' | 'mnesia_dirty_read'. --type warn_calls() :: 'register' | 'unregister' | 'ets_insert' - | 'mnesia_dirty_write'. --type call() :: 'whereis' | 'register' | 'unregister' | 'ets_new' - | 'ets_lookup' | 'ets_insert' | 'mnesia_dirty_read1' - | 'mnesia_dirty_read2' | 'mnesia_dirty_write1' - | 'mnesia_dirty_write2' | 'function_call'. --type race_tag() :: 'whereis_register' | 'whereis_unregister' - | 'ets_lookup_insert' | 'mnesia_dirty_read_write'. - -%% The following type is similar to the raw_warning() type but has a -%% tag which is local to this module and is not propagated to outside --type dial_race_warning() :: {race_warn_tag(), warning_info(), {atom(), [term()]}}. --type race_warn_tag() :: ?WARN_WHEREIS_REGISTER | ?WARN_WHEREIS_UNREGISTER - | ?WARN_ETS_LOOKUP_INSERT | ?WARN_MNESIA_DIRTY_READ_WRITE. - --record(beg_clause, {arg :: var_to_map1() | 'undefined', - pats :: var_to_map1() | 'undefined', - guard :: cerl:cerl() | 'undefined'}). --record(end_clause, {arg :: var_to_map1() | 'undefined', - pats :: var_to_map1() | 'undefined', - guard :: cerl:cerl() | 'undefined'}). --record(end_case, {clauses :: [#end_clause{}]}). --record(curr_fun, {status :: 'in' | 'out' | 'undefined', - mfa :: dialyzer_callgraph:mfa_or_funlbl() - | 'undefined', - label :: label() | 'undefined', - def_vars :: [core_vars()] | 'undefined', - arg_types :: [erl_types:erl_type()] | 'undefined', - call_vars :: [core_vars()] | 'undefined', - var_map :: dict:dict() | 'undefined'}). --record(dep_call, {call_name :: dep_calls(), - args :: args() | 'undefined', - arg_types :: [erl_types:erl_type()], - vars :: [core_vars()], - state :: dialyzer_dataflow:state(), - file_loc :: file_location(), - var_map :: dict:dict() | 'undefined'}). --record(fun_call, {caller :: dialyzer_callgraph:mfa_or_funlbl(), - callee :: dialyzer_callgraph:mfa_or_funlbl(), - arg_types :: [erl_types:erl_type()], - vars :: [core_vars()]}). --record(let_tag, {var :: var_to_map1(), - arg :: var_to_map1()}). --record(warn_call, {call_name :: warn_calls(), - args :: args(), - var_map :: dict:dict() | 'undefined'}). - --type case_tags() :: 'beg_case' | #beg_clause{} | #end_clause{} | #end_case{}. --type code() :: [#dep_call{} | #fun_call{} | #warn_call{} | - #curr_fun{} | #let_tag{} | case_tags() | race_tag()]. - --type table_var() :: label() | ?no_label. --type table() :: {'named', table_var(), [string()]} | 'other' | 'no_t'. - --record(race_fun, {mfa :: mfa(), - args :: args(), - arg_types :: [erl_types:erl_type()], - vars :: [core_vars()], - file_loc :: file_location(), - index :: non_neg_integer(), - fun_mfa :: dialyzer_callgraph:mfa_or_funlbl(), - fun_label :: label()}). - --record(races, {curr_fun :: dialyzer_callgraph:mfa_or_funlbl() - | 'undefined', - curr_fun_label :: label() | 'undefined', - curr_fun_args = 'empty' :: core_args(), - new_table = 'no_t' :: table(), - race_list = [] :: code(), - race_list_size = 0 :: non_neg_integer(), - race_tags = [] :: [#race_fun{}], - %% true for fun types and warning mode - race_analysis = false :: boolean(), - race_warnings = [] :: [dial_race_warning()]}). - -%%% =========================================================================== -%%% -%%% Exported Types -%%% -%%% =========================================================================== - --opaque races() :: #races{}. - -%%% =========================================================================== -%%% -%%% Race Analysis -%%% -%%% =========================================================================== - --spec store_race_call(dialyzer_callgraph:mfa_or_funlbl(), - [erl_types:erl_type()], [core_vars()], - file_location(), dialyzer_dataflow:state()) -> - dialyzer_dataflow:state(). - -store_race_call(Fun, ArgTypes, Args, FileLocation, State) -> - Races = dialyzer_dataflow:state__get_races(State), - CurrFun = Races#races.curr_fun, - CurrFunLabel = Races#races.curr_fun_label, - RaceTags = Races#races.race_tags, - CleanState = dialyzer_dataflow:state__records_only(State), - {NewRaceList, NewRaceListSize, NewRaceTags, NewTable} = - case CurrFun of - {_Module, module_info, A} when A =:= 0 orelse A =:= 1 -> - {[], 0, RaceTags, no_t}; - _Thing -> - RaceList = Races#races.race_list, - RaceListSize = Races#races.race_list_size, - case Fun of - {erlang, get_module_info, A} when A =:= 1 orelse A =:= 2 -> - {[], 0, RaceTags, no_t}; - {erlang, register, 2} -> - VarArgs = format_args(Args, ArgTypes, CleanState, register), - RaceFun = #race_fun{mfa = Fun, args = VarArgs, - arg_types = ArgTypes, vars = Args, - file_loc = FileLocation, index = RaceListSize, - fun_mfa = CurrFun, fun_label = CurrFunLabel}, - {[#warn_call{call_name = register, args = VarArgs}| - RaceList], RaceListSize + 1, [RaceFun|RaceTags], no_t}; - {erlang, unregister, 1} -> - VarArgs = format_args(Args, ArgTypes, CleanState, unregister), - RaceFun = #race_fun{mfa = Fun, args = VarArgs, - arg_types = ArgTypes, vars = Args, - file_loc = FileLocation, index = RaceListSize, - fun_mfa = CurrFun, fun_label = CurrFunLabel}, - {[#warn_call{call_name = unregister, args = VarArgs}| - RaceList], RaceListSize + 1, [RaceFun|RaceTags], no_t}; - {erlang, whereis, 1} -> - VarArgs = format_args(Args, ArgTypes, CleanState, whereis), - {[#dep_call{call_name = whereis, args = VarArgs, - arg_types = ArgTypes, vars = Args, - state = CleanState, file_loc = FileLocation}| - RaceList], RaceListSize + 1, RaceTags, no_t}; - {ets, insert, 2} -> - VarArgs = format_args(Args, ArgTypes, CleanState, ets_insert), - RaceFun = #race_fun{mfa = Fun, args = VarArgs, - arg_types = ArgTypes, vars = Args, - file_loc = FileLocation, index = RaceListSize, - fun_mfa = CurrFun, fun_label = CurrFunLabel}, - {[#warn_call{call_name = ets_insert, args = VarArgs}| - RaceList], RaceListSize + 1, [RaceFun|RaceTags], no_t}; - {ets, lookup, 2} -> - VarArgs = format_args(Args, ArgTypes, CleanState, ets_lookup), - {[#dep_call{call_name = ets_lookup, args = VarArgs, - arg_types = ArgTypes, vars = Args, - state = CleanState, file_loc = FileLocation}| - RaceList], RaceListSize + 1, RaceTags, no_t}; - {ets, new, 2} -> - VarArgs = format_args(Args, ArgTypes, CleanState, ets_new), - [VarArgs1, VarArgs2, _, Options] = VarArgs, - NewTable1 = - case lists:member("'public'", Options) of - true -> - case lists:member("'named_table'", Options) of - true -> - {named, VarArgs1, VarArgs2}; - false -> other - end; - false -> no_t - end, - {RaceList, RaceListSize, RaceTags, NewTable1}; - {mnesia, dirty_read, A} when A =:= 1 orelse A =:= 2 -> - VarArgs = - case A of - 1 -> - format_args(Args, ArgTypes, CleanState, mnesia_dirty_read1); - 2 -> - format_args(Args, ArgTypes, CleanState, mnesia_dirty_read2) - end, - {[#dep_call{call_name = mnesia_dirty_read, args = VarArgs, - arg_types = ArgTypes, vars = Args, - state = CleanState, file_loc = FileLocation}|RaceList], - RaceListSize + 1, RaceTags, no_t}; - {mnesia, dirty_write, A} when A =:= 1 orelse A =:= 2 -> - VarArgs = - case A of - 1 -> - format_args(Args, ArgTypes, CleanState, mnesia_dirty_write1); - 2 -> - format_args(Args, ArgTypes, CleanState, mnesia_dirty_write2) - end, - RaceFun = #race_fun{mfa = Fun, args = VarArgs, - arg_types = ArgTypes, vars = Args, - file_loc = FileLocation, index = RaceListSize, - fun_mfa = CurrFun, fun_label = CurrFunLabel}, - {[#warn_call{call_name = mnesia_dirty_write, - args = VarArgs}|RaceList], - RaceListSize + 1, [RaceFun|RaceTags], no_t}; - Int when is_integer(Int) -> - {[#fun_call{caller = CurrFun, callee = Int, arg_types = ArgTypes, - vars = Args}|RaceList], - RaceListSize + 1, RaceTags, no_t}; - _Other -> - Callgraph = dialyzer_dataflow:state__get_callgraph(State), - case digraph:vertex(dialyzer_callgraph:get_digraph(Callgraph), - Fun) of - {Fun, confirmed} -> - {[#fun_call{caller = CurrFun, callee = Fun, - arg_types = ArgTypes, vars = Args}|RaceList], - RaceListSize + 1, RaceTags, no_t}; - false -> - {RaceList, RaceListSize, RaceTags, no_t} - end - end - end, - state__renew_info(NewRaceList, NewRaceListSize, NewRaceTags, NewTable, State). - --spec race(dialyzer_dataflow:state()) -> dialyzer_dataflow:state(). - -race(State) -> - Races = dialyzer_dataflow:state__get_races(State), - RaceTags = Races#races.race_tags, - RetState = - case RaceTags of - [] -> State; - [#race_fun{mfa = Fun, - args = VarArgs, arg_types = ArgTypes, - vars = Args, file_loc = FileLocation, - index = Index, fun_mfa = CurrFun, - fun_label = CurrFunLabel}|T] -> - Callgraph = dialyzer_dataflow:state__get_callgraph(State), - {ok, [_Args, Code]} = - dict:find(CurrFun, dialyzer_callgraph:get_race_code(Callgraph)), - RaceList = lists:reverse(Code), - RaceWarnTag = - case Fun of - {erlang, register, 2} -> ?WARN_WHEREIS_REGISTER; - {erlang, unregister, 1} -> ?WARN_WHEREIS_UNREGISTER; - {ets, insert, 2} -> ?WARN_ETS_LOOKUP_INSERT; - {mnesia, dirty_write, _A} -> ?WARN_MNESIA_DIRTY_READ_WRITE - end, - State1 = - state__renew_curr_fun(CurrFun, - state__renew_curr_fun_label(CurrFunLabel, - state__renew_race_list(lists:nthtail(length(RaceList) - Index, - RaceList), State))), - DepList = fixup_race_list(RaceWarnTag, VarArgs, State1), - {State2, RaceWarn} = - get_race_warn(Fun, Args, ArgTypes, DepList, State), - {File, Location} = FileLocation, - CurrMFA = dialyzer_dataflow:state__find_function(CurrFun, State), - WarningInfo = {File, Location, CurrMFA}, - race( - state__add_race_warning( - state__renew_race_tags(T, State2), RaceWarn, RaceWarnTag, - WarningInfo)) - end, - state__renew_race_tags([], RetState). - -fixup_race_list(RaceWarnTag, WarnVarArgs, State) -> - Races = dialyzer_dataflow:state__get_races(State), - CurrFun = Races#races.curr_fun, - CurrFunLabel = Races#races.curr_fun_label, - RaceList = Races#races.race_list, - Callgraph = dialyzer_dataflow:state__get_callgraph(State), - Digraph = dialyzer_callgraph:get_digraph(Callgraph), - Calls = digraph:edges(Digraph), - RaceTag = - case RaceWarnTag of - ?WARN_WHEREIS_REGISTER -> whereis_register; - ?WARN_WHEREIS_UNREGISTER -> whereis_unregister; - ?WARN_ETS_LOOKUP_INSERT -> ets_lookup_insert; - ?WARN_MNESIA_DIRTY_READ_WRITE -> mnesia_dirty_read_write - end, - NewRaceList = [RaceTag|RaceList], - CleanState = dialyzer_dataflow:state__cleanup(State), - NewState = state__renew_race_list(NewRaceList, CleanState), - DepList1 = - fixup_race_forward_pullout(CurrFun, CurrFunLabel, Calls, - lists:reverse(NewRaceList), [], CurrFun, - WarnVarArgs, RaceWarnTag, dict:new(), - [], [], [], 2 * ?local, NewState), - Parents = fixup_race_backward(CurrFun, Calls, Calls, [], ?local), - UParents = lists:usort(Parents), - Filtered = filter_parents(UParents, UParents, Digraph), - NewParents = - case lists:member(CurrFun, Filtered) of - true -> Filtered; - false -> [CurrFun|Filtered] - end, - DepList2 = - fixup_race_list_helper(NewParents, Calls, CurrFun, WarnVarArgs, - RaceWarnTag, NewState), - dialyzer_dataflow:dispose_state(CleanState), - lists:usort(cleanup_dep_calls(DepList1 ++ DepList2)). - -fixup_race_list_helper(Parents, Calls, CurrFun, WarnVarArgs, RaceWarnTag, - State) -> - case Parents of - [] -> []; - [Head|Tail] -> - Callgraph = dialyzer_dataflow:state__get_callgraph(State), - Code = - case dict:find(Head, dialyzer_callgraph:get_race_code(Callgraph)) of - error -> []; - {ok, [_A, C]} -> C - end, - {ok, FunLabel} = dialyzer_callgraph:lookup_label(Head, Callgraph), - DepList1 = - fixup_race_forward_pullout(Head, FunLabel, Calls, Code, [], CurrFun, - WarnVarArgs, RaceWarnTag, dict:new(), - [], [], [], 2 * ?local, State), - DepList2 = - fixup_race_list_helper(Tail, Calls, CurrFun, WarnVarArgs, - RaceWarnTag, State), - DepList1 ++ DepList2 - end. - -%%% =========================================================================== -%%% -%%% Forward Analysis -%%% -%%% =========================================================================== - -fixup_race_forward_pullout(CurrFun, CurrFunLabel, Calls, Code, RaceList, - InitFun, WarnVarArgs, RaceWarnTag, RaceVarMap, - FunDefVars, FunCallVars, FunArgTypes, NestingLevel, - State) -> - TState = dialyzer_dataflow:state__duplicate(State), - {DepList, NewCurrFun, NewCurrFunLabel, NewCalls, - NewCode, NewRaceList, NewRaceVarMap, NewFunDefVars, - NewFunCallVars, NewFunArgTypes, NewNestingLevel} = - fixup_race_forward(CurrFun, CurrFunLabel, Calls, Code, RaceList, - InitFun, WarnVarArgs, RaceWarnTag, RaceVarMap, - FunDefVars, FunCallVars, FunArgTypes, NestingLevel, - cleanup_race_code(TState)), - dialyzer_dataflow:dispose_state(TState), - case NewCode of - [] -> DepList; - [#fun_call{caller = NewCurrFun, callee = Call, arg_types = FunTypes, - vars = FunArgs}|Tail] -> - Callgraph = dialyzer_dataflow:state__get_callgraph(State), - OkCall = {ok, Call}, - {Name, Label} = - case is_integer(Call) of - true -> - case dialyzer_callgraph:lookup_name(Call, Callgraph) of - error -> {OkCall, OkCall}; - N -> {N, OkCall} - end; - false -> - {OkCall, dialyzer_callgraph:lookup_label(Call, Callgraph)} - end, - {NewCurrFun1, NewCurrFunLabel1, NewCalls1, NewCode1, NewRaceList1, - NewRaceVarMap1, NewFunDefVars1, NewFunCallVars1, NewFunArgTypes1, - NewNestingLevel1} = - case Label =:= error of - true -> - {NewCurrFun, NewCurrFunLabel, NewCalls, Tail, NewRaceList, - NewRaceVarMap, NewFunDefVars, NewFunCallVars, NewFunArgTypes, - NewNestingLevel}; - false -> - {ok, Fun} = Name, - {ok, Int} = Label, - case dict:find(Fun, dialyzer_callgraph:get_race_code(Callgraph)) of - error -> - {NewCurrFun, NewCurrFunLabel, NewCalls, Tail, NewRaceList, - NewRaceVarMap, NewFunDefVars, NewFunCallVars, NewFunArgTypes, - NewNestingLevel}; - {ok, [Args, CodeB]} -> - Races = dialyzer_dataflow:state__get_races(State), - {RetCurrFun, RetCurrFunLabel, RetCalls, RetCode, - RetRaceList, RetRaceVarMap, RetFunDefVars, RetFunCallVars, - RetFunArgTypes, RetNestingLevel} = - fixup_race_forward_helper(NewCurrFun, - NewCurrFunLabel, Fun, Int, NewCalls, NewCalls, - [#curr_fun{status = out, mfa = NewCurrFun, - label = NewCurrFunLabel, - var_map = NewRaceVarMap, - def_vars = NewFunDefVars, - call_vars = NewFunCallVars, - arg_types = NewFunArgTypes}| - Tail], - NewRaceList, InitFun, FunArgs, FunTypes, RaceWarnTag, - NewRaceVarMap, NewFunDefVars, NewFunCallVars, - NewFunArgTypes, NewNestingLevel, Args, CodeB, - Races#races.race_list), - case RetCode of - [#curr_fun{}|_CodeTail] -> - {NewCurrFun, NewCurrFunLabel, RetCalls, RetCode, - RetRaceList, NewRaceVarMap, NewFunDefVars, - NewFunCallVars, NewFunArgTypes, RetNestingLevel}; - _Else -> - {RetCurrFun, RetCurrFunLabel, RetCalls, RetCode, - RetRaceList, RetRaceVarMap, RetFunDefVars, - RetFunCallVars, RetFunArgTypes, RetNestingLevel} - end - end - end, - DepList ++ - fixup_race_forward_pullout(NewCurrFun1, NewCurrFunLabel1, NewCalls1, - NewCode1, NewRaceList1, InitFun, WarnVarArgs, - RaceWarnTag, NewRaceVarMap1, NewFunDefVars1, - NewFunCallVars1, NewFunArgTypes1, - NewNestingLevel1, State) - end. - -fixup_race_forward(CurrFun, CurrFunLabel, Calls, Code, RaceList, - InitFun, WarnVarArgs, RaceWarnTag, RaceVarMap, - FunDefVars, FunCallVars, FunArgTypes, NestingLevel, - State) -> - case Code of - [] -> - {[], CurrFun, CurrFunLabel, Calls, Code, RaceList, RaceVarMap, - FunDefVars, FunCallVars, FunArgTypes, NestingLevel}; - [Head|Tail] -> - Callgraph = dialyzer_dataflow:state__get_callgraph(State), - {NewRL, DepList, NewNL, Return} = - case Head of - #dep_call{call_name = whereis} -> - case RaceWarnTag of - WarnWhereis when WarnWhereis =:= ?WARN_WHEREIS_REGISTER orelse - WarnWhereis =:= ?WARN_WHEREIS_UNREGISTER -> - {[Head#dep_call{var_map = RaceVarMap}|RaceList], - [], NestingLevel, false}; - _Other -> - {RaceList, [], NestingLevel, false} - end; - #dep_call{call_name = ets_lookup} -> - case RaceWarnTag of - ?WARN_ETS_LOOKUP_INSERT -> - {[Head#dep_call{var_map = RaceVarMap}|RaceList], - [], NestingLevel, false}; - _Other -> - {RaceList, [], NestingLevel, false} - end; - #dep_call{call_name = mnesia_dirty_read} -> - case RaceWarnTag of - ?WARN_MNESIA_DIRTY_READ_WRITE -> - {[Head#dep_call{var_map = RaceVarMap}|RaceList], - [], NestingLevel, false}; - _Other -> - {RaceList, [], NestingLevel, false} - end; - #warn_call{call_name = RegCall} when RegCall =:= register orelse - RegCall =:= unregister -> - case RaceWarnTag of - WarnWhereis when WarnWhereis =:= ?WARN_WHEREIS_REGISTER orelse - WarnWhereis =:= ?WARN_WHEREIS_UNREGISTER -> - {[Head#warn_call{var_map = RaceVarMap}|RaceList], - [], NestingLevel, false}; - _Other -> - {RaceList, [], NestingLevel, false} - end; - #warn_call{call_name = ets_insert} -> - case RaceWarnTag of - ?WARN_ETS_LOOKUP_INSERT -> - {[Head#warn_call{var_map = RaceVarMap}|RaceList], - [], NestingLevel, false}; - _Other -> - {RaceList, [], NestingLevel, false} - end; - #warn_call{call_name = mnesia_dirty_write} -> - case RaceWarnTag of - ?WARN_MNESIA_DIRTY_READ_WRITE -> - {[Head#warn_call{var_map = RaceVarMap}|RaceList], - [], NestingLevel, false}; - _Other -> - {RaceList, [], NestingLevel, false} - end; - #fun_call{caller = CurrFun, callee = InitFun} -> - {RaceList, [], NestingLevel, false}; - #fun_call{caller = CurrFun} -> - {RaceList, [], NestingLevel - 1, false}; - beg_case -> - {[Head|RaceList], [], NestingLevel, false}; - #beg_clause{} -> - {[#beg_clause{}|RaceList], [], NestingLevel, false}; - #end_clause{} -> - {[#end_clause{}|RaceList], [], NestingLevel, false}; - #end_case{} -> - {[Head|RaceList], [], NestingLevel, false}; - #let_tag{} -> - {RaceList, [], NestingLevel, false}; - #curr_fun{status = in, mfa = InitFun, - label = _InitFunLabel, var_map = _NewRVM, - def_vars = NewFDV, call_vars = NewFCV, - arg_types = _NewFAT} -> - {[#curr_fun{status = out, var_map = RaceVarMap, - def_vars = NewFDV, call_vars = NewFCV}| - RaceList], [], NestingLevel - 1, false}; - #curr_fun{status = in, def_vars = NewFDV, - call_vars = NewFCV} -> - {[#curr_fun{status = out, var_map = RaceVarMap, - def_vars = NewFDV, call_vars = NewFCV}| - RaceList], - [], NestingLevel - 1, false}; - #curr_fun{status = out} -> - {[#curr_fun{status = in, var_map = RaceVarMap}|RaceList], [], - NestingLevel + 1, false}; - RaceTag -> - PublicTables = dialyzer_callgraph:get_public_tables(Callgraph), - NamedTables = dialyzer_callgraph:get_named_tables(Callgraph), - WarnVarArgs1 = - var_type_analysis(FunDefVars, FunArgTypes, WarnVarArgs, - RaceWarnTag, RaceVarMap, - dialyzer_dataflow:state__records_only(State)), - {NewDepList, IsPublic, _Return} = - get_deplist_paths(RaceList, WarnVarArgs1, RaceWarnTag, - RaceVarMap, 0, PublicTables, NamedTables), - {NewHead, NewDepList1} = - case RaceTag of - whereis_register -> - {[#warn_call{call_name = register, args = WarnVarArgs, - var_map = RaceVarMap}], - NewDepList}; - whereis_unregister -> - {[#warn_call{call_name = unregister, args = WarnVarArgs, - var_map = RaceVarMap}], - NewDepList}; - ets_lookup_insert -> - NewWarnCall = - [#warn_call{call_name = ets_insert, args = WarnVarArgs, - var_map = RaceVarMap}], - [Tab, Names, _, _] = WarnVarArgs, - case IsPublic orelse - compare_var_list(Tab, PublicTables, RaceVarMap) - orelse - length(Names -- NamedTables) < length(Names) of - true -> - {NewWarnCall, NewDepList}; - false -> {NewWarnCall, []} - end; - mnesia_dirty_read_write -> - {[#warn_call{call_name = mnesia_dirty_write, - args = WarnVarArgs, var_map = RaceVarMap}], - NewDepList} - end, - {NewHead ++ RaceList, NewDepList1, NestingLevel, - is_last_race(RaceTag, InitFun, Tail, Callgraph)} - end, - {NewCurrFun, NewCurrFunLabel, NewCode, NewRaceList, NewRaceVarMap, - NewFunDefVars, NewFunCallVars, NewFunArgTypes, NewNestingLevel, - PullOut} = - case Head of - #fun_call{caller = CurrFun} -> - case NewNL =:= 0 of - true -> - {CurrFun, CurrFunLabel, Tail, NewRL, RaceVarMap, - FunDefVars, FunCallVars, FunArgTypes, NewNL, false}; - false -> - {CurrFun, CurrFunLabel, Code, NewRL, RaceVarMap, - FunDefVars, FunCallVars, FunArgTypes, NewNL, true} - end; - #beg_clause{arg = Arg, pats = Pats, guard = Guard} -> - {RaceVarMap1, RemoveClause} = - race_var_map_guard(Arg, Pats, Guard, RaceVarMap, bind), - case RemoveClause of - true -> - {RaceList2, - #curr_fun{mfa = CurrFun2, label = CurrFunLabel2, - var_map = RaceVarMap2, def_vars = FunDefVars2, - call_vars = FunCallVars2, arg_types = FunArgTypes2}, - Code2, NestingLevel2} = - remove_clause(NewRL, - #curr_fun{mfa = CurrFun, label = CurrFunLabel, - var_map = RaceVarMap1, - def_vars = FunDefVars, - call_vars = FunCallVars, - arg_types = FunArgTypes}, - Tail, NewNL), - {CurrFun2, CurrFunLabel2, Code2, RaceList2, - RaceVarMap2, FunDefVars2, FunCallVars2, FunArgTypes2, - NestingLevel2, false}; - false -> - {CurrFun, CurrFunLabel, Tail, NewRL, RaceVarMap1, - FunDefVars, FunCallVars, FunArgTypes, NewNL, false} - end; - #end_clause{arg = Arg, pats = Pats, guard = Guard} -> - {RaceVarMap1, _RemoveClause} = - race_var_map_guard(Arg, Pats, Guard, RaceVarMap, unbind), - {CurrFun, CurrFunLabel, Tail, NewRL, RaceVarMap1, - FunDefVars, FunCallVars, FunArgTypes, NewNL, - false}; - #end_case{clauses = Clauses} -> - RaceVarMap1 = - race_var_map_clauses(Clauses, RaceVarMap), - {CurrFun, CurrFunLabel, Tail, NewRL, RaceVarMap1, - FunDefVars, FunCallVars, FunArgTypes, NewNL, - false}; - #let_tag{var = Var, arg = Arg} -> - {CurrFun, CurrFunLabel, Tail, NewRL, - race_var_map(Var, Arg, RaceVarMap, bind), FunDefVars, - FunCallVars, FunArgTypes, NewNL, false}; - #curr_fun{mfa = CurrFun1, label = CurrFunLabel1, - var_map = RaceVarMap1, def_vars = FunDefVars1, - call_vars = FunCallVars1, arg_types = FunArgTypes1} -> - case NewNL =:= 0 of - true -> - {CurrFun, CurrFunLabel, - remove_nonlocal_functions(Tail, 1), NewRL, RaceVarMap, - FunDefVars, FunCallVars, FunArgTypes, NewNL, false}; - false -> - {CurrFun1, CurrFunLabel1, Tail, NewRL, RaceVarMap1, - FunDefVars1, FunCallVars1, FunArgTypes1, NewNL, false} - end; - _Thing -> - {CurrFun, CurrFunLabel, Tail, NewRL, RaceVarMap, - FunDefVars, FunCallVars, FunArgTypes, NewNL, false} - end, - case Return of - true -> - {DepList, NewCurrFun, NewCurrFunLabel, Calls, - [], NewRaceList, NewRaceVarMap, NewFunDefVars, - NewFunCallVars, NewFunArgTypes, NewNestingLevel}; - false -> - NewNestingLevel1 = - case NewNestingLevel =:= 0 of - true -> NewNestingLevel + 1; - false -> NewNestingLevel - end, - case PullOut of - true -> - {DepList, NewCurrFun, NewCurrFunLabel, Calls, - NewCode, NewRaceList, NewRaceVarMap, NewFunDefVars, - NewFunCallVars, NewFunArgTypes, NewNestingLevel1}; - false -> - {RetDepList, NewCurrFun1, NewCurrFunLabel1, NewCalls1, - NewCode1, NewRaceList1, NewRaceVarMap1, NewFunDefVars1, - NewFunCallVars1, NewFunArgTypes1, NewNestingLevel2} = - fixup_race_forward(NewCurrFun, NewCurrFunLabel, Calls, - NewCode, NewRaceList, InitFun, WarnVarArgs, - RaceWarnTag, NewRaceVarMap, NewFunDefVars, - NewFunCallVars, NewFunArgTypes, - NewNestingLevel1, State), - {DepList ++ RetDepList, NewCurrFun1, NewCurrFunLabel1, - NewCalls1, NewCode1, NewRaceList1, NewRaceVarMap1, - NewFunDefVars1, NewFunCallVars1, NewFunArgTypes1, - NewNestingLevel2} - end - end - end. - -get_deplist_paths(RaceList, WarnVarArgs, RaceWarnTag, RaceVarMap, CurrLevel, - PublicTables, NamedTables) -> - case RaceList of - [] -> {[], false, true}; - [Head|Tail] -> - case Head of - #end_case{} -> - {RaceList1, DepList1, IsPublic1, Continue1} = - handle_case(Tail, WarnVarArgs, RaceWarnTag, RaceVarMap, CurrLevel, - PublicTables, NamedTables), - case Continue1 of - true -> - {DepList2, IsPublic2, Continue2} = - get_deplist_paths(RaceList1, WarnVarArgs, RaceWarnTag, - RaceVarMap, CurrLevel, PublicTables, - NamedTables), - {DepList1 ++ DepList2, IsPublic1 orelse IsPublic2, Continue2}; - false -> {DepList1, IsPublic1, false} - end; - #beg_clause{} -> - get_deplist_paths(fixup_before_case_path(Tail), WarnVarArgs, - RaceWarnTag, RaceVarMap, CurrLevel, PublicTables, - NamedTables); - #curr_fun{status = in, var_map = RaceVarMap1} -> - {DepList, IsPublic, Continue} = - get_deplist_paths(Tail, WarnVarArgs, RaceWarnTag, RaceVarMap, - CurrLevel + 1, PublicTables, NamedTables), - IsPublic1 = - case RaceWarnTag of - ?WARN_ETS_LOOKUP_INSERT -> - [Tabs, Names, _, _] = WarnVarArgs, - IsPublic orelse - lists:any( - fun (T) -> - compare_var_list(T, PublicTables, RaceVarMap1) - end, Tabs) - orelse - length(Names -- NamedTables) < length(Names); - _ -> true - end, - {DepList, IsPublic1, Continue}; - #curr_fun{status = out, var_map = RaceVarMap1, def_vars = FunDefVars, - call_vars = FunCallVars} -> - WarnVarArgs1 = - var_analysis([format_arg(DefVar) || DefVar <- FunDefVars], - [format_arg(CallVar) || CallVar <- FunCallVars], - WarnVarArgs, RaceWarnTag), - {WarnVarArgs2, Stop} = - case RaceWarnTag of - ?WARN_WHEREIS_REGISTER -> - [WVA1, WVA2, WVA3, WVA4] = WarnVarArgs1, - Vars = - lists:flatten( - [find_all_bound_vars(V, RaceVarMap1) || V <- WVA1]), - case {Vars, CurrLevel} of - {[], 0} -> - {WarnVarArgs, true}; - {[], _} -> - {WarnVarArgs, false}; - _ -> - {[Vars, WVA2, WVA3, WVA4], false} - end; - ?WARN_WHEREIS_UNREGISTER -> - [WVA1, WVA2] = WarnVarArgs1, - Vars = - lists:flatten( - [find_all_bound_vars(V, RaceVarMap1) || V <- WVA1]), - case {Vars, CurrLevel} of - {[], 0} -> - {WarnVarArgs, true}; - {[], _} -> - {WarnVarArgs, false}; - _ -> - {[Vars, WVA2], false} - end; - ?WARN_ETS_LOOKUP_INSERT -> - [WVA1, WVA2, WVA3, WVA4] = WarnVarArgs1, - Vars1 = - lists:flatten( - [find_all_bound_vars(V1, RaceVarMap1) || V1 <- WVA1]), - Vars2 = - lists:flatten( - [find_all_bound_vars(V2, RaceVarMap1) || V2 <- WVA3]), - case {Vars1, Vars2, CurrLevel} of - {[], _, 0} -> - {WarnVarArgs, true}; - {[], _, _} -> - {WarnVarArgs, false}; - {_, [], 0} -> - {WarnVarArgs, true}; - {_, [], _} -> - {WarnVarArgs, false}; - _ -> - {[Vars1, WVA2, Vars2, WVA4], false} - end; - ?WARN_MNESIA_DIRTY_READ_WRITE -> - [WVA1, WVA2|T] = WarnVarArgs1, - Vars = - lists:flatten( - [find_all_bound_vars(V, RaceVarMap1) || V <- WVA1]), - case {Vars, CurrLevel} of - {[], 0} -> - {WarnVarArgs, true}; - {[], _} -> - {WarnVarArgs, false}; - _ -> - {[Vars, WVA2|T], false} - end - end, - case Stop of - true -> {[], false, false}; - false -> - CurrLevel1 = - case CurrLevel of - 0 -> CurrLevel; - _ -> CurrLevel - 1 - end, - get_deplist_paths(Tail, WarnVarArgs2, RaceWarnTag, RaceVarMap1, - CurrLevel1, PublicTables, NamedTables) - end; - #warn_call{call_name = RegCall, args = WarnVarArgs1, - var_map = RaceVarMap1} when RegCall =:= register orelse - RegCall =:= unregister -> - case compare_first_arg(WarnVarArgs, WarnVarArgs1, RaceVarMap1) of - true -> {[], false, false}; - NewWarnVarArgs -> - get_deplist_paths(Tail, NewWarnVarArgs, RaceWarnTag, RaceVarMap, - CurrLevel, PublicTables, NamedTables) - end; - #warn_call{call_name = ets_insert, args = WarnVarArgs1, - var_map = RaceVarMap1} -> - case compare_ets_insert(WarnVarArgs, WarnVarArgs1, RaceVarMap1) of - true -> {[], false, false}; - NewWarnVarArgs -> - get_deplist_paths(Tail, NewWarnVarArgs, RaceWarnTag, RaceVarMap, - CurrLevel, PublicTables, NamedTables) - end; - #warn_call{call_name = mnesia_dirty_write, args = WarnVarArgs1, - var_map = RaceVarMap1} -> - case compare_first_arg(WarnVarArgs, WarnVarArgs1, RaceVarMap1) of - true -> {[], false, false}; - NewWarnVarArgs -> - get_deplist_paths(Tail, NewWarnVarArgs, RaceWarnTag, RaceVarMap, - CurrLevel, PublicTables, NamedTables) - end; - #dep_call{var_map = RaceVarMap1} -> - {DepList, IsPublic, Continue} = - get_deplist_paths(Tail, WarnVarArgs, RaceWarnTag, RaceVarMap, - CurrLevel, PublicTables, NamedTables), - {refine_race(Head, WarnVarArgs, RaceWarnTag, DepList, RaceVarMap1), - IsPublic, Continue} - end - end. - -handle_case(RaceList, WarnVarArgs, RaceWarnTag, RaceVarMap, CurrLevel, - PublicTables, NamedTables) -> - case RaceList of - [] -> {[], [], false, true}; - [Head|Tail] -> - case Head of - #end_clause{} -> - {RestRaceList, DepList1, IsPublic1, Continue1} = - do_clause(Tail, WarnVarArgs, RaceWarnTag, RaceVarMap, CurrLevel, - PublicTables, NamedTables), - {RetRaceList, DepList2, IsPublic2, Continue2} = - handle_case(RestRaceList, WarnVarArgs, RaceWarnTag, RaceVarMap, - CurrLevel, PublicTables, NamedTables), - {RetRaceList, DepList1 ++ DepList2, IsPublic1 orelse IsPublic2, - Continue1 orelse Continue2}; - beg_case -> {Tail, [], false, false} - end - end. - -do_clause(RaceList, WarnVarArgs, RaceWarnTag, RaceVarMap, CurrLevel, - PublicTables, NamedTables) -> - {DepList, IsPublic, Continue} = - get_deplist_paths(fixup_case_path(RaceList, 0), WarnVarArgs, - RaceWarnTag, RaceVarMap, CurrLevel, - PublicTables, NamedTables), - {fixup_case_rest_paths(RaceList, 0), DepList, IsPublic, Continue}. - -fixup_case_path(RaceList, NestingLevel) -> - case RaceList of - [] -> []; - [Head|Tail] -> - {NewNestingLevel, Return} = - case Head of - beg_case -> {NestingLevel - 1, false}; - #end_case{} -> {NestingLevel + 1, false}; - #beg_clause{} -> - case NestingLevel =:= 0 of - true -> {NestingLevel, true}; - false -> {NestingLevel, false} - end; - _Other -> {NestingLevel, false} - end, - case Return of - true -> []; - false -> [Head|fixup_case_path(Tail, NewNestingLevel)] - end - end. - -%% Gets the race list before a case clause. -fixup_before_case_path(RaceList) -> - case RaceList of - [] -> []; - [Head|Tail] -> - case Head of - #end_clause{} -> - fixup_before_case_path(fixup_case_rest_paths(Tail, 0)); - beg_case -> Tail - end - end. - -fixup_case_rest_paths(RaceList, NestingLevel) -> - case RaceList of - [] -> []; - [Head|Tail] -> - {NewNestingLevel, Return} = - case Head of - beg_case -> {NestingLevel - 1, false}; - #end_case{} -> {NestingLevel + 1, false}; - #beg_clause{} -> - case NestingLevel =:= 0 of - true -> {NestingLevel, true}; - false -> {NestingLevel, false} - end; - _Other -> {NestingLevel, false} - end, - case Return of - true -> Tail; - false -> fixup_case_rest_paths(Tail, NewNestingLevel) - end - end. - -fixup_race_forward_helper(CurrFun, CurrFunLabel, Fun, FunLabel, - Calls, CallsToAnalyze, Code, RaceList, - InitFun, NewFunArgs, NewFunTypes, - RaceWarnTag, RaceVarMap, FunDefVars, - FunCallVars, FunArgTypes, NestingLevel, - Args, CodeB, StateRaceList) -> - case Calls of - [] -> - {NewRaceList, - #curr_fun{mfa = NewCurrFun, label = NewCurrFunLabel, - var_map = NewRaceVarMap, def_vars = NewFunDefVars, - call_vars = NewFunCallVars, arg_types = NewFunArgTypes}, - NewCode, NewNestingLevel} = - remove_clause(RaceList, - #curr_fun{mfa = CurrFun, label = CurrFunLabel, var_map = RaceVarMap, - def_vars = FunDefVars, call_vars = FunCallVars, - arg_types = FunArgTypes}, - Code, NestingLevel), - {NewCurrFun, NewCurrFunLabel, CallsToAnalyze, NewCode, NewRaceList, - NewRaceVarMap, NewFunDefVars, NewFunCallVars, NewFunArgTypes, - NewNestingLevel}; - [Head|Tail] -> - case Head of - {InitFun, InitFun} when CurrFun =:= InitFun, Fun =:= InitFun -> - NewCallsToAnalyze = lists:delete(Head, CallsToAnalyze), - NewRaceVarMap = - race_var_map(Args, NewFunArgs, RaceVarMap, bind), - RetC = - fixup_all_calls(InitFun, InitFun, FunLabel, Args, - CodeB ++ - [#curr_fun{status = out, mfa = InitFun, - label = CurrFunLabel, var_map = RaceVarMap, - def_vars = FunDefVars, call_vars = FunCallVars, - arg_types = FunArgTypes}], - Code, RaceVarMap), - NewCode = - fixup_all_calls(InitFun, InitFun, FunLabel, Args, - CodeB ++ - [#curr_fun{status = out, mfa = InitFun, - label = CurrFunLabel, var_map = NewRaceVarMap, - def_vars = Args, call_vars = NewFunArgs, - arg_types = NewFunTypes}], - [#curr_fun{status = in, mfa = Fun, - label = FunLabel, var_map = NewRaceVarMap, - def_vars = Args, call_vars = NewFunArgs, - arg_types = NewFunTypes}| - lists:reverse(StateRaceList)] ++ - RetC, NewRaceVarMap), - {InitFun, FunLabel, NewCallsToAnalyze, NewCode, RaceList, - NewRaceVarMap, Args, NewFunArgs, NewFunTypes, NestingLevel}; - {CurrFun, Fun} -> - NewCallsToAnalyze = lists:delete(Head, CallsToAnalyze), - NewRaceVarMap = race_var_map(Args, NewFunArgs, RaceVarMap, bind), - RetC = - case Fun of - InitFun -> - fixup_all_calls(CurrFun, Fun, FunLabel, Args, - lists:reverse(StateRaceList) ++ - [#curr_fun{status = out, mfa = CurrFun, - label = CurrFunLabel, var_map = RaceVarMap, - def_vars = FunDefVars, call_vars = FunCallVars, - arg_types = FunArgTypes}], - Code, RaceVarMap); - _Other1 -> - fixup_all_calls(CurrFun, Fun, FunLabel, Args, - CodeB ++ - [#curr_fun{status = out, mfa = CurrFun, - label = CurrFunLabel, var_map = RaceVarMap, - def_vars = FunDefVars, call_vars = FunCallVars, - arg_types = FunArgTypes}], - Code, RaceVarMap) - end, - NewCode = - case Fun of - InitFun -> - [#curr_fun{status = in, mfa = Fun, - label = FunLabel, var_map = NewRaceVarMap, - def_vars = Args, call_vars = NewFunArgs, - arg_types = NewFunTypes}| - lists:reverse(StateRaceList)] ++ RetC; - _ -> - [#curr_fun{status = in, mfa = Fun, - label = FunLabel, var_map = NewRaceVarMap, - def_vars = Args, call_vars = NewFunArgs, - arg_types = NewFunTypes}|CodeB] ++ - RetC - end, - {Fun, FunLabel, NewCallsToAnalyze, NewCode, RaceList, NewRaceVarMap, - Args, NewFunArgs, NewFunTypes, NestingLevel}; - {_TupleA, _TupleB} -> - fixup_race_forward_helper(CurrFun, CurrFunLabel, Fun, FunLabel, - Tail, CallsToAnalyze, Code, RaceList, InitFun, NewFunArgs, - NewFunTypes, RaceWarnTag, RaceVarMap, FunDefVars, FunCallVars, - FunArgTypes, NestingLevel, Args, CodeB, StateRaceList) - end - end. - -%%% =========================================================================== -%%% -%%% Backward Analysis -%%% -%%% =========================================================================== - -fixup_race_backward(CurrFun, Calls, CallsToAnalyze, Parents, Height) -> - case Height =:= 0 of - true -> Parents; - false -> - case Calls of - [] -> - case is_integer(CurrFun) orelse lists:member(CurrFun, Parents) of - true -> Parents; - false -> [CurrFun|Parents] - end; - [Head|Tail] -> - {Parent, TupleB} = Head, - case TupleB =:= CurrFun of - true -> % more paths are needed - NewCallsToAnalyze = lists:delete(Head, CallsToAnalyze), - NewParents = - fixup_race_backward(Parent, NewCallsToAnalyze, - NewCallsToAnalyze, Parents, Height - 1), - fixup_race_backward(CurrFun, Tail, NewCallsToAnalyze, NewParents, - Height); - false -> - fixup_race_backward(CurrFun, Tail, CallsToAnalyze, Parents, - Height) - end - end - end. - -%%% =========================================================================== -%%% -%%% Utilities -%%% -%%% =========================================================================== - -are_bound_labels(Label1, Label2, RaceVarMap) -> - case dict:find(Label1, RaceVarMap) of - error -> false; - {ok, Labels} -> - lists:member(Label2, Labels) orelse - are_bound_labels_helper(Labels, Label1, Label2, RaceVarMap) - end. - -are_bound_labels_helper(Labels, OldLabel, CompLabel, RaceVarMap) -> - case dict:size(RaceVarMap) of - 0 -> false; - _ -> - case Labels of - [] -> false; - [Head|Tail] -> - NewRaceVarMap = dict:erase(OldLabel, RaceVarMap), - are_bound_labels(Head, CompLabel, NewRaceVarMap) orelse - are_bound_labels_helper(Tail, Head, CompLabel, NewRaceVarMap) - end - end. - -are_bound_vars(Vars1, Vars2, RaceVarMap) -> - case is_list(Vars1) andalso is_list(Vars2) of - true -> - case Vars1 of - [] -> false; - [AHead|ATail] -> - case Vars2 of - [] -> false; - [PHead|PTail] -> - are_bound_vars(AHead, PHead, RaceVarMap) andalso - are_bound_vars(ATail, PTail, RaceVarMap) - end - end; - false -> - {NewVars1, NewVars2, IsList} = - case is_list(Vars1) of - true -> - case Vars1 of - [Var1] -> {Var1, Vars2, true}; - _Thing -> {Vars1, Vars2, false} - end; - false -> - case is_list(Vars2) of - true -> - case Vars2 of - [Var2] -> {Vars1, Var2, true}; - _Thing -> {Vars1, Vars2, false} - end; - false -> {Vars1, Vars2, true} - end - end, - case IsList of - true -> - case cerl:type(NewVars1) of - var -> - case cerl:type(NewVars2) of - var -> - ALabel = cerl_trees:get_label(NewVars1), - PLabel = cerl_trees:get_label(NewVars2), - are_bound_labels(ALabel, PLabel, RaceVarMap) orelse - are_bound_labels(PLabel, ALabel, RaceVarMap); - alias -> - are_bound_vars(NewVars1, cerl:alias_var(NewVars2), - RaceVarMap); - values -> - are_bound_vars(NewVars1, cerl:values_es(NewVars2), - RaceVarMap); - _Other -> false - end; - tuple -> - case cerl:type(NewVars2) of - tuple -> - are_bound_vars(cerl:tuple_es(NewVars1), - cerl:tuple_es(NewVars2), RaceVarMap); - alias -> - are_bound_vars(NewVars1, cerl:alias_var(NewVars2), - RaceVarMap); - values -> - are_bound_vars(NewVars1, cerl:values_es(NewVars2), - RaceVarMap); - _Other -> false - end; - cons -> - case cerl:type(NewVars2) of - cons -> - are_bound_vars(cerl:cons_hd(NewVars1), - cerl:cons_hd(NewVars2), RaceVarMap) - andalso - are_bound_vars(cerl:cons_tl(NewVars1), - cerl:cons_tl(NewVars2), RaceVarMap); - alias -> - are_bound_vars(NewVars1, cerl:alias_var(NewVars2), - RaceVarMap); - values -> - are_bound_vars(NewVars1, cerl:values_es(NewVars2), - RaceVarMap); - _Other -> false - end; - alias -> - case cerl:type(NewVars2) of - alias -> - are_bound_vars(cerl:alias_var(NewVars1), - cerl:alias_var(NewVars2), RaceVarMap); - _Other -> - are_bound_vars(cerl:alias_var(NewVars1), - NewVars2, RaceVarMap) - end; - values -> - case cerl:type(NewVars2) of - values -> - are_bound_vars(cerl:values_es(NewVars1), - cerl:values_es(NewVars2), RaceVarMap); - _Other -> - are_bound_vars(cerl:values_es(NewVars1), - NewVars2, RaceVarMap) - end; - _Other -> false - end; - false -> false - end - end. - -callgraph__renew_tables(Table, Callgraph) -> - case Table of - {named, NameLabel, Names} -> - PTablesToAdd = - case NameLabel of - ?no_label -> []; - _Other -> [NameLabel] - end, - NamesToAdd = filter_named_tables(Names), - PTables = dialyzer_callgraph:get_public_tables(Callgraph), - NTables = dialyzer_callgraph:get_named_tables(Callgraph), - dialyzer_callgraph:put_public_tables( - lists:usort(PTablesToAdd ++ PTables), - dialyzer_callgraph:put_named_tables( - NamesToAdd ++ NTables, Callgraph)); - _Other -> - Callgraph - end. - -cleanup_clause_code(#curr_fun{mfa = CurrFun} = CurrTuple, Code, - NestingLevel, LocalNestingLevel) -> - case Code of - [] -> {CurrTuple, []}; - [Head|Tail] -> - {NewLocalNestingLevel, NewNestingLevel, NewCurrTuple, Return} = - case Head of - beg_case -> - {LocalNestingLevel, NestingLevel + 1, CurrTuple, false}; - #end_case{} -> - {LocalNestingLevel, NestingLevel - 1, CurrTuple, false}; - #end_clause{} -> - case NestingLevel =:= 0 of - true -> - {LocalNestingLevel, NestingLevel, CurrTuple, true}; - false -> - {LocalNestingLevel, NestingLevel, CurrTuple, false} - end; - #fun_call{caller = CurrFun} -> - {LocalNestingLevel - 1, NestingLevel, CurrTuple, false}; - #curr_fun{status = in} -> - {LocalNestingLevel - 1, NestingLevel, Head, false}; - #curr_fun{status = out} -> - {LocalNestingLevel + 1, NestingLevel, Head, false}; - Other when Other =/= #fun_call{} -> - {LocalNestingLevel, NestingLevel, CurrTuple, false} - end, - case Return of - true -> {NewCurrTuple, Tail}; - false -> - cleanup_clause_code(NewCurrTuple, Tail, NewNestingLevel, - NewLocalNestingLevel) - end - end. - -cleanup_dep_calls(DepList) -> - case DepList of - [] -> []; - [#dep_call{call_name = CallName, arg_types = ArgTypes, - vars = Vars, state = State, file_loc = FileLocation}|T] -> - [#dep_call{call_name = CallName, arg_types = ArgTypes, - vars = Vars, state = State, file_loc = FileLocation}| - cleanup_dep_calls(T)] - end. - -cleanup_race_code(State) -> - Callgraph = dialyzer_dataflow:state__get_callgraph(State), - dialyzer_dataflow:state__put_callgraph( - dialyzer_callgraph:race_code_new(Callgraph), State). - -filter_named_tables(NamesList) -> - case NamesList of - [] -> []; - [Head|Tail] -> - NewHead = - case string:find(Head, "()", trailing) of - nomatch -> [Head]; - _Other -> [] - end, - NewHead ++ filter_named_tables(Tail) - end. - -filter_parents(Parents, NewParents, Digraph) -> - case Parents of - [] -> NewParents; - [Head|Tail] -> - NewParents1 = filter_parents_helper1(Head, Tail, NewParents, Digraph), - filter_parents(Tail, NewParents1, Digraph) - end. - -filter_parents_helper1(First, Rest, NewParents, Digraph) -> - case Rest of - [] -> NewParents; - [Head|Tail] -> - NewParents1 = filter_parents_helper2(First, Head, NewParents, Digraph), - filter_parents_helper1(First, Tail, NewParents1, Digraph) - end. - -filter_parents_helper2(Parent1, Parent2, NewParents, Digraph) -> - case digraph:get_path(Digraph, Parent1, Parent2) of - false -> - case digraph:get_path(Digraph, Parent2, Parent1) of - false -> NewParents; - _Vertices -> NewParents -- [Parent1] - end; - _Vertices -> NewParents -- [Parent2] - end. - -find_all_bound_vars(Label, RaceVarMap) -> - case dict:find(Label, RaceVarMap) of - error -> [Label]; - {ok, Labels} -> - lists:usort(Labels ++ - find_all_bound_vars_helper(Labels, Label, RaceVarMap)) - end. - -find_all_bound_vars_helper(Labels, Label, RaceVarMap) -> - case dict:size(RaceVarMap) of - 0 -> []; - _ -> - case Labels of - [] -> []; - [Head|Tail] -> - NewRaceVarMap = dict:erase(Label, RaceVarMap), - find_all_bound_vars(Head, NewRaceVarMap) ++ - find_all_bound_vars_helper(Tail, Head, NewRaceVarMap) - end - end. - -fixup_all_calls(CurrFun, NextFun, NextFunLabel, Args, CodeToReplace, - Code, RaceVarMap) -> - case Code of - [] -> []; - [Head|Tail] -> - NewCode = - case Head of - #fun_call{caller = CurrFun, callee = Callee, - arg_types = FunArgTypes, vars = FunArgs} - when Callee =:= NextFun orelse Callee =:= NextFunLabel -> - RaceVarMap1 = race_var_map(Args, FunArgs, RaceVarMap, bind), - [#curr_fun{status = in, mfa = NextFun, label = NextFunLabel, - var_map = RaceVarMap1, def_vars = Args, - call_vars = FunArgs, arg_types = FunArgTypes}| - CodeToReplace]; - _Other -> [Head] - end, - RetCode = - fixup_all_calls(CurrFun, NextFun, NextFunLabel, Args, CodeToReplace, - Tail, RaceVarMap), - NewCode ++ RetCode - end. - -is_last_race(RaceTag, InitFun, Code, Callgraph) -> - case Code of - [] -> true; - [Head|Tail] -> - case Head of - RaceTag -> false; - #fun_call{callee = Fun} -> - FunName = - case is_integer(Fun) of - true -> - case dialyzer_callgraph:lookup_name(Fun, Callgraph) of - error -> Fun; - {ok, Name} -> Name - end; - false -> Fun - end, - Digraph = dialyzer_callgraph:get_digraph(Callgraph), - case FunName =:= InitFun orelse - digraph:get_path(Digraph, FunName, InitFun) of - false -> is_last_race(RaceTag, InitFun, Tail, Callgraph); - _Vertices -> false - end; - _Other -> is_last_race(RaceTag, InitFun, Tail, Callgraph) - end - end. - -lists_key_member(Member, List, N) when is_integer(Member) -> - case List of - [] -> 0; - [Head|Tail] -> - NewN = N + 1, - case Head of - Member -> NewN; - _Other -> lists_key_member(Member, Tail, NewN) - end - end; -lists_key_member(_M, _L, _N) -> - 0. - -lists_key_member_lists(MemberList, List) -> - case MemberList of - [] -> 0; - [Head|Tail] -> - case lists_key_member(Head, List, 0) of - 0 -> lists_key_member_lists(Tail, List); - Other -> Other - end - end. - -lists_key_members_lists(MemberList, List) -> - case MemberList of - [] -> []; - [Head|Tail] -> - lists:usort( - lists_key_members_lists_helper(Head, List, 1) ++ - lists_key_members_lists(Tail, List)) - end. - -lists_key_members_lists_helper(Elem, List, N) when is_integer(Elem) -> - case List of - [] -> []; - [Head|Tail] -> - NewHead = - case Head =:= Elem of - true -> [N]; - false -> [] - end, - NewHead ++ lists_key_members_lists_helper(Elem, Tail, N + 1) - end; -lists_key_members_lists_helper(_Elem, _List, _N) -> - [0]. - -lists_key_replace(N, List, NewMember) -> - {Before, [_|After]} = lists:split(N - 1, List), - Before ++ [NewMember|After]. - -lists_get(0, _List) -> ?no_label; -lists_get(N, List) -> lists:nth(N, List). - -refine_race(RaceCall, WarnVarArgs, RaceWarnTag, DependencyList, RaceVarMap) -> - case RaceWarnTag of - WarnWhereis when WarnWhereis =:= ?WARN_WHEREIS_REGISTER orelse - WarnWhereis =:= ?WARN_WHEREIS_UNREGISTER -> - case RaceCall of - #dep_call{call_name = ets_lookup} -> - DependencyList; - #dep_call{call_name = mnesia_dirty_read} -> - DependencyList; - #dep_call{call_name = whereis, args = VarArgs} -> - refine_race_helper(RaceCall, VarArgs, WarnVarArgs, RaceWarnTag, - DependencyList, RaceVarMap) - end; - ?WARN_ETS_LOOKUP_INSERT -> - case RaceCall of - #dep_call{call_name = whereis} -> - DependencyList; - #dep_call{call_name = mnesia_dirty_read} -> - DependencyList; - #dep_call{call_name = ets_lookup, args = VarArgs} -> - refine_race_helper(RaceCall, VarArgs, WarnVarArgs, RaceWarnTag, - DependencyList, RaceVarMap) - end; - ?WARN_MNESIA_DIRTY_READ_WRITE -> - case RaceCall of - #dep_call{call_name = whereis} -> - DependencyList; - #dep_call{call_name = ets_lookup} -> - DependencyList; - #dep_call{call_name = mnesia_dirty_read, args = VarArgs} -> - refine_race_helper(RaceCall, VarArgs, WarnVarArgs, RaceWarnTag, - DependencyList, RaceVarMap) - end - end. - -refine_race_helper(RaceCall, VarArgs, WarnVarArgs, RaceWarnTag, DependencyList, - RaceVarMap) -> - case compare_types(VarArgs, WarnVarArgs, RaceWarnTag, RaceVarMap) of - true -> [RaceCall|DependencyList]; - false -> DependencyList - end. - -remove_clause(RaceList, CurrTuple, Code, NestingLevel) -> - NewRaceList = fixup_case_rest_paths(RaceList, 0), - {NewCurrTuple, NewCode} = - cleanup_clause_code(CurrTuple, Code, 0, NestingLevel), - ReturnTuple = {NewRaceList, NewCurrTuple, NewCode, NestingLevel}, - case NewRaceList of - [beg_case|RTail] -> - case NewCode of - [#end_case{}|CTail] -> - remove_clause(RTail, NewCurrTuple, CTail, NestingLevel); - _Other -> ReturnTuple - end; - _Else -> ReturnTuple - end. - -remove_nonlocal_functions(Code, NestingLevel) -> - case Code of - [] -> []; - [H|T] -> - NewNL = - case H of - #curr_fun{status = in} -> - NestingLevel + 1; - #curr_fun{status = out} -> - NestingLevel - 1; - _Other -> - NestingLevel - end, - case NewNL =:= 0 of - true -> T; - false -> remove_nonlocal_functions(T, NewNL) - end - end. - -renew_curr_fun(CurrFun, Races) -> - Races#races{curr_fun = CurrFun}. - -renew_curr_fun_label(CurrFunLabel, Races) -> - Races#races{curr_fun_label = CurrFunLabel}. - -renew_race_list(RaceList, Races) -> - Races#races{race_list = RaceList}. - -renew_race_list_size(RaceListSize, Races) -> - Races#races{race_list_size = RaceListSize}. - -renew_race_tags(RaceTags, Races) -> - Races#races{race_tags = RaceTags}. - -renew_table(Table, Races) -> - Races#races{new_table = Table}. - -state__renew_curr_fun(CurrFun, State) -> - Races = dialyzer_dataflow:state__get_races(State), - dialyzer_dataflow:state__put_races(renew_curr_fun(CurrFun, Races), State). - -state__renew_curr_fun_label(CurrFunLabel, State) -> - Races = dialyzer_dataflow:state__get_races(State), - dialyzer_dataflow:state__put_races( - renew_curr_fun_label(CurrFunLabel, Races), State). - -state__renew_race_list(RaceList, State) -> - Races = dialyzer_dataflow:state__get_races(State), - dialyzer_dataflow:state__put_races(renew_race_list(RaceList, Races), State). - -state__renew_race_tags(RaceTags, State) -> - Races = dialyzer_dataflow:state__get_races(State), - dialyzer_dataflow:state__put_races(renew_race_tags(RaceTags, Races), State). - -state__renew_info(RaceList, RaceListSize, RaceTags, Table, State) -> - Callgraph = dialyzer_dataflow:state__get_callgraph(State), - Races = dialyzer_dataflow:state__get_races(State), - dialyzer_dataflow:state__put_callgraph( - callgraph__renew_tables(Table, Callgraph), - dialyzer_dataflow:state__put_races( - renew_table(Table, - renew_race_list(RaceList, - renew_race_list_size(RaceListSize, - renew_race_tags(RaceTags, Races)))), State)). - -%%% =========================================================================== -%%% -%%% Variable and Type Utilities -%%% -%%% =========================================================================== - -any_args(StrList) -> - case StrList of - [] -> false; - [Head|Tail] -> - case string:find(Head, "()", trailing) of - nomatch -> any_args(Tail); - _Other -> true - end - end. - --spec bind_dict_vars(label(), label(), dict:dict()) -> dict:dict(). - -bind_dict_vars(Key, Label, RaceVarMap) -> - case Key =:= Label of - true -> RaceVarMap; - false -> - case dict:find(Key, RaceVarMap) of - error -> dict:store(Key, [Label], RaceVarMap); - {ok, Labels} -> - case lists:member(Label, Labels) of - true -> RaceVarMap; - false -> dict:store(Key, [Label|Labels], RaceVarMap) - end - end - end. - -bind_dict_vars_list(Key, Labels, RaceVarMap) -> - case Labels of - [] -> RaceVarMap; - [Head|Tail] -> - bind_dict_vars_list(Key, Tail, bind_dict_vars(Key, Head, RaceVarMap)) - end. - -compare_ets_insert(OldWarnVarArgs, NewWarnVarArgs, RaceVarMap) -> - [Old1, Old2, Old3, Old4] = OldWarnVarArgs, - [New1, New2, New3, New4] = NewWarnVarArgs, - Bool = - case any_args(Old2) of - true -> compare_var_list(New1, Old1, RaceVarMap); - false -> - case any_args(New2) of - true -> compare_var_list(New1, Old1, RaceVarMap); - false -> compare_var_list(New1, Old1, RaceVarMap) - orelse (Old2 =:= New2) - end - end, - case Bool of - true -> - case any_args(Old4) of - true -> - case compare_list_vars(Old3, ets_list_args(New3), [], RaceVarMap) of - true -> true; - Args3 -> lists_key_replace(3, OldWarnVarArgs, Args3) - end; - false -> - case any_args(New4) of - true -> - case compare_list_vars(Old3, ets_list_args(New3), [], - RaceVarMap) of - true -> true; - Args3 -> lists_key_replace(3, OldWarnVarArgs, Args3) - end; - false -> - case compare_list_vars(Old3, ets_list_args(New3), [], - RaceVarMap) of - true -> true; - Args3 -> - lists_key_replace(4, - lists_key_replace(3, OldWarnVarArgs, Args3), Old4 -- New4) - end - end - end; - false -> OldWarnVarArgs - end. - -compare_first_arg(OldWarnVarArgs, NewWarnVarArgs, RaceVarMap) -> - [Old1, Old2|_OldT] = OldWarnVarArgs, - [New1, New2|_NewT] = NewWarnVarArgs, - case any_args(Old2) of - true -> - case compare_var_list(New1, Old1, RaceVarMap) of - true -> true; - false -> OldWarnVarArgs - end; - false -> - case any_args(New2) of - true -> - case compare_var_list(New1, Old1, RaceVarMap) of - true -> true; - false -> OldWarnVarArgs - end; - false -> - case compare_var_list(New1, Old1, RaceVarMap) of - true -> true; - false -> lists_key_replace(2, OldWarnVarArgs, Old2 -- New2) - end - end - end. - -compare_argtypes(ArgTypes, WarnArgTypes) -> - lists:any(fun (X) -> lists:member(X, WarnArgTypes) end, ArgTypes). - -%% Compares the argument types of the two suspicious calls. -compare_types(VarArgs, WarnVarArgs, RaceWarnTag, RaceVarMap) -> - case RaceWarnTag of - ?WARN_WHEREIS_REGISTER -> - [VA1, VA2] = VarArgs, - [WVA1, WVA2, _, _] = WarnVarArgs, - case any_args(VA2) of - true -> compare_var_list(VA1, WVA1, RaceVarMap); - false -> - case any_args(WVA2) of - true -> compare_var_list(VA1, WVA1, RaceVarMap); - false -> - compare_var_list(VA1, WVA1, RaceVarMap) orelse - compare_argtypes(VA2, WVA2) - end - end; - ?WARN_WHEREIS_UNREGISTER -> - [VA1, VA2] = VarArgs, - [WVA1, WVA2] = WarnVarArgs, - case any_args(VA2) of - true -> compare_var_list(VA1, WVA1, RaceVarMap); - false -> - case any_args(WVA2) of - true -> compare_var_list(VA1, WVA1, RaceVarMap); - false -> - compare_var_list(VA1, WVA1, RaceVarMap) orelse - compare_argtypes(VA2, WVA2) - end - end; - ?WARN_ETS_LOOKUP_INSERT -> - [VA1, VA2, VA3, VA4] = VarArgs, - [WVA1, WVA2, WVA3, WVA4] = WarnVarArgs, - Bool = - case any_args(VA2) of - true -> compare_var_list(VA1, WVA1, RaceVarMap); - false -> - case any_args(WVA2) of - true -> compare_var_list(VA1, WVA1, RaceVarMap); - false -> - compare_var_list(VA1, WVA1, RaceVarMap) orelse - compare_argtypes(VA2, WVA2) - end - end, - Bool andalso - (case any_args(VA4) of - true -> - compare_var_list(VA3, WVA3, RaceVarMap); - false -> - case any_args(WVA4) of - true -> - compare_var_list(VA3, WVA3, RaceVarMap); - false -> - compare_var_list(VA3, WVA3, RaceVarMap) orelse - compare_argtypes(VA4, WVA4) - end - end); - ?WARN_MNESIA_DIRTY_READ_WRITE -> - [VA1, VA2|_] = VarArgs, %% Two or four elements - [WVA1, WVA2|_] = WarnVarArgs, - case any_args(VA2) of - true -> compare_var_list(VA1, WVA1, RaceVarMap); - false -> - case any_args(WVA2) of - true -> compare_var_list(VA1, WVA1, RaceVarMap); - false -> - compare_var_list(VA1, WVA1, RaceVarMap) orelse - compare_argtypes(VA2, WVA2) - end - end - end. - -compare_list_vars(VarList1, VarList2, NewVarList1, RaceVarMap) -> - case VarList1 of - [] -> - case NewVarList1 of - [] -> true; - _Other -> NewVarList1 - end; - [Head|Tail] -> - NewHead = - case compare_var_list(Head, VarList2, RaceVarMap) of - true -> []; - false -> [Head] - end, - compare_list_vars(Tail, VarList2, NewHead ++ NewVarList1, RaceVarMap) - end. - -compare_vars(Var1, Var2, RaceVarMap) when is_integer(Var1), is_integer(Var2) -> - Var1 =:= Var2 orelse - are_bound_labels(Var1, Var2, RaceVarMap) orelse - are_bound_labels(Var2, Var1, RaceVarMap); -compare_vars(_Var1, _Var2, _RaceVarMap) -> - false. - --spec compare_var_list(label_type(), [label_type()], dict:dict()) -> boolean(). - -compare_var_list(Var, VarList, RaceVarMap) -> - lists:any(fun (V) -> compare_vars(Var, V, RaceVarMap) end, VarList). - -ets_list_args(MaybeList) -> - case is_list(MaybeList) of - true -> - try [ets_tuple_args(T) || T <- MaybeList] - catch _:_ -> [?no_label] - end; - false -> [ets_tuple_args(MaybeList)] - end. - -ets_list_argtypes(ListStr) -> - ListStr1 = string:trim(ListStr, leading, "$["), - string:trim(ListStr1, trailing, "$]$.$,"). - -ets_tuple_args(MaybeTuple) -> - case is_tuple(MaybeTuple) of - true -> element(1, MaybeTuple); - false -> ?no_label - end. - -ets_tuple_argtypes2(TupleList, ElemList) -> - case TupleList of - [] -> ElemList; - [H|T] -> - ets_tuple_argtypes2(T, - ets_tuple_argtypes2_helper(H, [], 0) ++ ElemList) - end. - -ets_tuple_argtypes2_helper(TupleStr, ElemStr, NestingLevel) -> - case TupleStr of - [] -> []; - [H|T] -> - {NewElemStr, NewNestingLevel, Return} = - case H of - ${ when NestingLevel =:= 0 -> - {ElemStr, NestingLevel + 1, false}; - ${ -> - {[H|ElemStr], NestingLevel + 1, false}; - $[ -> - {[H|ElemStr], NestingLevel + 1, false}; - $( -> - {[H|ElemStr], NestingLevel + 1, false}; - $} -> - {[H|ElemStr], NestingLevel - 1, false}; - $] -> - {[H|ElemStr], NestingLevel - 1, false}; - $) -> - {[H|ElemStr], NestingLevel - 1, false}; - $, when NestingLevel =:= 1 -> - {lists:reverse(ElemStr), NestingLevel, true}; - _Other -> - {[H|ElemStr], NestingLevel, false} - end, - case Return of - true -> string:lexemes(NewElemStr, " |"); - false -> - ets_tuple_argtypes2_helper(T, NewElemStr, NewNestingLevel) - end - end. - -ets_tuple_argtypes1(Str, Tuple, TupleList, NestingLevel) -> - case Str of - [] -> TupleList; - [H|T] -> - {NewTuple, NewNestingLevel, Add} = - case H of - ${ -> - {[H|Tuple], NestingLevel + 1, false}; - $} -> - case NestingLevel of - 1 -> - {[H|Tuple], NestingLevel - 1, true}; - _Else -> - {[H|Tuple], NestingLevel - 1, false} - end; - _Other1 when NestingLevel =:= 0 -> - {Tuple, NestingLevel, false}; - _Other2 -> - {[H|Tuple], NestingLevel, false} - end, - case Add of - true -> - ets_tuple_argtypes1(T, [], - [lists:reverse(NewTuple)|TupleList], - NewNestingLevel); - false -> - ets_tuple_argtypes1(T, NewTuple, TupleList, NewNestingLevel) - end - end. - -format_arg(?bypassed) -> ?no_label; -format_arg(Arg0) -> - Arg = cerl:fold_literal(Arg0), - case cerl:type(Arg) of - var -> cerl_trees:get_label(Arg); - tuple -> list_to_tuple([format_arg(A) || A <- cerl:tuple_es(Arg)]); - cons -> [format_arg(cerl:cons_hd(Arg))|format_arg(cerl:cons_tl(Arg))]; - alias -> format_arg(cerl:alias_var(Arg)); - literal -> - case cerl:is_c_nil(Arg) of - true -> []; - false -> ?no_label - end; - _Other -> ?no_label - end. - --spec format_args([core_vars()], [erl_types:erl_type()], - dialyzer_dataflow:state(), call()) -> - args(). - -format_args([], [], _State, _Call) -> - []; -format_args(ArgList, TypeList, CleanState, Call) -> - format_args_2(format_args_1(ArgList, TypeList, CleanState), Call). - -format_args_1([Arg], [Type], CleanState) -> - [format_arg(Arg), format_type(Type, CleanState)]; -format_args_1([Arg|Args], [Type|Types], CleanState) -> - List = - case Arg =:= ?bypassed of - true -> [?no_label, format_type(Type, CleanState)]; - false -> - case cerl:is_literal(cerl:fold_literal(Arg)) of - true -> [?no_label, format_cerl(Arg)]; - false -> [format_arg(Arg), format_type(Type, CleanState)] - end - end, - List ++ format_args_1(Args, Types, CleanState). - -format_args_2(StrArgList, Call) -> - case Call of - whereis -> - lists_key_replace(2, StrArgList, - string:lexemes(lists:nth(2, StrArgList), " |")); - register -> - lists_key_replace(2, StrArgList, - string:lexemes(lists:nth(2, StrArgList), " |")); - unregister -> - lists_key_replace(2, StrArgList, - string:lexemes(lists:nth(2, StrArgList), " |")); - ets_new -> - StrArgList1 = lists_key_replace(2, StrArgList, - string:lexemes(lists:nth(2, StrArgList), " |")), - lists_key_replace(4, StrArgList1, - string:lexemes(ets_list_argtypes(lists:nth(4, StrArgList1)), " |")); - ets_lookup -> - StrArgList1 = lists_key_replace(2, StrArgList, - string:lexemes(lists:nth(2, StrArgList), " |")), - lists_key_replace(4, StrArgList1, - string:lexemes(lists:nth(4, StrArgList1), " |")); - ets_insert -> - StrArgList1 = lists_key_replace(2, StrArgList, - string:lexemes(lists:nth(2, StrArgList), " |")), - lists_key_replace(4, StrArgList1, - ets_tuple_argtypes2( - ets_tuple_argtypes1(lists:nth(4, StrArgList1), [], [], 0), - [])); - mnesia_dirty_read1 -> - lists_key_replace(2, StrArgList, - [mnesia_tuple_argtypes(T) || T <- string:lexemes( - lists:nth(2, StrArgList), " |")]); - mnesia_dirty_read2 -> - lists_key_replace(2, StrArgList, - string:lexemes(lists:nth(2, StrArgList), " |")); - mnesia_dirty_write1 -> - lists_key_replace(2, StrArgList, - [mnesia_record_tab(R) || R <- string:lexemes( - lists:nth(2, StrArgList), " |")]); - mnesia_dirty_write2 -> - lists_key_replace(2, StrArgList, - string:lexemes(lists:nth(2, StrArgList), " |")); - function_call -> StrArgList - end. - -format_cerl(Tree) -> - cerl_prettypr:format(cerl:set_ann(Tree, []), - [{hook, dialyzer_utils:pp_hook()}, - {noann, true}, - {paper, 100000}, - {ribbon, 100000} - ]). - -format_type(Type, State) -> - R = dialyzer_dataflow:state__get_records(State), - erl_types:t_to_string(Type, R). - -mnesia_record_tab(RecordStr) -> - case erl_scan:string(RecordStr) of - {ok, [{'#', _}, {atom, _, Name}|_], _} -> - io_lib:write_string(atom_to_list(Name), $'); - _ -> RecordStr - end. - -mnesia_tuple_argtypes(TupleStr) -> - TupleStr1 = string:trim(TupleStr, leading, "${"), - [TupleStr2|_T] = string:lexemes(TupleStr1, " ,"), - lists:flatten(string:lexemes(TupleStr2, " |")). - --spec race_var_map(var_to_map1(), var_to_map2(), dict:dict(), op()) -> - dict:dict(). - -race_var_map(Vars1, Vars2, RaceVarMap, Op) -> - case Vars1 =:= ?no_arg orelse Vars1 =:= ?bypassed - orelse Vars2 =:= ?bypassed of - true -> RaceVarMap; - false -> - case is_list(Vars1) andalso is_list(Vars2) of - true -> - case Vars1 of - [] -> RaceVarMap; - [AHead|ATail] -> - case Vars2 of - [] -> RaceVarMap; - [PHead|PTail] -> - NewRaceVarMap = race_var_map(AHead, PHead, RaceVarMap, Op), - race_var_map(ATail, PTail, NewRaceVarMap, Op) - end - end; - false -> - {NewVars1, NewVars2, Bool} = - case is_list(Vars1) of - true -> - case Vars1 of - [Var1] -> {Var1, Vars2, true}; - _Thing -> {Vars1, Vars2, false} - end; - false -> - case is_list(Vars2) of - true -> - case Vars2 of - [Var2] -> {Vars1, Var2, true}; - _Thing -> {Vars1, Vars2, false} - end; - false -> {Vars1, Vars2, true} - end - end, - case Bool of - true -> - case cerl:type(NewVars1) of - var -> - case cerl:type(NewVars2) of - var -> - ALabel = cerl_trees:get_label(NewVars1), - PLabel = cerl_trees:get_label(NewVars2), - case Op of - bind -> - TempRaceVarMap = - bind_dict_vars(ALabel, PLabel, RaceVarMap), - bind_dict_vars(PLabel, ALabel, TempRaceVarMap); - unbind -> - TempRaceVarMap = - unbind_dict_vars(ALabel, PLabel, RaceVarMap), - unbind_dict_vars(PLabel, ALabel, TempRaceVarMap) - end; - alias -> - race_var_map(NewVars1, cerl:alias_var(NewVars2), - RaceVarMap, Op); - values -> - race_var_map(NewVars1, cerl:values_es(NewVars2), - RaceVarMap, Op); - _Other -> RaceVarMap - end; - tuple -> - case cerl:type(NewVars2) of - tuple -> - race_var_map(cerl:tuple_es(NewVars1), - cerl:tuple_es(NewVars2), RaceVarMap, Op); - alias -> - race_var_map(NewVars1, cerl:alias_var(NewVars2), - RaceVarMap, Op); - values -> - race_var_map(NewVars1, cerl:values_es(NewVars2), - RaceVarMap, Op); - _Other -> RaceVarMap - end; - cons -> - case cerl:type(NewVars2) of - cons -> - NewRaceVarMap = race_var_map(cerl:cons_hd(NewVars1), - cerl:cons_hd(NewVars2), RaceVarMap, Op), - race_var_map(cerl:cons_tl(NewVars1), - cerl:cons_tl(NewVars2), NewRaceVarMap, Op); - alias -> - race_var_map(NewVars1, cerl:alias_var(NewVars2), - RaceVarMap, Op); - values -> - race_var_map(NewVars1, cerl:values_es(NewVars2), - RaceVarMap, Op); - _Other -> RaceVarMap - end; - alias -> - case cerl:type(NewVars2) of - alias -> - race_var_map(cerl:alias_var(NewVars1), - cerl:alias_var(NewVars2), RaceVarMap, Op); - _Other -> - race_var_map(cerl:alias_var(NewVars1), - NewVars2, RaceVarMap, Op) - end; - values -> - case cerl:type(NewVars2) of - values -> - race_var_map(cerl:values_es(NewVars1), - cerl:values_es(NewVars2), RaceVarMap, Op); - _Other -> - race_var_map(cerl:values_es(NewVars1), - NewVars2, RaceVarMap, Op) - end; - _Other -> RaceVarMap - end; - false -> RaceVarMap - end - end - end. - -race_var_map_clauses(Clauses, RaceVarMap) -> - case Clauses of - [] -> RaceVarMap; - [#end_clause{arg = Arg, pats = Pats, guard = Guard}|T] -> - {RaceVarMap1, _RemoveClause} = - race_var_map_guard(Arg, Pats, Guard, RaceVarMap, bind), - race_var_map_clauses(T, RaceVarMap1) - end. - -race_var_map_guard(Arg, Pats, Guard, RaceVarMap, Op) -> - {NewRaceVarMap, RemoveClause} = - case cerl:type(Guard) of - call -> - CallName = cerl:call_name(Guard), - case cerl:is_literal(CallName) of - true -> - case cerl:concrete(CallName) of - '=:=' -> - [Arg1, Arg2] = cerl:call_args(Guard), - {race_var_map(Arg1, Arg2, RaceVarMap, Op), false}; - '==' -> - [Arg1, Arg2] = cerl:call_args(Guard), - {race_var_map(Arg1, Arg2, RaceVarMap, Op), false}; - '=/=' -> - case Op of - bind -> - [Arg1, Arg2] = cerl:call_args(Guard), - {RaceVarMap, are_bound_vars(Arg1, Arg2, RaceVarMap)}; - unbind -> {RaceVarMap, false} - end; - _Other -> {RaceVarMap, false} - end; - false -> {RaceVarMap, false} - end; - _Other -> {RaceVarMap, false} - end, - {RaceVarMap1, RemoveClause1} = - race_var_map_guard_helper1(Arg, Pats, - race_var_map(Arg, Pats, NewRaceVarMap, Op), Op), - {RaceVarMap1, RemoveClause orelse RemoveClause1}. - -race_var_map_guard_helper1(Arg, Pats, RaceVarMap, Op) -> - case Arg =:= ?no_arg orelse Arg =:= ?bypassed of - true -> {RaceVarMap, false}; - false -> - case cerl:type(Arg) of - call -> - case Pats of - [NewPat] -> - ModName = cerl:call_module(Arg), - CallName = cerl:call_name(Arg), - case cerl:is_literal(ModName) andalso - cerl:is_literal(CallName) of - true -> - case {cerl:concrete(ModName), - cerl:concrete(CallName)} of - {erlang, '=:='} -> - race_var_map_guard_helper2(Arg, NewPat, true, - RaceVarMap, Op); - {erlang, '=='} -> - race_var_map_guard_helper2(Arg, NewPat, true, - RaceVarMap, Op); - {erlang, '=/='} -> - race_var_map_guard_helper2(Arg, NewPat, false, - RaceVarMap, Op); - _Else -> {RaceVarMap, false} - end; - false -> {RaceVarMap, false} - end; - _Other -> {RaceVarMap, false} - end; - _Other -> {RaceVarMap, false} - end - end. - -race_var_map_guard_helper2(Arg, Pat0, Bool, RaceVarMap, Op) -> - Pat = cerl:fold_literal(Pat0), - case cerl:type(Pat) of - literal -> - [Arg1, Arg2] = cerl:call_args(Arg), - case cerl:concrete(Pat) of - Bool -> - {race_var_map(Arg1, Arg2, RaceVarMap, Op), false}; - _Else -> - case Op of - bind -> - {RaceVarMap, are_bound_vars(Arg1, Arg2, RaceVarMap)}; - unbind -> {RaceVarMap, false} - end - end; - _Else -> {RaceVarMap, false} - end. - -unbind_dict_vars(Var, Var, RaceVarMap) -> - RaceVarMap; -unbind_dict_vars(Var1, Var2, RaceVarMap) -> - case dict:find(Var1, RaceVarMap) of - error -> RaceVarMap; - {ok, Labels} -> - case Labels of - [] -> dict:erase(Var1, RaceVarMap); - _Else -> - case lists:member(Var2, Labels) of - true -> - unbind_dict_vars(Var1, Var2, - bind_dict_vars_list(Var1, Labels -- [Var2], - dict:erase(Var1, RaceVarMap))); - false -> - unbind_dict_vars_helper(Labels, Var1, Var2, RaceVarMap) - end - end - end. - -unbind_dict_vars_helper(Labels, Key, CompLabel, RaceVarMap) -> - case dict:size(RaceVarMap) of - 0 -> RaceVarMap; - _ -> - case Labels of - [] -> RaceVarMap; - [Head|Tail] -> - NewRaceVarMap = - case are_bound_labels(Head, CompLabel, RaceVarMap) orelse - are_bound_labels(CompLabel, Head, RaceVarMap) of - true -> - bind_dict_vars_list(Key, Labels -- [Head], - dict:erase(Key, RaceVarMap)); - false -> RaceVarMap - end, - unbind_dict_vars_helper(Tail, Key, CompLabel, NewRaceVarMap) - end - end. - -var_analysis(FunDefArgs, FunCallArgs, WarnVarArgs, RaceWarnTag) -> - case RaceWarnTag of - ?WARN_WHEREIS_REGISTER -> - [WVA1, WVA2, WVA3, WVA4] = WarnVarArgs, - ArgNos = lists_key_members_lists(WVA1, FunDefArgs), - [[lists_get(N, FunCallArgs) || N <- ArgNos], WVA2, WVA3, WVA4]; - ?WARN_WHEREIS_UNREGISTER -> - [WVA1, WVA2] = WarnVarArgs, - ArgNos = lists_key_members_lists(WVA1, FunDefArgs), - [[lists_get(N, FunCallArgs) || N <- ArgNos], WVA2]; - ?WARN_ETS_LOOKUP_INSERT -> - [WVA1, WVA2, WVA3, WVA4] = WarnVarArgs, - ArgNos1 = lists_key_members_lists(WVA1, FunDefArgs), - ArgNos2 = lists_key_members_lists(WVA3, FunDefArgs), - [[lists_get(N1, FunCallArgs) || N1 <- ArgNos1], WVA2, - [lists_get(N2, FunCallArgs) || N2 <- ArgNos2], WVA4]; - ?WARN_MNESIA_DIRTY_READ_WRITE -> - [WVA1, WVA2|T] = WarnVarArgs, - ArgNos = lists_key_members_lists(WVA1, FunDefArgs), - [[lists_get(N, FunCallArgs) || N <- ArgNos], WVA2|T] - end. - -var_type_analysis(FunDefArgs, FunCallTypes, WarnVarArgs, RaceWarnTag, - RaceVarMap, CleanState) -> - FunVarArgs = format_args(FunDefArgs, FunCallTypes, CleanState, function_call), - case RaceWarnTag of - ?WARN_WHEREIS_REGISTER -> - [WVA1, WVA2, WVA3, WVA4] = WarnVarArgs, - Vars = find_all_bound_vars(WVA1, RaceVarMap), - case lists_key_member_lists(Vars, FunVarArgs) of - 0 -> [Vars, WVA2, WVA3, WVA4]; - N when is_integer(N) -> - NewWVA2 = string:lexemes(lists:nth(N + 1, FunVarArgs), " |"), - [Vars, NewWVA2, WVA3, WVA4] - end; - ?WARN_WHEREIS_UNREGISTER -> - [WVA1, WVA2] = WarnVarArgs, - Vars = find_all_bound_vars(WVA1, RaceVarMap), - case lists_key_member_lists(Vars, FunVarArgs) of - 0 -> [Vars, WVA2]; - N when is_integer(N) -> - NewWVA2 = string:lexemes(lists:nth(N + 1, FunVarArgs), " |"), - [Vars, NewWVA2] - end; - ?WARN_ETS_LOOKUP_INSERT -> - [WVA1, WVA2, WVA3, WVA4] = WarnVarArgs, - Vars1 = find_all_bound_vars(WVA1, RaceVarMap), - FirstVarArg = - case lists_key_member_lists(Vars1, FunVarArgs) of - 0 -> [Vars1, WVA2]; - N1 when is_integer(N1) -> - NewWVA2 = string:lexemes(lists:nth(N1 + 1, FunVarArgs), " |"), - [Vars1, NewWVA2] - end, - Vars2 = - lists:flatten( - [find_all_bound_vars(A, RaceVarMap) || A <- ets_list_args(WVA3)]), - case lists_key_member_lists(Vars2, FunVarArgs) of - 0 -> FirstVarArg ++ [Vars2, WVA4]; - N2 when is_integer(N2) -> - NewWVA4 = - ets_tuple_argtypes2( - ets_tuple_argtypes1(lists:nth(N2 + 1, FunVarArgs), [], [], 0), - []), - FirstVarArg ++ [Vars2, NewWVA4] - - end; - ?WARN_MNESIA_DIRTY_READ_WRITE -> - [WVA1, WVA2|T] = WarnVarArgs, - Arity = - case T of - [] -> 1; - _Else -> 2 - end, - Vars = find_all_bound_vars(WVA1, RaceVarMap), - case lists_key_member_lists(Vars, FunVarArgs) of - 0 -> [Vars, WVA2|T]; - N when is_integer(N) -> - NewWVA2 = - case Arity of - 1 -> - [mnesia_record_tab(R) || R <- string:lexemes( - lists:nth(2, FunVarArgs), " |")]; - 2 -> - string:lexemes(lists:nth(N + 1, FunVarArgs), " |") - end, - [Vars, NewWVA2|T] - end - end. - -%%% =========================================================================== -%%% -%%% Warning Format Utilities -%%% -%%% =========================================================================== - -add_race_warning(Warn, #races{race_warnings = Warns} = Races) -> - Races#races{race_warnings = [Warn|Warns]}. - -get_race_warn(Fun, Args, ArgTypes, DepList, State) -> - {M, F, _A} = Fun, - case DepList of - [] -> {State, no_race}; - _Other -> - {State, {race_condition, [M, F, Args, ArgTypes, State, DepList]}} - end. - --spec get_race_warnings(races(), dialyzer_dataflow:state()) -> - {races(), dialyzer_dataflow:state()}. - -get_race_warnings(#races{race_warnings = RaceWarnings}, State) -> - get_race_warnings_helper(RaceWarnings, State). - -get_race_warnings_helper(Warnings, State) -> - case Warnings of - [] -> - {dialyzer_dataflow:state__get_races(State), State}; - [H|T] -> - {RaceWarnTag, WarningInfo, {race_condition, [M, F, A, AT, S, DepList]}} = H, - Reason = - case RaceWarnTag of - ?WARN_WHEREIS_REGISTER -> - get_reason(lists:keysort(7, DepList), - "might fail due to a possible race condition " - "caused by its combination with "); - ?WARN_WHEREIS_UNREGISTER -> - get_reason(lists:keysort(7, DepList), - "might fail due to a possible race condition " - "caused by its combination with "); - ?WARN_ETS_LOOKUP_INSERT -> - get_reason(lists:keysort(7, DepList), - "might have an unintended effect due to " ++ - "a possible race condition " ++ - "caused by its combination with "); - ?WARN_MNESIA_DIRTY_READ_WRITE -> - get_reason(lists:keysort(7, DepList), - "might have an unintended effect due to " ++ - "a possible race condition " ++ - "caused by its combination with ") - end, - W = - {?WARN_RACE_CONDITION, WarningInfo, - {race_condition, - [M, F, dialyzer_dataflow:format_args(A, AT, S), Reason]}}, - get_race_warnings_helper(T, - dialyzer_dataflow:state__add_warning(W, State)) - end. - -get_reason(DependencyList, Reason) -> - case DependencyList of - [] -> ""; - [#dep_call{call_name = Call, arg_types = ArgTypes, vars = Args, - state = State, file_loc = {File, Location}}|T] -> - R = - Reason ++ - case Call of - whereis -> "the erlang:whereis"; - ets_lookup -> "the ets:lookup"; - mnesia_dirty_read -> "the mnesia:dirty_read" - end ++ - dialyzer_dataflow:format_args(Args, ArgTypes, State) ++ - " call in " ++ - filename:basename(File) ++ - " on line " ++ - lists:flatten(io_lib:write(Location)), - case T of - [] -> R; - _ -> get_reason(T, R ++ ", ") - end - end. - -state__add_race_warning(State, RaceWarn, RaceWarnTag, WarningInfo) -> - case RaceWarn of - no_race -> State; - _Else -> - Races = dialyzer_dataflow:state__get_races(State), - Warn = {RaceWarnTag, WarningInfo, RaceWarn}, - dialyzer_dataflow:state__put_races(add_race_warning(Warn, Races), State) - end. - -%%% =========================================================================== -%%% -%%% Record Interfaces -%%% -%%% =========================================================================== - --spec beg_clause_new(var_to_map1(), var_to_map1(), cerl:cerl()) -> - #beg_clause{}. - -beg_clause_new(Arg, Pats, Guard) -> - #beg_clause{arg = Arg, pats = Pats, guard = Guard}. - --spec cleanup(races()) -> races(). - -cleanup(#races{race_list = RaceList}) -> - #races{race_list = RaceList}. - --spec end_case_new([#end_clause{}]) -> #end_case{}. - -end_case_new(Clauses) -> - #end_case{clauses = Clauses}. - --spec end_clause_new(var_to_map1(), var_to_map1(), cerl:cerl()) -> - #end_clause{}. - -end_clause_new(Arg, Pats, Guard) -> - #end_clause{arg = Arg, pats = Pats, guard = Guard}. - --spec get_curr_fun(races()) -> dialyzer_callgraph:mfa_or_funlbl(). - -get_curr_fun(#races{curr_fun = CurrFun}) -> - CurrFun. - --spec get_curr_fun_args(races()) -> core_args(). - -get_curr_fun_args(#races{curr_fun_args = CurrFunArgs}) -> - CurrFunArgs. - --spec get_new_table(races()) -> table(). - -get_new_table(#races{new_table = Table}) -> - Table. - --spec get_race_analysis(races()) -> boolean(). - -get_race_analysis(#races{race_analysis = RaceAnalysis}) -> - RaceAnalysis. - --spec get_race_list(races()) -> code(). - -get_race_list(#races{race_list = RaceList}) -> - RaceList. - --spec get_race_list_size(races()) -> non_neg_integer(). - -get_race_list_size(#races{race_list_size = RaceListSize}) -> - RaceListSize. - --spec get_race_list_and_size(races()) -> {code(), non_neg_integer()}. - -get_race_list_and_size(#races{race_list = RaceList, - race_list_size = RaceListSize}) -> - {RaceList, RaceListSize}. - --spec let_tag_new(var_to_map1(), var_to_map1()) -> #let_tag{}. - -let_tag_new(Var, Arg) -> - #let_tag{var = Var, arg = Arg}. - --spec new() -> races(). - -new() -> #races{}. - --spec put_curr_fun(dialyzer_callgraph:mfa_or_funlbl(), label(), races()) -> - races(). - -put_curr_fun(CurrFun, CurrFunLabel, Races) -> - Races#races{curr_fun = CurrFun, - curr_fun_label = CurrFunLabel, - curr_fun_args = empty}. - --spec put_fun_args(core_args(), races()) -> races(). - -put_fun_args(Args, #races{curr_fun_args = CurrFunArgs} = Races) -> - case CurrFunArgs of - empty -> Races#races{curr_fun_args = Args}; - _Other -> Races - end. - --spec put_race_analysis(boolean(), races()) -> - races(). - -put_race_analysis(Analysis, Races) -> - Races#races{race_analysis = Analysis}. - --spec put_race_list(code(), non_neg_integer(), races()) -> - races(). - -put_race_list(RaceList, RaceListSize, Races) -> - Races#races{race_list = RaceList, race_list_size = RaceListSize}. diff --git a/lib/dialyzer/test/indent_SUITE_data/dialyzer_options b/lib/dialyzer/test/indent_SUITE_data/dialyzer_options index 7c088f9a65d8..3ff26b87dbf4 100644 --- a/lib/dialyzer/test/indent_SUITE_data/dialyzer_options +++ b/lib/dialyzer/test/indent_SUITE_data/dialyzer_options @@ -1 +1 @@ -{dialyzer_options, [{warnings, [no_unused, no_return, race_conditions]}]}. +{dialyzer_options, [{warnings, [no_unused, no_return]}]}. diff --git a/lib/dialyzer/test/indent_SUITE_data/results/whereis_control_flow1 b/lib/dialyzer/test/indent_SUITE_data/results/whereis_control_flow1 deleted file mode 100644 index 1154cada8a5a..000000000000 --- a/lib/dialyzer/test/indent_SUITE_data/results/whereis_control_flow1 +++ /dev/null @@ -1,4 +0,0 @@ - -whereis_control_flow1.erl:13:18: The call erlang:register - (AnAtom :: atom(), - Pid :: pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_control_flow1.erl on line {8,8} diff --git a/lib/dialyzer/test/indent_SUITE_data/src/whereis_control_flow1.erl b/lib/dialyzer/test/indent_SUITE_data/src/whereis_control_flow1.erl deleted file mode 100644 index e65f6c3e23ad..000000000000 --- a/lib/dialyzer/test/indent_SUITE_data/src/whereis_control_flow1.erl +++ /dev/null @@ -1,17 +0,0 @@ -%% This tests the presence of possible races due to a whereis/register -%% combination. It takes into account control flow that might exist. - --module(whereis_control_flow1). --export([start/2]). - -start(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - case Pid =:= self() of - true -> ok; - false -> register(AnAtom, Pid) - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/dialyzer_options b/lib/dialyzer/test/race_SUITE_data/dialyzer_options deleted file mode 100644 index 2be2f47ddaaf..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/dialyzer_options +++ /dev/null @@ -1 +0,0 @@ -{dialyzer_options, [{indent_opt, false}, {warnings, [race_conditions]}]}. diff --git a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_args1 b/lib/dialyzer/test/race_SUITE_data/results/ets_insert_args1 deleted file mode 100644 index 452b623f948b..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_args1 +++ /dev/null @@ -1,2 +0,0 @@ - -ets_insert_args1.erl:9:16: The call ets:insert(T::'foo',[{'counter',number()},...]) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup(T::'foo','counter') call in ets_insert_args1.erl on line {8,28} diff --git a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_args10 b/lib/dialyzer/test/race_SUITE_data/results/ets_insert_args10 deleted file mode 100644 index cefface2f5a7..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_args10 +++ /dev/null @@ -1,2 +0,0 @@ - -ets_insert_args10.erl:9:16: The call ets:insert(T::'foo',[{'counter',number()},...]) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup(T::'foo','counter') call in ets_insert_args10.erl on line {8,28} diff --git a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_args2 b/lib/dialyzer/test/race_SUITE_data/results/ets_insert_args2 deleted file mode 100644 index 1a529812f956..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_args2 +++ /dev/null @@ -1,2 +0,0 @@ - -ets_insert_args2.erl:9:16: The call ets:insert(T::'foo',[{'counter',number()} | {'kostis',number()} | {'maria',number()},...]) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup(T::'foo','counter') call in ets_insert_args2.erl on line {8,27} diff --git a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_args3 b/lib/dialyzer/test/race_SUITE_data/results/ets_insert_args3 deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_args4 b/lib/dialyzer/test/race_SUITE_data/results/ets_insert_args4 deleted file mode 100644 index dd08666fe821..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_args4 +++ /dev/null @@ -1,2 +0,0 @@ - -ets_insert_args4.erl:9:16: The call ets:insert(T::'foo',{'counter',number()}) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup(T::'foo','counter') call in ets_insert_args4.erl on line {8,27} diff --git a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_args5 b/lib/dialyzer/test/race_SUITE_data/results/ets_insert_args5 deleted file mode 100644 index ec44a89f8f05..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_args5 +++ /dev/null @@ -1,2 +0,0 @@ - -ets_insert_args5.erl:9:16: The call ets:insert(T::'foo',{'counter',number(),number()}) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup(T::'foo','counter') call in ets_insert_args5.erl on line {8,27} diff --git a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_args6 b/lib/dialyzer/test/race_SUITE_data/results/ets_insert_args6 deleted file mode 100644 index b7d4131ff6a6..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_args6 +++ /dev/null @@ -1,2 +0,0 @@ - -ets_insert_args6.erl:9:16: The call ets:insert(T::'foo',[{'counter',number(),number()},...]) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup(T::'foo','counter') call in ets_insert_args6.erl on line {8,27} diff --git a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_args7 b/lib/dialyzer/test/race_SUITE_data/results/ets_insert_args7 deleted file mode 100644 index fc6ea504370a..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_args7 +++ /dev/null @@ -1,2 +0,0 @@ - -ets_insert_args7.erl:17:3: The call ets:insert(Table::'foo',[{'counter',number()},...]) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup(Tab::'foo','counter') call in ets_insert_args7.erl on line {13,16} diff --git a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_args8 b/lib/dialyzer/test/race_SUITE_data/results/ets_insert_args8 deleted file mode 100644 index f263c0eaafcd..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_args8 +++ /dev/null @@ -1,2 +0,0 @@ - -ets_insert_args8.erl:16:3: The call ets:insert(Table::atom(),[{'counter',number()},...]) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup(Tab::atom(),'counter') call in ets_insert_args8.erl on line {12,16} diff --git a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_control_flow1 b/lib/dialyzer/test/race_SUITE_data/results/ets_insert_control_flow1 deleted file mode 100644 index 38c507582e2c..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_control_flow1 +++ /dev/null @@ -1,2 +0,0 @@ - -ets_insert_control_flow1.erl:15:7: The call ets:insert('foo',{'random',integer()}) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup('foo','random') call in ets_insert_control_flow1.erl on line {10,41} diff --git a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_control_flow2 b/lib/dialyzer/test/race_SUITE_data/results/ets_insert_control_flow2 deleted file mode 100644 index 1ca874c4d8be..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_control_flow2 +++ /dev/null @@ -1,3 +0,0 @@ - -ets_insert_control_flow2.erl:15:7: The call ets:insert('foo',[{'pass',[pos_integer()]} | {'random',integer()},...]) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup('foo','random') call in ets_insert_control_flow2.erl on line {10,41} -ets_insert_control_flow2.erl:19:7: The call ets:insert('foo',[{'pass',[pos_integer()]} | {'random',integer()},...]) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup('foo','random') call in ets_insert_control_flow2.erl on line {10,41} diff --git a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_control_flow3 b/lib/dialyzer/test/race_SUITE_data/results/ets_insert_control_flow3 deleted file mode 100644 index ad011e918c83..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_control_flow3 +++ /dev/null @@ -1,3 +0,0 @@ - -ets_insert_control_flow3.erl:21:11: The call ets:insert(Table::atom() | ets:tid(),{'root',[pos_integer()]}) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup(Table::atom() | ets:tid(),'root') call in ets_insert_control_flow3.erl on line {12,15} -ets_insert_control_flow3.erl:23:11: The call ets:insert(Table::atom() | ets:tid(),{'user',[pos_integer()]}) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup(Table::atom() | ets:tid(),'user') call in ets_insert_control_flow3.erl on line {13,15} diff --git a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_control_flow4 b/lib/dialyzer/test/race_SUITE_data/results/ets_insert_control_flow4 deleted file mode 100644 index ad505c0ab81e..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_control_flow4 +++ /dev/null @@ -1,3 +0,0 @@ - -ets_insert_control_flow4.erl:21:11: The call ets:insert(Table::atom() | ets:tid(),{'pass',[pos_integer()]}) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup(Table::atom() | ets:tid(),'pass') call in ets_insert_control_flow4.erl on line {12,15}, the ets:lookup(Table::atom() | ets:tid(),'pass') call in ets_insert_control_flow4.erl on line {13,15} -ets_insert_control_flow4.erl:23:11: The call ets:insert(Table::atom() | ets:tid(),{'pass',[pos_integer()]}) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup(Table::atom() | ets:tid(),'pass') call in ets_insert_control_flow4.erl on line {12,15}, the ets:lookup(Table::atom() | ets:tid(),'pass') call in ets_insert_control_flow4.erl on line {13,15} diff --git a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_control_flow5 b/lib/dialyzer/test/race_SUITE_data/results/ets_insert_control_flow5 deleted file mode 100644 index f98aa27654bc..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_control_flow5 +++ /dev/null @@ -1,5 +0,0 @@ - -ets_insert_control_flow5.erl:22:11: The call ets:insert(Table::atom() | ets:tid(),{'welcome_msg',[any(),...]}) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup(Table::atom() | ets:tid(),'welcome_msg') call in ets_insert_control_flow5.erl on line {16,16} -ets_insert_control_flow5.erl:23:11: The call ets:insert(Table::atom() | ets:tid(),{'pass',[pos_integer()]}) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup(Table::atom() | ets:tid(),'pass') call in ets_insert_control_flow5.erl on line {12,15}, the ets:lookup(Table::atom() | ets:tid(),'pass') call in ets_insert_control_flow5.erl on line {13,15} -ets_insert_control_flow5.erl:25:11: The call ets:insert(Table::atom() | ets:tid(),{'welcome_msg',[any(),...]}) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup(Table::atom() | ets:tid(),'welcome_msg') call in ets_insert_control_flow5.erl on line {16,16} -ets_insert_control_flow5.erl:26:11: The call ets:insert(Table::atom() | ets:tid(),{'pass',[pos_integer()]}) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup(Table::atom() | ets:tid(),'pass') call in ets_insert_control_flow5.erl on line {12,15}, the ets:lookup(Table::atom() | ets:tid(),'pass') call in ets_insert_control_flow5.erl on line {13,15} diff --git a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_diff_atoms_race1 b/lib/dialyzer/test/race_SUITE_data/results/ets_insert_diff_atoms_race1 deleted file mode 100644 index 60e115ff1b8a..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_diff_atoms_race1 +++ /dev/null @@ -1,2 +0,0 @@ - -ets_insert_diff_atoms_race1.erl:22:3: The call ets:insert(Table::'bar' | 'foo',[{'counter',number()},...]) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup(Tab::'foo','counter') call in ets_insert_diff_atoms_race1.erl on line {13,16} diff --git a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_diff_atoms_race2 b/lib/dialyzer/test/race_SUITE_data/results/ets_insert_diff_atoms_race2 deleted file mode 100644 index 0e6546685c4e..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_diff_atoms_race2 +++ /dev/null @@ -1,2 +0,0 @@ - -ets_insert_diff_atoms_race2.erl:22:3: The call ets:insert(Table::'bar' | 'foo',[{'counter',number()},...]) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup(Tab::'foo',Counter::'counter') call in ets_insert_diff_atoms_race2.erl on line {13,16} diff --git a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_diff_atoms_race3 b/lib/dialyzer/test/race_SUITE_data/results/ets_insert_diff_atoms_race3 deleted file mode 100644 index 9a0e7dc936e8..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_diff_atoms_race3 +++ /dev/null @@ -1,2 +0,0 @@ - -ets_insert_diff_atoms_race3.erl:22:3: The call ets:insert(Table::'bar' | 'foo',{'counter',number()}) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup(Tab::'foo','counter') call in ets_insert_diff_atoms_race3.erl on line {13,16} diff --git a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_diff_atoms_race4 b/lib/dialyzer/test/race_SUITE_data/results/ets_insert_diff_atoms_race4 deleted file mode 100644 index cc17f482ad8a..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_diff_atoms_race4 +++ /dev/null @@ -1,2 +0,0 @@ - -ets_insert_diff_atoms_race4.erl:22:3: The call ets:insert(Table::'bar' | 'foo',{'counter',number()}) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup(Tab::'foo',Counter::'counter') call in ets_insert_diff_atoms_race4.erl on line {13,16} diff --git a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_diff_atoms_race5 b/lib/dialyzer/test/race_SUITE_data/results/ets_insert_diff_atoms_race5 deleted file mode 100644 index c6df36c0e27a..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_diff_atoms_race5 +++ /dev/null @@ -1,2 +0,0 @@ - -ets_insert_diff_atoms_race5.erl:22:3: The call ets:insert(Table::'foo',[{'counter',number()} | {'index',number()},...]) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup(Tab::'foo',Counter::'counter') call in ets_insert_diff_atoms_race5.erl on line {13,16} diff --git a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_diff_atoms_race6 b/lib/dialyzer/test/race_SUITE_data/results/ets_insert_diff_atoms_race6 deleted file mode 100644 index 21e5cdf8f32b..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_diff_atoms_race6 +++ /dev/null @@ -1,2 +0,0 @@ - -ets_insert_diff_atoms_race6.erl:22:3: The call ets:insert(Table::'foo',{'counter',number()} | {'index',number()}) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup(Tab::'foo',Counter::'counter') call in ets_insert_diff_atoms_race6.erl on line {13,16} diff --git a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_double1 b/lib/dialyzer/test/race_SUITE_data/results/ets_insert_double1 deleted file mode 100644 index 5de9983e9e0f..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_double1 +++ /dev/null @@ -1,4 +0,0 @@ - -ets_insert_double1.erl:15:7: The call ets:insert('foo',[{'pass',[number()]} | {'random',integer()},...]) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup('foo','random') call in ets_insert_double1.erl on line {10,41}, the ets:lookup('foo','pass') call in ets_insert_double1.erl on line {27,14} -ets_insert_double1.erl:19:7: The call ets:insert('foo',[{'pass',[number()]} | {'random',integer()},...]) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup('foo','random') call in ets_insert_double1.erl on line {10,41}, the ets:lookup('foo','pass') call in ets_insert_double1.erl on line {27,14} -ets_insert_double1.erl:24:3: The call ets:insert('foo',{'pass', 'empty'}) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup('foo','pass') call in ets_insert_double1.erl on line {22,16} diff --git a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_double2 b/lib/dialyzer/test/race_SUITE_data/results/ets_insert_double2 deleted file mode 100644 index 532550efb74c..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_double2 +++ /dev/null @@ -1,4 +0,0 @@ - -ets_insert_double2.erl:15:7: The call ets:insert('foo',[{_,[number()] | integer()},...]) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup('foo',Random::any()) call in ets_insert_double2.erl on line {10,41}, the ets:lookup('foo',Pass::any()) call in ets_insert_double2.erl on line {27,14} -ets_insert_double2.erl:19:7: The call ets:insert('foo',[{_,[number()] | integer()},...]) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup('foo',Random::any()) call in ets_insert_double2.erl on line {10,41}, the ets:lookup('foo',Pass::any()) call in ets_insert_double2.erl on line {27,14} -ets_insert_double2.erl:24:3: The call ets:insert('foo',{_,'empty'}) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup('foo',Pass::any()) call in ets_insert_double2.erl on line {22,16} diff --git a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_funs1 b/lib/dialyzer/test/race_SUITE_data/results/ets_insert_funs1 deleted file mode 100644 index 646921b7ab17..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_funs1 +++ /dev/null @@ -1,2 +0,0 @@ - -ets_insert_funs1.erl:15:3: The call ets:insert('foo',[{'counter',number()},...]) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup(T::'foo','counter') call in ets_insert_funs1.erl on line {9,9} diff --git a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_funs2 b/lib/dialyzer/test/race_SUITE_data/results/ets_insert_funs2 deleted file mode 100644 index 1cb3e3a99624..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_funs2 +++ /dev/null @@ -1,2 +0,0 @@ - -ets_insert_funs2.erl:9:9: The call ets:insert(T::'foo',[{'counter',number()},...]) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup('foo','counter') call in ets_insert_funs2.erl on line {14,14} diff --git a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_new b/lib/dialyzer/test/race_SUITE_data/results/ets_insert_new deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_param b/lib/dialyzer/test/race_SUITE_data/results/ets_insert_param deleted file mode 100644 index 29b20f3386b1..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_param +++ /dev/null @@ -1,5 +0,0 @@ - -ets_insert_param.erl:13:7: The call ets:insert(Table::atom() | ets:tid(),{'welcome_msg',[any(),...]}) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup(Table::atom() | ets:tid(),'welcome_msg') call in ets_insert_param.erl on line {10,16} -ets_insert_param.erl:14:7: The call ets:insert(Table::atom() | ets:tid(),{'pass',[pos_integer()]}) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup(Table::atom() | ets:tid(),'pass') call in ets_insert_param.erl on line {14,57}, the ets:lookup(Table::atom() | ets:tid(),'pass') call in ets_insert_param.erl on line {15,67} -ets_insert_param.erl:17:7: The call ets:insert(Table::atom() | ets:tid(),{'welcome_msg',[any(),...]}) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup(Table::atom() | ets:tid(),'welcome_msg') call in ets_insert_param.erl on line {10,16} -ets_insert_param.erl:18:7: The call ets:insert(Table::atom() | ets:tid(),{'pass',[pos_integer()]}) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup(Table::atom() | ets:tid(),'pass') call in ets_insert_param.erl on line {18,57} diff --git a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_public b/lib/dialyzer/test/race_SUITE_data/results/ets_insert_public deleted file mode 100644 index 27ce4b181a54..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_public +++ /dev/null @@ -1,2 +0,0 @@ - -ets_insert_public.erl:14:5: The call ets:insert(Foo::atom(),{'counter',number()}) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup(Foo::atom(),'counter') call in ets_insert_public.erl on line {12,16} diff --git a/lib/dialyzer/test/race_SUITE_data/results/extract_translations b/lib/dialyzer/test/race_SUITE_data/results/extract_translations deleted file mode 100644 index 8804c0b9ee36..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/extract_translations +++ /dev/null @@ -1,5 +0,0 @@ - -extract_translations.erl:140:7: The call ets:insert('files',{atom() | [atom() | [any()] | char()]}) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup('files',File::atom() | [atom() | [any()] | char()]) call in extract_translations.erl on line {135,11} -extract_translations.erl:146:6: The call ets:insert('translations',{_,[]}) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup('translations',Str::any()) call in extract_translations.erl on line {126,11} -extract_translations.erl:152:7: The call ets:insert('files',{atom() | [atom() | [any()] | char()]}) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup('files',File::atom() | [atom() | [any()] | char()]) call in extract_translations.erl on line {148,11} -extract_translations.erl:154:6: The call ets:insert('translations',{_,[]}) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup('translations',Str::any()) call in extract_translations.erl on line {126,11} diff --git a/lib/dialyzer/test/race_SUITE_data/results/mnesia_diff_atoms_race1 b/lib/dialyzer/test/race_SUITE_data/results/mnesia_diff_atoms_race1 deleted file mode 100644 index d7886f3b6857..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/mnesia_diff_atoms_race1 +++ /dev/null @@ -1,2 +0,0 @@ - -mnesia_diff_atoms_race1.erl:33:3: The call mnesia:dirty_write(Table::'employee' | 'employer',Record::#employee{salary::number()}) might have an unintended effect due to a possible race condition caused by its combination with the mnesia:dirty_read(Tab::'employee',Eno::any()) call in mnesia_diff_atoms_race1.erl on line {19,11} diff --git a/lib/dialyzer/test/race_SUITE_data/results/mnesia_diff_atoms_race2 b/lib/dialyzer/test/race_SUITE_data/results/mnesia_diff_atoms_race2 deleted file mode 100644 index 51906dd5483b..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/mnesia_diff_atoms_race2 +++ /dev/null @@ -1,2 +0,0 @@ - -mnesia_diff_atoms_race2.erl:37:3: The call mnesia:dirty_write(Record::#employee{salary::number()} | #employer{}) might have an unintended effect due to a possible race condition caused by its combination with the mnesia:dirty_read(Tab::'employee',Eno::any()) call in mnesia_diff_atoms_race2.erl on line {26,11} diff --git a/lib/dialyzer/test/race_SUITE_data/results/mnesia_dirty_read_one_write_two b/lib/dialyzer/test/race_SUITE_data/results/mnesia_dirty_read_one_write_two deleted file mode 100644 index 3ac7ed1f04bc..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/mnesia_dirty_read_one_write_two +++ /dev/null @@ -1,2 +0,0 @@ - -mnesia_dirty_read_one_write_two.erl:20:5: The call mnesia:dirty_write('employee',New::#employee{salary::number()}) might have an unintended effect due to a possible race condition caused by its combination with the mnesia:dirty_read({'employee',_}) call in mnesia_dirty_read_one_write_two.erl on line {17,11} diff --git a/lib/dialyzer/test/race_SUITE_data/results/mnesia_dirty_read_two_write_one b/lib/dialyzer/test/race_SUITE_data/results/mnesia_dirty_read_two_write_one deleted file mode 100644 index 231e62c2c287..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/mnesia_dirty_read_two_write_one +++ /dev/null @@ -1,2 +0,0 @@ - -mnesia_dirty_read_two_write_one.erl:20:5: The call mnesia:dirty_write(New::#employee{salary::number()}) might have an unintended effect due to a possible race condition caused by its combination with the mnesia:dirty_read('employee',Eno::any()) call in mnesia_dirty_read_two_write_one.erl on line {17,11} diff --git a/lib/dialyzer/test/race_SUITE_data/results/mnesia_dirty_read_write_double1 b/lib/dialyzer/test/race_SUITE_data/results/mnesia_dirty_read_write_double1 deleted file mode 100644 index 1e2c4e379fcd..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/mnesia_dirty_read_write_double1 +++ /dev/null @@ -1,2 +0,0 @@ - -mnesia_dirty_read_write_double1.erl:20:5: The call mnesia:dirty_write('employee',New::#employee{salary::number()}) might have an unintended effect due to a possible race condition caused by its combination with the mnesia:dirty_read('employee',Eno::any()) call in mnesia_dirty_read_write_double1.erl on line {17,11} diff --git a/lib/dialyzer/test/race_SUITE_data/results/mnesia_dirty_read_write_double2 b/lib/dialyzer/test/race_SUITE_data/results/mnesia_dirty_read_write_double2 deleted file mode 100644 index 3d28f32dc96c..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/mnesia_dirty_read_write_double2 +++ /dev/null @@ -1,2 +0,0 @@ - -mnesia_dirty_read_write_double2.erl:20:5: The call mnesia:dirty_write(New::#employee{salary::number()}) might have an unintended effect due to a possible race condition caused by its combination with the mnesia:dirty_read({'employee',_}) call in mnesia_dirty_read_write_double2.erl on line {17,11} diff --git a/lib/dialyzer/test/race_SUITE_data/results/mnesia_dirty_read_write_double3 b/lib/dialyzer/test/race_SUITE_data/results/mnesia_dirty_read_write_double3 deleted file mode 100644 index 5b461291574b..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/mnesia_dirty_read_write_double3 +++ /dev/null @@ -1,2 +0,0 @@ - -mnesia_dirty_read_write_double3.erl:20:5: The call mnesia:dirty_write('employee',New::#employee{salary::number()}) might have an unintended effect due to a possible race condition caused by its combination with the mnesia:dirty_read({'employee',_}) call in mnesia_dirty_read_write_double3.erl on line {17,11} diff --git a/lib/dialyzer/test/race_SUITE_data/results/mnesia_dirty_read_write_double4 b/lib/dialyzer/test/race_SUITE_data/results/mnesia_dirty_read_write_double4 deleted file mode 100644 index 895faa4cad15..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/mnesia_dirty_read_write_double4 +++ /dev/null @@ -1,2 +0,0 @@ - -mnesia_dirty_read_write_double4.erl:20:5: The call mnesia:dirty_write(New::#employee{salary::number()}) might have an unintended effect due to a possible race condition caused by its combination with the mnesia:dirty_read('employee',Eno::any()) call in mnesia_dirty_read_write_double4.erl on line {17,11} diff --git a/lib/dialyzer/test/race_SUITE_data/results/mnesia_dirty_read_write_one b/lib/dialyzer/test/race_SUITE_data/results/mnesia_dirty_read_write_one deleted file mode 100644 index d88e501f9ce0..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/mnesia_dirty_read_write_one +++ /dev/null @@ -1,2 +0,0 @@ - -mnesia_dirty_read_write_one.erl:20:5: The call mnesia:dirty_write(New::#employee{salary::number()}) might have an unintended effect due to a possible race condition caused by its combination with the mnesia:dirty_read({'employee',_}) call in mnesia_dirty_read_write_one.erl on line {17,11} diff --git a/lib/dialyzer/test/race_SUITE_data/results/mnesia_dirty_read_write_two b/lib/dialyzer/test/race_SUITE_data/results/mnesia_dirty_read_write_two deleted file mode 100644 index 4ff8c0d9c4e0..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/mnesia_dirty_read_write_two +++ /dev/null @@ -1,2 +0,0 @@ - -mnesia_dirty_read_write_two.erl:20:5: The call mnesia:dirty_write('employee',New::#employee{salary::number()}) might have an unintended effect due to a possible race condition caused by its combination with the mnesia:dirty_read('employee',Eno::any()) call in mnesia_dirty_read_write_two.erl on line {17,11} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_control_flow1 b/lib/dialyzer/test/race_SUITE_data/results/whereis_control_flow1 deleted file mode 100644 index c62a764338a0..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_control_flow1 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_control_flow1.erl:13:18: The call erlang:register(AnAtom::atom(),Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_control_flow1.erl on line {8,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_control_flow2 b/lib/dialyzer/test/race_SUITE_data/results/whereis_control_flow2 deleted file mode 100644 index 1fc47a7218e8..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_control_flow2 +++ /dev/null @@ -1,3 +0,0 @@ - -whereis_control_flow2.erl:14:4: The call erlang:register(AnAtom::atom(),Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_control_flow2.erl on line {8,8} -whereis_control_flow2.erl:15:18: The call erlang:register(AnAtom::atom(),Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_control_flow2.erl on line {8,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_control_flow3 b/lib/dialyzer/test/race_SUITE_data/results/whereis_control_flow3 deleted file mode 100644 index f04acc840e27..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_control_flow3 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_control_flow3.erl:25:3: The call erlang:register(AnAtom::atom(),Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_control_flow3.erl on line {11,14}, the erlang:whereis(AnAtom::any()) call in whereis_control_flow3.erl on line {18,14} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_control_flow4 b/lib/dialyzer/test/race_SUITE_data/results/whereis_control_flow4 deleted file mode 100644 index 76b60a0db809..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_control_flow4 +++ /dev/null @@ -1,3 +0,0 @@ - -whereis_control_flow4.erl:18:19: The call erlang:register('maria',Pid1::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis('maria') call in whereis_control_flow4.erl on line {8,8} -whereis_control_flow4.erl:19:19: The call erlang:register('kostis',Pid2::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis('kostis') call in whereis_control_flow4.erl on line {13,16} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_control_flow5 b/lib/dialyzer/test/race_SUITE_data/results/whereis_control_flow5 deleted file mode 100644 index 0a445d4f1067..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_control_flow5 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_control_flow5.erl:11:7: The call erlang:unregister(AnAtom::atom()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_control_flow5.erl on line {8,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_control_flow6 b/lib/dialyzer/test/race_SUITE_data/results/whereis_control_flow6 deleted file mode 100644 index 2b6726731f24..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_control_flow6 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_control_flow6.erl:11:7: The call erlang:unregister('kostis') might fail due to a possible race condition caused by its combination with the erlang:whereis('kostis') call in whereis_control_flow6.erl on line {8,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_atoms_no_race b/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_atoms_no_race deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_atoms_race b/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_atoms_race deleted file mode 100644 index 4b7272e203d3..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_atoms_race +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_diff_atoms_race.erl:34:3: The call erlang:register(Atom::'kostis' | 'maria',Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::'maria') call in whereis_diff_atoms_race.erl on line {14,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions1 b/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions1 deleted file mode 100644 index aac6a321cdaf..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions1 +++ /dev/null @@ -1,3 +0,0 @@ - -whereis_diff_functions1.erl:10:7: The call erlang:register('master',pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis('master') call in whereis_diff_functions1.erl on line {8,8} -whereis_diff_functions1.erl:18:7: The call erlang:register(AnAtom::atom(),Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_diff_functions1.erl on line {15,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions1_nested b/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions1_nested deleted file mode 100644 index 85a8546bc6b2..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions1_nested +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_diff_functions1_nested.erl:23:3: The call erlang:register(Atom::atom(),Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_diff_functions1_nested.erl on line {11,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions1_pathsens b/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions1_pathsens deleted file mode 100644 index c9c4fe7b488b..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions1_pathsens +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_diff_functions1_pathsens.erl:32:3: The call erlang:register(Atom::'kostis',Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::'kostis') call in whereis_diff_functions1_pathsens.erl on line {15,14}, the erlang:whereis(AnAtom::'kostis') call in whereis_diff_functions1_pathsens.erl on line {22,14} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions1_twice b/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions1_twice deleted file mode 100644 index f2338ed249ef..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions1_twice +++ /dev/null @@ -1,3 +0,0 @@ - -whereis_diff_functions1_twice.erl:27:3: The call erlang:register(Atom::atom(),Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_diff_functions1_twice.erl on line {11,8} -whereis_diff_functions1_twice.erl:30:3: The call erlang:register(Atom::atom(),Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::atom()) call in whereis_diff_functions1_twice.erl on line {15,12} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions2 b/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions2 deleted file mode 100644 index 005428286ed4..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions2 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_diff_functions2.erl:25:3: The call erlang:register(Atom::'kostis',Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::'kostis') call in whereis_diff_functions2.erl on line {13,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions2_nested b/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions2_nested deleted file mode 100644 index 54ea8e70fd90..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions2_nested +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_diff_functions2_nested.erl:20:3: The call erlang:register(Atom::atom(),Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_diff_functions2_nested.erl on line {8,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions2_pathsens b/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions2_pathsens deleted file mode 100644 index 3ec2234046c0..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions2_pathsens +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_diff_functions2_pathsens.erl:29:3: The call erlang:register(Atom::atom(),Pid::any()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_diff_functions2_pathsens.erl on line {12,14}, the erlang:whereis(AnAtom::any()) call in whereis_diff_functions2_pathsens.erl on line {19,14} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions2_twice b/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions2_twice deleted file mode 100644 index d14a25504047..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions2_twice +++ /dev/null @@ -1,3 +0,0 @@ - -whereis_diff_functions2_twice.erl:24:3: The call erlang:register(Atom::atom(),Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_diff_functions2_twice.erl on line {8,8} -whereis_diff_functions2_twice.erl:27:3: The call erlang:register(Atom::atom(),Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::atom()) call in whereis_diff_functions2_twice.erl on line {12,12} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions3 b/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions3 deleted file mode 100644 index 079ec9fb31e5..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions3 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_diff_functions3.erl:8:3: The call erlang:register(AnAtom::atom(),'undefined' | pid() | port()) might fail due to a possible race condition caused by its combination with the erlang:whereis(Atom::any()) call in whereis_diff_functions3.erl on line {11,3} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions3_nested b/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions3_nested deleted file mode 100644 index f1a47335855f..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions3_nested +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_diff_functions3_nested.erl:21:3: The call erlang:unregister(Atom::atom()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_diff_functions3_nested.erl on line {11,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions3_pathsens b/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions3_pathsens deleted file mode 100644 index 44e1ba6fbcb5..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions3_pathsens +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_diff_functions3_pathsens.erl:29:3: The call erlang:register(Atom::atom(),Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_diff_functions3_pathsens.erl on line {12,14}, the erlang:whereis(AnAtom::any()) call in whereis_diff_functions3_pathsens.erl on line {19,14} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions4 b/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions4 deleted file mode 100644 index 2f39e19a031c..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions4 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_diff_functions4.erl:32:3: The call erlang:register(Atom::atom(),Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_diff_functions4.erl on line {13,8}, the erlang:whereis(AnAtom::atom()) call in whereis_diff_functions4.erl on line {17,12} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions5 b/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions5 deleted file mode 100644 index 1e19cb26e747..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions5 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_diff_functions5.erl:22:3: The call erlang:register(Atom::atom(),Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_diff_functions5.erl on line {10,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions6 b/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions6 deleted file mode 100644 index 5c8a09340547..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_functions6 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_diff_functions6.erl:29:3: The call erlang:register(Atom::atom(),Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_diff_functions6.erl on line {10,8}, the erlang:whereis(AnAtom::atom()) call in whereis_diff_functions6.erl on line {14,12} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_modules1 b/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_modules1 deleted file mode 100644 index 6a28376c07dd..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_modules1 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_diff_modules2.erl:11:3: The call erlang:register(Atom::any(),Pid::any()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_diff_modules1.erl on line {10,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_modules1_pathsens b/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_modules1_pathsens deleted file mode 100644 index f287ade224ce..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_modules1_pathsens +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_diff_modules2_pathsens.erl:12:3: The call erlang:register(Atom::any(),Pid::any()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_diff_modules1_pathsens.erl on line {12,14}, the erlang:whereis(AnAtom::any()) call in whereis_diff_modules1_pathsens.erl on line {19,14} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_modules1_rec b/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_modules1_rec deleted file mode 100644 index 2d2033d172c2..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_modules1_rec +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_diff_modules1_rec.erl:10:10: The call erlang:register(AnAtom::any(),Id::any()) might fail due to a possible race condition caused by its combination with the erlang:whereis(NextAtom::any()) call in whereis_diff_modules1_rec.erl on line {12,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_modules2 b/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_modules2 deleted file mode 100644 index 3ae7f24bf7be..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_modules2 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_diff_modules3.erl:8:3: The call erlang:register(AnAtom::atom(),'undefined' | pid() | port()) might fail due to a possible race condition caused by its combination with the erlang:whereis(Atom::any()) call in whereis_diff_modules4.erl on line {11,3} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_modules2_pathsens b/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_modules2_pathsens deleted file mode 100644 index b3a9a2130ae2..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_modules2_pathsens +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_diff_modules4_pathsens.erl:13:3: The call erlang:register(Atom::atom(),Pid::any()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_diff_modules3_pathsens.erl on line {12,14}, the erlang:whereis(AnAtom::any()) call in whereis_diff_modules3_pathsens.erl on line {19,14} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_modules2_rec b/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_modules2_rec deleted file mode 100644 index bca2659836f4..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_modules2_rec +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_diff_modules3_rec.erl:13:10: The call erlang:register(AnAtom::any(),Id::any()) might fail due to a possible race condition caused by its combination with the erlang:whereis(NextAtom::any()) call in whereis_diff_modules3_rec.erl on line {15,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_modules3 b/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_modules3 deleted file mode 100644 index c8afd6603fba..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_modules3 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_diff_modules6.erl:11:3: The call erlang:register(Atom::any(),Pid::any()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_diff_modules5.erl on line {10,8}, the erlang:whereis(AnAtom::atom()) call in whereis_diff_modules5.erl on line {14,12} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_modules_nested b/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_modules_nested deleted file mode 100644 index b003518eb7ca..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_modules_nested +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_diff_modules3_nested.erl:11:3: The call erlang:register(Atom::any(),Pid::any()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_diff_modules1_nested.erl on line {8,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_modules_twice b/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_modules_twice deleted file mode 100644 index c8d414d76ce4..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_modules_twice +++ /dev/null @@ -1,3 +0,0 @@ - -whereis_diff_modules2_twice.erl:11:3: The call erlang:register(Atom::any(),Pid::any()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::atom()) call in whereis_diff_modules1_twice.erl on line {12,12} -whereis_diff_modules2_twice.erl:8:3: The call erlang:register(Atom::any(),Pid::any()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_diff_modules1_twice.erl on line {8,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_vars_no_race b/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_vars_no_race deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_vars_race b/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_vars_race deleted file mode 100644 index 4309c8370cea..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_diff_vars_race +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_diff_vars_race.erl:16:7: The call erlang:register(Atom2::any(),Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(Atom1::any()) call in whereis_diff_vars_race.erl on line {13,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_intra_inter_module1 b/lib/dialyzer/test/race_SUITE_data/results/whereis_intra_inter_module1 deleted file mode 100644 index cf4393654f49..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_intra_inter_module1 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_intra_inter_module2.erl:11:3: The call erlang:register(Atom::any(),Pid::any()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_intra_inter_module1.erl on line {10,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_intra_inter_module2 b/lib/dialyzer/test/race_SUITE_data/results/whereis_intra_inter_module2 deleted file mode 100644 index 4ceffb2f1f11..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_intra_inter_module2 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_intra_inter_module4.erl:14:3: The call erlang:register(Atom::any(),Pid::any()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_intra_inter_module3.erl on line {10,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_intra_inter_module3 b/lib/dialyzer/test/race_SUITE_data/results/whereis_intra_inter_module3 deleted file mode 100644 index 9b5aa5c86771..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_intra_inter_module3 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_intra_inter_module6.erl:14:3: The call erlang:register(Atom::any(),Pid::any()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_intra_inter_module5.erl on line {10,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_intra_inter_module4 b/lib/dialyzer/test/race_SUITE_data/results/whereis_intra_inter_module4 deleted file mode 100644 index c42e9b967fc9..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_intra_inter_module4 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_intra_inter_module7.erl:8:3: The call erlang:register(AnAtom::atom(),pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_intra_inter_module8.erl on line {8,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_intra_inter_module5 b/lib/dialyzer/test/race_SUITE_data/results/whereis_intra_inter_module5 deleted file mode 100644 index 569d0f59761f..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_intra_inter_module5 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_intra_inter_module9.erl:8:3: The call erlang:register(AnAtom::atom(),pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_intra_inter_module10.erl on line {11,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_intra_inter_module6 b/lib/dialyzer/test/race_SUITE_data/results/whereis_intra_inter_module6 deleted file mode 100644 index cc848c493cb7..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_intra_inter_module6 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_intra_inter_module12.erl:14:3: The call erlang:register(Atom::any(),Pid::any()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_intra_inter_module11.erl on line {10,8}, the erlang:whereis(AnAtom::any()) call in whereis_intra_inter_module11.erl on line {21,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_intra_inter_module7 b/lib/dialyzer/test/race_SUITE_data/results/whereis_intra_inter_module7 deleted file mode 100644 index 5bb9fb794b57..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_intra_inter_module7 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_intra_inter_module14.erl:11:3: The call erlang:register(Atom::any(),Pid::any()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_intra_inter_module13.erl on line {10,8}, the erlang:whereis(AnAtom::any()) call in whereis_intra_inter_module14.erl on line {16,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_intra_inter_module8 b/lib/dialyzer/test/race_SUITE_data/results/whereis_intra_inter_module8 deleted file mode 100644 index 6973b7422cba..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_intra_inter_module8 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_intra_inter_module16.erl:11:3: The call erlang:register(Atom::any(),Pid::any()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_intra_inter_module15.erl on line {10,8}, the erlang:whereis(AnAtom::any()) call in whereis_intra_inter_module16.erl on line {16,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_param b/lib/dialyzer/test/race_SUITE_data/results/whereis_param deleted file mode 100644 index f6735807c199..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_param +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_param.erl:8:3: The call erlang:register(AnAtom::atom(),pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_param.erl on line {11,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_param_inter_module b/lib/dialyzer/test/race_SUITE_data/results/whereis_param_inter_module deleted file mode 100644 index 97c9d2778993..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_param_inter_module +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_param_inter_module1.erl:8:3: The call erlang:register(AnAtom::atom(),pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_param_inter_module2.erl on line {8,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_rec_function1 b/lib/dialyzer/test/race_SUITE_data/results/whereis_rec_function1 deleted file mode 100644 index 66248649a031..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_rec_function1 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_rec_function1.erl:14:4: The call erlang:register(AnAtom::atom(),Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_rec_function1.erl on line {8,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_rec_function2 b/lib/dialyzer/test/race_SUITE_data/results/whereis_rec_function2 deleted file mode 100644 index 83298a5c3c99..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_rec_function2 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_rec_function2.erl:13:10: The call erlang:register(AnAtom::atom(),Id::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(NextAtom::any()) call in whereis_rec_function2.erl on line {15,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_rec_function3 b/lib/dialyzer/test/race_SUITE_data/results/whereis_rec_function3 deleted file mode 100644 index 7b004aeb1260..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_rec_function3 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_rec_function3.erl:13:10: The call erlang:register(AnAtom::atom(),Id::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(NextAtom::any()) call in whereis_rec_function3.erl on line {16,10}, the erlang:whereis(NextAtom::atom()) call in whereis_rec_function3.erl on line {20,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_rec_function4 b/lib/dialyzer/test/race_SUITE_data/results/whereis_rec_function4 deleted file mode 100644 index b2885774baf6..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_rec_function4 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_rec_function4.erl:13:10: The call erlang:register(AnAtom::atom(),Id::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(NextAtom::any()) call in whereis_rec_function4.erl on line {15,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_rec_function5 b/lib/dialyzer/test/race_SUITE_data/results/whereis_rec_function5 deleted file mode 100644 index d5e9c4328a60..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_rec_function5 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_rec_function5.erl:10:10: The call erlang:register(AnAtom::any(),Id::any()) might fail due to a possible race condition caused by its combination with the erlang:whereis(NextAtom::any()) call in whereis_rec_function5.erl on line {12,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_rec_function6 b/lib/dialyzer/test/race_SUITE_data/results/whereis_rec_function6 deleted file mode 100644 index c4c7c55b0207..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_rec_function6 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_rec_function6.erl:10:10: The call erlang:register(AnAtom::any(),Id::any()) might fail due to a possible race condition caused by its combination with the erlang:whereis(NextAtom::any()) call in whereis_rec_function6.erl on line {12,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_rec_function7 b/lib/dialyzer/test/race_SUITE_data/results/whereis_rec_function7 deleted file mode 100644 index 0a0b07bcc069..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_rec_function7 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_rec_function7.erl:15:4: The call erlang:register(AnAtom::atom(),Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_rec_function7.erl on line {8,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_rec_function8 b/lib/dialyzer/test/race_SUITE_data/results/whereis_rec_function8 deleted file mode 100644 index db37842e6bf9..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_rec_function8 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_rec_function8.erl:18:4: The call erlang:register(AnAtom::atom(),Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_rec_function8.erl on line {11,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_try_catch b/lib/dialyzer/test/race_SUITE_data/results/whereis_try_catch deleted file mode 100644 index 3cf78cf0d2ce..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_try_catch +++ /dev/null @@ -1,3 +0,0 @@ - -whereis_try_catch.erl:13:14: The call erlang:register('master',Pid::any()) might fail due to a possible race condition caused by its combination with the erlang:whereis('master') call in whereis_try_catch.erl on line {8,8} -whereis_try_catch.erl:21:9: The call erlang:register('master',Pid::any()) might fail due to a possible race condition caused by its combination with the erlang:whereis('master') call in whereis_try_catch.erl on line {18,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars1 b/lib/dialyzer/test/race_SUITE_data/results/whereis_vars1 deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars10 b/lib/dialyzer/test/race_SUITE_data/results/whereis_vars10 deleted file mode 100644 index 37c060def40e..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars10 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_vars10.erl:17:22: The call erlang:register(OtherAtom::'kostis',Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_vars10.erl on line {8,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars11 b/lib/dialyzer/test/race_SUITE_data/results/whereis_vars11 deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars12 b/lib/dialyzer/test/race_SUITE_data/results/whereis_vars12 deleted file mode 100644 index bc19f7a756da..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars12 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_vars12.erl:16:37: The call erlang:register(OtherAtom::'kostis',Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_vars12.erl on line {8,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars13 b/lib/dialyzer/test/race_SUITE_data/results/whereis_vars13 deleted file mode 100644 index 864231d6b4ec..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars13 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_vars13.erl:16:52: The call erlang:register(OtherAtom::'kostis',APid::any()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_vars13.erl on line {8,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars14 b/lib/dialyzer/test/race_SUITE_data/results/whereis_vars14 deleted file mode 100644 index 4aaf586141cc..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars14 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_vars14.erl:16:52: The call erlang:register(OtherAtom::'kostis',APid::any()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_vars14.erl on line {8,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars15 b/lib/dialyzer/test/race_SUITE_data/results/whereis_vars15 deleted file mode 100644 index 2042e119ca5a..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars15 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_vars15.erl:17:15: The call erlang:register(OtherAtom::'kostis',Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_vars15.erl on line {8,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars16 b/lib/dialyzer/test/race_SUITE_data/results/whereis_vars16 deleted file mode 100644 index 89f5b963a8bf..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars16 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_vars16.erl:17:15: The call erlang:register(OtherAtom::any(),APid::any()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_vars16.erl on line {8,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars17 b/lib/dialyzer/test/race_SUITE_data/results/whereis_vars17 deleted file mode 100644 index 1f94cfef0e57..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars17 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_vars17.erl:17:15: The call erlang:register(OtherAtom::any(),APid::any()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_vars17.erl on line {8,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars18 b/lib/dialyzer/test/race_SUITE_data/results/whereis_vars18 deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars19 b/lib/dialyzer/test/race_SUITE_data/results/whereis_vars19 deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars2 b/lib/dialyzer/test/race_SUITE_data/results/whereis_vars2 deleted file mode 100644 index 6aa57fcdc52b..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars2 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_vars2.erl:14:18: The call erlang:register(OtherAtom::atom(),Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_vars2.erl on line {8,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars20 b/lib/dialyzer/test/race_SUITE_data/results/whereis_vars20 deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars21 b/lib/dialyzer/test/race_SUITE_data/results/whereis_vars21 deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars22 b/lib/dialyzer/test/race_SUITE_data/results/whereis_vars22 deleted file mode 100644 index 613d788e5921..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars22 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_vars22.erl:21:21: The call erlang:register(OtherAtom::'kostis',Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_vars22.erl on line {8,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars3 b/lib/dialyzer/test/race_SUITE_data/results/whereis_vars3 deleted file mode 100644 index 74ab067e56aa..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars3 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_vars3.erl:14:18: The call erlang:register(OtherAtom::atom(),APid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_vars3.erl on line {8,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars4 b/lib/dialyzer/test/race_SUITE_data/results/whereis_vars4 deleted file mode 100644 index 0584b03a8d69..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars4 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_vars4.erl:14:18: The call erlang:register(OtherAtom::atom() | pid(),APid::atom() | pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_vars4.erl on line {8,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars5 b/lib/dialyzer/test/race_SUITE_data/results/whereis_vars5 deleted file mode 100644 index 0482d312150b..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars5 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_vars5.erl:16:26: The call erlang:register(OtherAtom::'kostis',Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_vars5.erl on line {8,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars6 b/lib/dialyzer/test/race_SUITE_data/results/whereis_vars6 deleted file mode 100644 index 6edcb8b756d4..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars6 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_vars6.erl:16:34: The call erlang:register(OtherAtom::'kostis',APid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_vars6.erl on line {8,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars7 b/lib/dialyzer/test/race_SUITE_data/results/whereis_vars7 deleted file mode 100644 index 23c1ef2942a3..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars7 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_vars7.erl:16:34: The call erlang:register(OtherAtom::'kostis',APid::atom() | pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_vars7.erl on line {8,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars8 b/lib/dialyzer/test/race_SUITE_data/results/whereis_vars8 deleted file mode 100644 index 59019c74c06f..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars8 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_vars8.erl:16:21: The call erlang:register(OtherAtom::'kostis',Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_vars8.erl on line {8,8} diff --git a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars9 b/lib/dialyzer/test/race_SUITE_data/results/whereis_vars9 deleted file mode 100644 index 89fba5786383..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/results/whereis_vars9 +++ /dev/null @@ -1,2 +0,0 @@ - -whereis_vars9.erl:16:21: The call erlang:register(OtherAtom::'kostis',Pid::pid()) might fail due to a possible race condition caused by its combination with the erlang:whereis(AnAtom::any()) call in whereis_vars9.erl on line {8,8} diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args1.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args1.erl deleted file mode 100644 index 0039195e0a46..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args1.erl +++ /dev/null @@ -1,17 +0,0 @@ -%% This tests the presence of possible races due to an ets:lookup/ets:insert -%% combination. It takes into account the argument types of the calls. - --module(ets_insert_args1). --export([start/0]). - -start() -> - F = fun(T) -> [{_, N}] = ets:lookup(T, counter), - ets:insert(T, [{counter, N+1}]) - end, - io:format("Created ~w\n", [ets:new(foo, [named_table, public])]), - ets:insert(foo, {counter, 0}), - io:format("Inserted ~w\n", [{counter, 0}]), - F(foo), - io:format("Update complete\n", []), - ObjectList = ets:lookup(foo, counter), - io:format("Counter: ~w\n", [ObjectList]). diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args10.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args10.erl deleted file mode 100644 index c897a34af0da..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args10.erl +++ /dev/null @@ -1,19 +0,0 @@ -%% This tests the presence of possible races due to an ets:lookup/ets:insert -%% combination. It takes into account the argument types of the calls. - --module(ets_insert_args10). --export([start/0]). - -start() -> - F = fun(T) -> [{_, N}] = ets:lookup(T, counter), - ets:insert(T, [{counter, N+1}]) - end, - io:format("Created ~w\n", [ets:new(foo, [named_table, public])]), - A = {counter, 0}, - B = [], - ets:insert(foo, [A|B]), - io:format("Inserted ~w\n", [{counter, 0}]), - F(foo), - io:format("Update complete\n", []), - ObjectList = ets:lookup(foo, counter), - io:format("Counter: ~w\n", [ObjectList]). diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args1_suppressed.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args1_suppressed.erl deleted file mode 100644 index 5134cc6f0b46..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args1_suppressed.erl +++ /dev/null @@ -1,19 +0,0 @@ -%% This tests the presence of possible races due to an ets:lookup/ets:insert -%% combination. It takes into account the argument types of the calls. - --module(ets_insert_args1_suppressed). --export([start/0]). - --dialyzer({nowarn_function,start/0}). - -start() -> - F = fun(T) -> [{_, N}] = ets:lookup(T, counter), - ets:insert(T, [{counter, N+1}]) - end, - io:format("Created ~w\n", [ets:new(foo, [named_table, public])]), - ets:insert(foo, {counter, 0}), - io:format("Inserted ~w\n", [{counter, 0}]), - F(foo), - io:format("Update complete\n", []), - ObjectList = ets:lookup(foo, counter), - io:format("Counter: ~w\n", [ObjectList]). diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args2.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args2.erl deleted file mode 100644 index c1857eb58bdb..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args2.erl +++ /dev/null @@ -1,17 +0,0 @@ -%% This tests the presence of possible races due to an ets:lookup/ets:insert -%% combination. It takes into account the argument types of the calls. - --module(ets_insert_args2). --export([start/0]). - -start() -> - F = fun(T)-> [{_, N}] = ets:lookup(T, counter), - ets:insert(T, [{counter, N+1}, {maria, N+1}, {kostis, N+1}]) - end, - io:format("Created ~w\n", [ets:new(foo, [named_table, public])]), - ets:insert(foo, {counter, 0}), - io:format("Inserted ~w\n", [{counter, 0}]), - F(foo), - io:format("Update complete\n", []), - ObjectList = ets:lookup(foo, counter), - io:format("Counter: ~w\n", [ObjectList]). diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args3.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args3.erl deleted file mode 100644 index 74401b76fd93..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args3.erl +++ /dev/null @@ -1,17 +0,0 @@ -%% This tests the presence of possible races due to an ets:lookup/ets:insert -%% combination. It takes into account the argument types of the calls. - --module(ets_insert_args3). --export([start/0]). - -start() -> - F = fun(T)-> [{_, N}] = ets:lookup(T, counter), - ets:insert(T, [{maria, N+1}, {kostis, N+1}]) - end, - io:format("Created ~w\n", [ets:new(foo, [named_table, public])]), - ets:insert(foo, {counter, 0}), - io:format("Inserted ~w\n", [{counter, 0}]), - F(foo), - io:format("Update complete\n", []), - ObjectList = ets:lookup(foo, counter), - io:format("Counter: ~w\n", [ObjectList]). diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args4.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args4.erl deleted file mode 100644 index 2c892074ec42..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args4.erl +++ /dev/null @@ -1,17 +0,0 @@ -%% This tests the presence of possible races due to an ets:lookup/ets:insert -%% combination. It takes into account the argument types of the calls. - --module(ets_insert_args4). --export([start/0]). - -start() -> - F = fun(T)-> [{_, N}] = ets:lookup(T, counter), - ets:insert(T, {counter, N+1}) - end, - io:format("Created ~w\n", [ets:new(foo, [named_table, public])]), - ets:insert(foo, {counter, 0}), - io:format("Inserted ~w\n", [{counter, 0}]), - F(foo), - io:format("Update complete\n", []), - ObjectList = ets:lookup(foo, counter), - io:format("Counter: ~w\n", [ObjectList]). diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args5.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args5.erl deleted file mode 100644 index 156f555a7ca5..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args5.erl +++ /dev/null @@ -1,17 +0,0 @@ -%% This tests the presence of possible races due to an ets:lookup/ets:insert -%% combination. It takes into account the argument types of the calls. - --module(ets_insert_args5). --export([start/0]). - -start() -> - F = fun(T)-> [{_, N}] = ets:lookup(T, counter), - ets:insert(T, {counter, N+1, N+2}) - end, - io:format("Created ~w\n", [ets:new(foo, [named_table, public])]), - ets:insert(foo, {counter, 0, 0}), - io:format("Inserted ~w\n", [{counter, 0, 0}]), - F(foo), - io:format("Update complete\n", []), - ObjectList = ets:lookup(foo, counter), - io:format("Counter: ~w\n", [ObjectList]). diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args6.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args6.erl deleted file mode 100644 index 1e5887f76d23..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args6.erl +++ /dev/null @@ -1,17 +0,0 @@ -%% This tests the presence of possible races due to an ets:lookup/ets:insert -%% combination. It takes into account the argument types of the calls. - --module(ets_insert_args6). --export([start/0]). - -start() -> - F = fun(T)-> [{_, N}] = ets:lookup(T, counter), - ets:insert(T, [{counter, N+1, N+2}]) - end, - io:format("Created ~w\n", [ets:new(foo, [named_table, public])]), - ets:insert(foo, {counter, 0, 0}), - io:format("Inserted ~w\n", [{counter, 0, 0}]), - F(foo), - io:format("Update complete\n", []), - ObjectList = ets:lookup(foo, counter), - io:format("Counter: ~w\n", [ObjectList]). diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args7.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args7.erl deleted file mode 100644 index 912bbf707340..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args7.erl +++ /dev/null @@ -1,17 +0,0 @@ -%% This tests the presence of possible races due to an ets:lookup/ets:insert -%% combination. It takes into account the argument types of the calls. - --module(ets_insert_args7). --export([test/0]). - -test() -> - Foo = foo, - ets:new(Foo, [named_table, public]), - race(Foo). - -race(Tab) -> - [{_, N}] = ets:lookup(Tab, counter), - aux(Tab, N). - -aux(Table, N) -> - ets:insert(Table, [{counter, N+1}]). diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args8.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args8.erl deleted file mode 100644 index 275cf0291c80..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args8.erl +++ /dev/null @@ -1,16 +0,0 @@ -%% This tests the presence of possible races due to an ets:lookup/ets:insert -%% combination. It takes into account the argument types of the calls. - --module(ets_insert_args8). --export([test/1]). - -test(Foo) -> - ets:new(Foo, [named_table, public]), - race(Foo). - -race(Tab) -> - [{_, N}] = ets:lookup(Tab, counter), - aux(Tab, N). - -aux(Table, N) -> - ets:insert(Table, [{counter, N+1}]). diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_control_flow1.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_control_flow1.erl deleted file mode 100644 index cfe0b2b7278c..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_control_flow1.erl +++ /dev/null @@ -1,20 +0,0 @@ -%% This tests the presence of possible races due to an ets:lookup/ets:insert -%% combination. It takes into account control flow that might exist. - --module(ets_insert_control_flow1). --export([start/0]). - -start() -> - io:format("Created ~w\n", [ets:new(foo, [named_table, public])]), - ets:insert(foo, {random, random:uniform(maria:get_int())}), - io:format("Inserted ~w\n", [{_, N}] = ets:lookup(foo, random)), - case (N rem 2 == 0) of - true -> - io:format("\nInserted an even number\n", []), - io:format("\nWill make it odd\n", []), - ets:insert(foo, {random, N+1}); - false -> ok - end, - io:format("Update complete\n", []), - ObjectList = ets:lookup(foo, random), - io:format("Random odd integer: ~w\n", [ObjectList]). diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_control_flow2.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_control_flow2.erl deleted file mode 100644 index d160418bdbd7..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_control_flow2.erl +++ /dev/null @@ -1,26 +0,0 @@ -%% This tests the presence of possible races due to an ets:lookup/ets:insert -%% combination. It takes into account control flow that might exist. - --module(ets_insert_control_flow2). --export([start/0]). - -start() -> - io:format("Created ~w\n", [ets:new(foo, [named_table, public])]), - ets:insert(foo, {random, random:uniform(150)}), - io:format("Inserted ~w\n", [{_, N}] = ets:lookup(foo, random)), - case (N rem 2 == 0) of - true -> - io:format("\nInserted an even integer\n", []), - io:format("\nWill make it odd and generate password\n", []), - ets:insert(foo, [{random, N+1}, {pass, generate_password(N)}]); - false -> - io:format("\nInserted an odd integer\n", []), - io:format("\nWill make it even and generate password\n", []), - ets:insert(foo, [{random, N+1}, {pass, generate_password(N)}]) - end, - io:format("Update complete\n", []), - ObjectList = ets:lookup(foo, pass), - io:format("New password: ~w\n", [ObjectList]). - -generate_password(N) -> - lists:map(fun (_) -> random:uniform(90)+$\s+1 end, lists:seq(1,N)). diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_control_flow3.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_control_flow3.erl deleted file mode 100644 index 9c6a22eb05cc..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_control_flow3.erl +++ /dev/null @@ -1,31 +0,0 @@ -%% This tests the presence of possible races due to an ets:lookup/ets:insert -%% combination. It takes into account control flow that might exist. - --module(ets_insert_control_flow3). --export([start/1]). - -start(User) -> - Table = ets:new(table, [public]), - mod:process(Table), - [{_, N}] = - case User of - root -> ets:lookup(Table, root); - user -> ets:lookup(Table, user); - Other -> [{undefined, -1}] - end, - case N of - -1 -> io:format("\nUnknown User\n", []); - 0 -> - case User of - root -> - ets:insert(Table, {User, Pass = generate_password(N) ++ generate_password(N+1)}); - user -> - ets:insert(Table, {User, Pass = generate_password(N)}) - end, - io:format("\nYour new pass is ~w\n", [Pass]); - P -> - io:format("\nYour pass is ~w\n", [P]) - end. - -generate_password(N) -> - lists:map(fun (_) -> random:uniform(90)+$\s+1 end, lists:seq(1,N)). diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_control_flow4.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_control_flow4.erl deleted file mode 100644 index caa38046145a..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_control_flow4.erl +++ /dev/null @@ -1,31 +0,0 @@ -%% This tests the presence of possible races due to an ets:lookup/ets:insert -%% combination. It takes into account control flow that might exist. - --module(ets_insert_control_flow4). --export([start/1]). - -start(User) -> - Table = ets:new(table, [public]), - mod:process(Table), - [{_, N}] = - case User of - root -> ets:lookup(Table, pass); - user -> ets:lookup(Table, pass); - _Other -> [{undefined, -1}] - end, - case N of - -1 -> io:format("\nUnknown User\n", []); - 0 -> - case User of - root -> - ets:insert(Table, {pass, Pass = generate_password(N) ++ generate_password(N+1)}); - user -> - ets:insert(Table, {pass, Pass = generate_password(N)}) - end, - io:format("\nYour new pass is ~w\n", [Pass]); - P -> - io:format("\nYour pass is ~w\n", [P]) - end. - -generate_password(N) -> - lists:map(fun (_) -> random:uniform(90)+$\s+1 end, lists:seq(1,N)). diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_control_flow5.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_control_flow5.erl deleted file mode 100644 index b19fd776ecbf..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_control_flow5.erl +++ /dev/null @@ -1,34 +0,0 @@ -%% This tests the presence of possible races due to an ets:lookup/ets:insert -%% combination. It takes into account control flow that might exist. - --module(ets_insert_control_flow5). --export([start/1]). - -start(User) -> - Table = ets:new(table, [public]), - mod:process(Table), - [{_, N}] = - case User of - root -> ets:lookup(Table, pass); - user -> ets:lookup(Table, pass); - Other -> [{undefined, -1}] - end, - [{_, Msg}] = ets:lookup(Table, welcome_msg), - case N of - -1 -> io:format("\nUnknown User\n", []); - 0 -> - case User of - root -> - ets:insert(Table, {welcome_msg, Msg ++ "root"}), - ets:insert(Table, {pass, Pass = generate_password(N) ++ generate_password(N+1)}); - user -> - ets:insert(Table, {welcome_msg, Msg ++ "user"}), - ets:insert(Table, {pass, Pass = generate_password(N)}) - end, - io:format("\nYour new pass is ~w\n", [Pass]); - P -> - io:format("\nYour pass is ~w\n", [P]) - end. - -generate_password(N) -> - lists:map(fun (_) -> random:uniform(90)+$\s+1 end, lists:seq(1,N)). diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_diff_atoms_race1.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_diff_atoms_race1.erl deleted file mode 100644 index 7b2dbb8eff95..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_diff_atoms_race1.erl +++ /dev/null @@ -1,22 +0,0 @@ -%% This tests that the race condition detection between ets:lookup/ -%% ets:insert is robust even when the functions are called with -%% different atoms as arguments. - --module(ets_insert_diff_atoms_race1). --export([test/0]). - -test() -> - ets:new(foo, [named_table, public]), - {race(foo), no_race(foo)}. - -race(Tab) -> - [{_, N}] = ets:lookup(Tab, counter), - aux(Tab, N). - -no_race(Tab) -> - [{_, N}] = ets:lookup(Tab, counter), - AnotherTab = bar, - aux(AnotherTab, N). - -aux(Table, N) -> - ets:insert(Table, [{counter, N+1}]). diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_diff_atoms_race2.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_diff_atoms_race2.erl deleted file mode 100644 index d7afc79d0706..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_diff_atoms_race2.erl +++ /dev/null @@ -1,22 +0,0 @@ -%% This tests that the race condition detection between ets:lookup/ -%% ets:insert is robust even when the functions are called with -%% different atoms as arguments. - --module(ets_insert_diff_atoms_race2). --export([test/0]). - -test() -> - ets:new(foo, [named_table, public]), - {race(foo, counter), no_race(foo, counter)}. - -race(Tab, Counter) -> - [{_, N}] = ets:lookup(Tab, Counter), - aux(Tab, Counter, N). - -no_race(Tab, Counter) -> - [{_, N}] = ets:lookup(Tab, Counter), - AnotherTab = bar, - aux(AnotherTab, Counter, N). - -aux(Table, Counter, N) -> - ets:insert(Table, [{Counter, N+1}]). diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_diff_atoms_race3.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_diff_atoms_race3.erl deleted file mode 100644 index e05e9be54b2e..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_diff_atoms_race3.erl +++ /dev/null @@ -1,22 +0,0 @@ -%% This tests that the race condition detection between ets:lookup/ -%% ets:insert is robust even when the functions are called with -%% different atoms as arguments. - --module(ets_insert_diff_atoms_race3). --export([test/0]). - -test() -> - ets:new(foo, [named_table, public]), - {race(foo), no_race(foo)}. - -race(Tab) -> - [{_, N}] = ets:lookup(Tab, counter), - aux(Tab, N). - -no_race(Tab) -> - [{_, N}] = ets:lookup(Tab, counter), - AnotherTab = bar, - aux(AnotherTab, N). - -aux(Table, N) -> - ets:insert(Table, {counter, N+1}). diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_diff_atoms_race4.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_diff_atoms_race4.erl deleted file mode 100644 index e2a3588f41fd..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_diff_atoms_race4.erl +++ /dev/null @@ -1,22 +0,0 @@ -%% This tests that the race condition detection between ets:lookup/ -%% ets:insert is robust even when the functions are called with -%% different atoms as arguments. - --module(ets_insert_diff_atoms_race4). --export([test/0]). - -test() -> - ets:new(foo, [named_table, public]), - {race(foo, counter), no_race(foo, counter)}. - -race(Tab, Counter) -> - [{_, N}] = ets:lookup(Tab, Counter), - aux(Tab, Counter, N). - -no_race(Tab, Counter) -> - [{_, N}] = ets:lookup(Tab, Counter), - AnotherTab = bar, - aux(AnotherTab, Counter, N). - -aux(Table, Counter, N) -> - ets:insert(Table, {Counter, N+1}). diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_diff_atoms_race5.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_diff_atoms_race5.erl deleted file mode 100644 index dd53387c11a0..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_diff_atoms_race5.erl +++ /dev/null @@ -1,22 +0,0 @@ -%% This tests that the race condition detection between ets:lookup/ -%% ets:insert is robust even when the functions are called with -%% different atoms as arguments. - --module(ets_insert_diff_atoms_race5). --export([test/0]). - -test() -> - ets:new(foo, [named_table, public]), - {race(foo, counter), no_race(foo, counter)}. - -race(Tab, Counter) -> - [{_, N}] = ets:lookup(Tab, Counter), - aux(Tab, Counter, N). - -no_race(Tab, Counter) -> - [{_, N}] = ets:lookup(Tab, Counter), - AnotherCounter = index, - aux(Tab, AnotherCounter, N). - -aux(Table, Counter, N) -> - ets:insert(Table, [{Counter, N+1}]). diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_diff_atoms_race6.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_diff_atoms_race6.erl deleted file mode 100644 index ec0a0eaadf9d..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_diff_atoms_race6.erl +++ /dev/null @@ -1,22 +0,0 @@ -%% This tests that the race condition detection between ets:lookup/ -%% ets:insert is robust even when the functions are called with -%% different atoms as arguments. - --module(ets_insert_diff_atoms_race6). --export([test/0]). - -test() -> - ets:new(foo, [named_table, public]), - {race(foo, counter), no_race(foo, counter)}. - -race(Tab, Counter) -> - [{_, N}] = ets:lookup(Tab, Counter), - aux(Tab, Counter, N). - -no_race(Tab, Counter) -> - [{_, N}] = ets:lookup(Tab, Counter), - AnotherCounter = index, - aux(Tab, AnotherCounter, N). - -aux(Table, Counter, N) -> - ets:insert(Table, {Counter, N+1}). diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_double1.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_double1.erl deleted file mode 100644 index d5b6689eb182..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_double1.erl +++ /dev/null @@ -1,28 +0,0 @@ -%% This tests the presence of possible races due to an ets:lookup/ets:insert -%% combination. It takes into account multiple ets:inserts that might exist. - --module(ets_insert_double1). --export([start/0]). - -start() -> - io:format("Created ~w\n", [ets:new(foo, [named_table, public])]), - ets:insert(foo, {random, random:uniform(150)}), - io:format("Inserted ~w\n", [{_, N}] = ets:lookup(foo, random)), - case (N rem 2 == 0) of - true -> - io:format("\nInserted an even integer\n", []), - io:format("\nWill make it odd and generate new password\n", []), - ets:insert(foo, [{random, N+1}, {pass, generate_password(N)}]); - false -> - io:format("\nInserted an odd integer\n", []), - io:format("\nWill make it even and generate new password\n", []), - ets:insert(foo, [{random, N+1}, {pass, generate_password(N)}]) - end, - io:format("Update complete\n", []), - ObjectList = ets:lookup(foo, pass), - io:format("New password: ~w\n", [ObjectList]), - ets:insert(foo, {pass, 'empty'}). - -generate_password(N) -> - [{_, P}] = ets:lookup(foo, pass), - lists:map(fun (_) -> random:uniform(90)+P+$\s+1 end, lists:seq(1,N)). diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_double2.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_double2.erl deleted file mode 100644 index fa653e3090f6..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_double2.erl +++ /dev/null @@ -1,28 +0,0 @@ -%% This tests the presence of possible races due to an ets:lookup/ets:insert -%% combination. It takes into account multiple ets:inserts that might exist. - --module(ets_insert_double2). --export([start/2]). - -start(Random, Pass) -> - io:format("Created ~w\n", [ets:new(foo, [named_table, public])]), - ets:insert(foo, {Random, random:uniform(150)}), - io:format("Inserted ~w\n", [{_, N}] = ets:lookup(foo, Random)), - case (N rem 2 == 0) of - true -> - io:format("\nInserted an even integer\n", []), - io:format("\nWill make it odd and generate new password\n", []), - ets:insert(foo, [{Random, N+1}, {Pass, generate_password(Pass, N)}]); - false -> - io:format("\nInserted an odd integer\n", []), - io:format("\nWill make it even and generate new password\n", []), - ets:insert(foo, [{Random, N+1}, {Pass, generate_password(Pass, N)}]) - end, - io:format("Update complete\n", []), - ObjectList = ets:lookup(foo, Pass), - io:format("New password: ~w\n", [ObjectList]), - ets:insert(foo, {Pass, 'empty'}). - -generate_password(Pass, N) -> - [{_, P}] = ets:lookup(foo, Pass), - lists:map(fun (_) -> random:uniform(90)+P+$\s+1 end, lists:seq(1,N)). diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_funs1.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_funs1.erl deleted file mode 100644 index b6b258fd219d..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_funs1.erl +++ /dev/null @@ -1,18 +0,0 @@ -%% This tests the presence of possible races due to an ets:lookup/ets:insert -%% combination. It takes into account the anonymous functions. - --module(ets_insert_funs1). --export([start/0]). - -start() -> - F = fun(T) -> - ets:lookup(T, counter) - end, - io:format("Created ~w\n", [ets:new(foo, [named_table, public])]), - ets:insert(foo, {counter, 0}), - io:format("Inserted ~w\n", [{counter, 0}]), - [{_, N}] = F(foo), - ets:insert(foo, [{counter, N+1}]), - io:format("Update complete\n", []), - ObjectList = ets:lookup(foo, counter), - io:format("Counter: ~w\n", [ObjectList]). diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_funs2.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_funs2.erl deleted file mode 100644 index 6b9518f31494..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_funs2.erl +++ /dev/null @@ -1,18 +0,0 @@ -%% This tests the presence of possible races due to an ets:lookup/ets:insert -%% combination. It takes into account the anonymous functions. - --module(ets_insert_funs2). --export([start/0]). - -start() -> - F = fun(T, N) -> - ets:insert(T, [{counter, N+1}]) - end, - io:format("Created ~w\n", [ets:new(foo, [named_table, public])]), - ets:insert(foo, {counter, 0}), - io:format("Inserted ~w\n", [{counter, 0}]), - [{_, N}] = ets:lookup(foo, counter), - F(foo, N), - io:format("Update complete\n", []), - ObjectList = ets:lookup(foo, counter), - io:format("Counter: ~w\n", [ObjectList]). diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_new.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_new.erl deleted file mode 100644 index 63f3272912b8..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_new.erl +++ /dev/null @@ -1,15 +0,0 @@ -%% This tests the presence of possible races due to an ets:lookup/ets:insert -%% combination. It takes into account multiple ets:new calls that might exist. - --module(ets_insert_new). --export([test/0]). - -test() -> - T1 = ets:new(foo, [public]), - T2 = ets:new(bar, []), - ets:lookup(T2, counter), - aux(T1), - aux(T2). - -aux(Tab) -> - ets:insert(Tab, {counter, 1}). diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_param.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_param.erl deleted file mode 100644 index a479a3179221..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_param.erl +++ /dev/null @@ -1,26 +0,0 @@ -%% This tests the presence of possible races due to an ets:lookup/ets:insert -%% combination in higher order functions. - --module(ets_insert_param). --export([start/1]). - -start(User) -> - Table = ets:new(table, [public]), - mod:process(Table), - [{_, Msg}] = ets:lookup(Table, welcome_msg), - case User of - root -> - ets:insert(Table, {welcome_msg, Msg ++ "root"}), - ets:insert(Table, {pass, Pass = generate_password(ets:lookup(Table, pass)) - ++ generate_strong_password(ets:lookup(Table, pass))}); - user -> - ets:insert(Table, {welcome_msg, Msg ++ "user"}), - ets:insert(Table, {pass, Pass = generate_password(ets:lookup(Table, pass))}) - end, - io:format("\nYour new pass is ~w\n", [Pass]). - -generate_password([{_, N}]) -> - lists:map(fun (_) -> random:uniform(90)+$\s+1 end, lists:seq(1,N)). - -generate_strong_password([{_, N}]) -> - lists:map(fun (_) -> random:uniform(90)+$\s+1 end, lists:seq(1,(N rem 2) * 5)). diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_public.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_public.erl deleted file mode 100644 index 4caa9fe8a0d6..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_public.erl +++ /dev/null @@ -1,23 +0,0 @@ -%% This tests the presence of possible races due to an ets:lookup/ets:insert -%% combination. It takes into account any public ETS tables that might exist. - --module(ets_insert_public). - --export([main/1]). - -%% Main -main(Foo) -> - make_table(Foo), - ets:insert(Foo, {counter, 0}), - [{_, N}] = ets:lookup(Foo, counter), - NewN = N + 1, - ets:insert(Foo, {counter, NewN}), - NewN. - -make_table(Foo) -> - init(Foo). - -init(Foo) -> - ets:new(Foo, [named_table, public]), - ets:insert(Foo, {counter, 0}), - {ok, feeling_good}. diff --git a/lib/dialyzer/test/race_SUITE_data/src/extract_translations.erl b/lib/dialyzer/test/race_SUITE_data/src/extract_translations.erl deleted file mode 100644 index 76ffca46769f..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/extract_translations.erl +++ /dev/null @@ -1,293 +0,0 @@ -%%%---------------------------------------------------------------------- -%%% File : extract_translations.erl -%%% Author : Sergei Golovan -%%% Purpose : Auxiliary tool for interface/messages translators -%%% Created : 23 Apr 2005 by Sergei Golovan -%%% Id : $Id: extract_translations.erl,v 1.1 2009/08/17 09:18:59 maria Exp $ -%%%---------------------------------------------------------------------- - --module(extract_translations). --author('sgolovan@nes.ru'). - --export([start/0]). - --define(STATUS_SUCCESS, 0). --define(STATUS_ERROR, 1). --define(STATUS_USAGE, 2). - --include_lib("kernel/include/file.hrl"). - - -start() -> - ets:new(translations, [named_table, public]), - ets:new(translations_obsolete, [named_table, public]), - ets:new(files, [named_table, public]), - ets:new(vars, [named_table, public]), - case init:get_plain_arguments() of - ["-srcmsg2po", Dir, File] -> - print_po_header(File), - Status = process(Dir, File, srcmsg2po), - halt(Status); - ["-unused", Dir, File] -> - Status = process(Dir, File, unused), - halt(Status); - [Dir, File] -> - Status = process(Dir, File, used), - halt(Status); - _ -> - print_usage(), - halt(?STATUS_USAGE) - end. - - -process(Dir, File, Used) -> - case load_file(File) of - {error, Reason} -> - io:format("~s: ~s~n", [File, file:format_error(Reason)]), - ?STATUS_ERROR; - _ -> - FileList = find_src_files(Dir), - lists:foreach( - fun(F) -> - parse_file(Dir, F, Used) - end, FileList), - case Used of - unused -> - ets:foldl(fun({Key, _}, _) -> - io:format("~p~n", [Key]) - end, ok, translations); - srcmsg2po -> - ets:foldl(fun({Key, Trans}, _) -> - print_translation_obsolete(Key, Trans) - end, ok, translations_obsolete); - _ -> - ok - end, - ?STATUS_SUCCESS - end. - -parse_file(Dir, File, Used) -> - ets:delete_all_objects(vars), - case epp:parse_file(File, [Dir, filename:dirname(File) | code:get_path()], []) of - {ok, Forms} -> - lists:foreach( - fun(F) -> - parse_form(Dir, File, F, Used) - end, Forms); - _ -> - ok - end. - -parse_form(Dir, File, Form, Used) -> - case Form of - %%{undefined, Something} -> - %% io:format("Undefined: ~p~n", [Something]); - {call, - _, - {remote, _, {atom, _, translate}, {atom, _, translate}}, - [_, {string, Line, Str}] - } -> - process_string(Dir, File, Line, Str, Used); - {call, - _, - {remote, _, {atom, _, translate}, {atom, _, translate}}, - [_, {var, _, Name}] - } -> - case ets:lookup(vars, Name) of - [{_Name, Value, Line}] -> - process_string(Dir, File, Line, Value, Used); - _ -> - ok - end; - {match, - _, - {var, _, Name}, - {string, Line, Value} - } -> - ets:insert(vars, {Name, Value, Line}); - L when is_list(L) -> - lists:foreach( - fun(F) -> - parse_form(Dir, File, F, Used) - end, L); - T when is_tuple(T) -> - lists:foreach( - fun(F) -> - parse_form(Dir, File, F, Used) - end, tuple_to_list(T)); - _ -> - ok - end. - -process_string(_Dir, _File, _Line, "", _Used) -> - ok; - -process_string(_Dir, File, Line, Str, Used) -> - case {ets:lookup(translations, Str), Used} of - {[{_Key, _Trans}], unused} -> - ets:delete(translations, Str); - {[{_Key, _Trans}], used} -> - ok; - {[{_Key, Trans}], srcmsg2po} -> - ets:delete(translations_obsolete, Str), - print_translation(File, Line, Str, Trans); - {_, used} -> - case ets:lookup(files, File) of - [{_}] -> - ok; - _ -> - io:format("~n% ~s~n", [File]), - ets:insert(files, {File}) - end, - case Str of - [] -> ok; - _ -> io:format("{~p, \"\"}.~n", [Str]) - end, - ets:insert(translations, {Str, ""}); - {_, srcmsg2po} -> - case ets:lookup(files, File) of - [{_}] -> - ok; - _ -> - ets:insert(files, {File}) - end, - ets:insert(translations, {Str, ""}), - print_translation(File, Line, Str, ""); - _ -> - ok - end. - -load_file(File) -> - case file:consult(File) of - {ok, Terms} -> - lists:foreach( - fun({Orig, Trans}) -> - case Trans of - "" -> - ok; - _ -> - ets:insert(translations, {Orig, Trans}), - ets:insert(translations_obsolete, {Orig, Trans}) - end - end, Terms); - Err -> - Err - end. - -find_src_files(Dir) -> - case file:list_dir(Dir) of - {ok, FileList} -> - recurse_filelist( - lists:map( - fun(F) -> - filename:join(Dir, F) - end, FileList)); - _ -> - [] - end. - -recurse_filelist(FileList) -> - recurse_filelist(FileList, []). - -recurse_filelist([], Acc) -> - lists:reverse(Acc); - -recurse_filelist([H | T], Acc) -> - case file:read_file_info(H) of - {ok, #file_info{type = directory}} -> - recurse_filelist(T, lists:reverse(find_src_files(H)) ++ Acc); - {ok, #file_info{type = regular}} -> - case string:substr(H, string:len(H) - 3) of - ".erl" -> - recurse_filelist(T, [H | Acc]); - ".hrl" -> - recurse_filelist(T, [H | Acc]); - _ -> - recurse_filelist(T, Acc) - end; - _ -> - recurse_filelist(T, Acc) - end. - - -print_usage() -> - io:format( - "Usage: extract_translations [-unused] dir file~n" - "~n" - "Example:~n" - " extract_translations . ./msgs/ru.msg~n" - ). - - -%%% -%%% Gettext -%%% - -print_po_header(File) -> - MsgProps = get_msg_header_props(File), - {Language, [LastT | AddT]} = prepare_props(MsgProps), - application:load(ejabberd), - {ok, Version} = application:get_key(ejabberd, vsn), - print_po_header(Version, Language, LastT, AddT). - -get_msg_header_props(File) -> - {ok, F} = file:open(File, [read]), - Lines = get_msg_header_props(F, []), - file:close(F), - Lines. - -get_msg_header_props(F, Lines) -> - String = io:get_line(F, ""), - case io_lib:fread("% ", String) of - {ok, [], RemString} -> - case io_lib:fread("~s", RemString) of - {ok, [Key], Value} when Value /= "\n" -> - %% The first character in Value is a blankspace: - %% And the last characters are 'slash n' - ValueClean = string:substr(Value, 2, string:len(Value)-2), - get_msg_header_props(F, Lines ++ [{Key, ValueClean}]); - _ -> - get_msg_header_props(F, Lines) - end; - _ -> - Lines - end. - -prepare_props(MsgProps) -> - Language = proplists:get_value("Language:", MsgProps), - Authors = proplists:get_all_values("Author:", MsgProps), - {Language, Authors}. - -print_po_header(Version, Language, LastTranslator, AdditionalTranslatorsList) -> - AdditionalTranslatorsString = build_additional_translators(AdditionalTranslatorsList), - HeaderString = - "msgid \"\"\n" - "msgstr \"\"\n" - "\"Project-Id-Version: " ++ Version ++ "\\n\"\n" - ++ "\"X-Language: " ++ Language ++ "\\n\"\n" - "\"Last-Translator: " ++ LastTranslator ++ "\\n\"\n" - ++ AdditionalTranslatorsString ++ - "\"MIME-Version: 1.0\\n\"\n" - "\"Content-Type: text/plain; charset=UTF-8\\n\"\n" - "\"Content-Transfer-Encoding: 8bit\\n\"\n", - io:format("~s~n", [HeaderString]). - -build_additional_translators(List) -> - lists:foldl( - fun(T, Str) -> - Str ++ "\"X-Additional-Translator: " ++ T ++ "\\n\"\n" - end, - "", - List). - -print_translation(File, Line, Str, StrT) -> - {ok, StrQ, _} = regexp:gsub(Str, "\"", "\\\""), - {ok, StrTQ, _} = regexp:gsub(StrT, "\"", "\\\""), - io:format("#: ~s:~p~nmsgid \"~s\"~nmsgstr \"~s\"~n~n", [File, Line, StrQ, StrTQ]). - -print_translation_obsolete(Str, StrT) -> - File = "unknown.erl", - Line = 1, - {ok, StrQ, _} = regexp:gsub(Str, "\"", "\\\""), - {ok, StrTQ, _} = regexp:gsub(StrT, "\"", "\\\""), - io:format("#: ~s:~p~n#~~ msgid \"~s\"~n#~~ msgstr \"~s\"~n~n", [File, Line, StrQ, StrTQ]). diff --git a/lib/dialyzer/test/race_SUITE_data/src/mnesia_diff_atoms_race1.erl b/lib/dialyzer/test/race_SUITE_data/src/mnesia_diff_atoms_race1.erl deleted file mode 100644 index 2f499208a28b..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/mnesia_diff_atoms_race1.erl +++ /dev/null @@ -1,33 +0,0 @@ -%% This tests that the race condition detection between mnesia:dirty_read/ -%% mnesia:dirty_write is robust even when the functions are called with -%% different atoms as arguments. - --module(mnesia_diff_atoms_race1). --export([test/2]). - --record(employee, {emp_no, - name, - salary, - sex, - phone, - room_no}). - -test(Eno, Raise) -> - {race(employee, Eno, Raise), no_race(employee, Eno, Raise)}. - -race(Tab, Eno, Raise) -> - [E] = mnesia:dirty_read(Tab, Eno), - Salary = E#employee.salary + Raise, - New = E#employee{salary = Salary}, - aux(Tab, New). - -no_race(Tab, Eno, Raise) -> - [E] = mnesia:dirty_read(Tab, Eno), - Salary = E#employee.salary + Raise, - New = E#employee{salary = Salary}, - AnotherTab = employer, - aux(AnotherTab, New). - - -aux(Table, Record) -> - mnesia:dirty_write(Table, Record). diff --git a/lib/dialyzer/test/race_SUITE_data/src/mnesia_diff_atoms_race2.erl b/lib/dialyzer/test/race_SUITE_data/src/mnesia_diff_atoms_race2.erl deleted file mode 100644 index c1dcfbd8f534..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/mnesia_diff_atoms_race2.erl +++ /dev/null @@ -1,37 +0,0 @@ -%% This tests that the race condition detection between mnesia:dirty_read/ -%% mnesia:dirty_write is robust even when the functions are called with -%% different atoms as arguments. - --module(mnesia_diff_atoms_race2). --export([test/2]). - --record(employee, {emp_no, - name, - salary, - sex, - phone, - room_no}). - --record(employer, {emp_no, - name, - salary, - sex, - phone, - room_no}). - -test(Eno, Raise) -> - {race(employee, Eno, Raise), no_race(employee, Eno, Raise)}. - -race(Tab, Eno, Raise) -> - [E] = mnesia:dirty_read(Tab, Eno), - Salary = E#employee.salary + Raise, - New = E#employee{salary = Salary}, - aux(New). - -no_race(Tab, Eno, Raise) -> - [E] = mnesia:dirty_read(Tab, Eno), - AnotherRecord = #employer{}, - aux(AnotherRecord). - -aux(Record) -> - mnesia:dirty_write(Record). diff --git a/lib/dialyzer/test/race_SUITE_data/src/mnesia_dirty_read_one_write_two.erl b/lib/dialyzer/test/race_SUITE_data/src/mnesia_dirty_read_one_write_two.erl deleted file mode 100644 index 4ca62deedca8..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/mnesia_dirty_read_one_write_two.erl +++ /dev/null @@ -1,20 +0,0 @@ -%% This tests the presence of possible races due to an mnesia:dirty_read/ -%% mnesia:dirty_write combination. It takes into account the argument types -%% of the calls. - --module(mnesia_dirty_read_one_write_two). --export([raise/2]). - --record(employee, {emp_no, - name, - salary, - sex, - phone, - room_no}). - - -raise(Eno, Raise) -> - [E] = mnesia:dirty_read({employee, Eno}), - Salary = E#employee.salary + Raise, - New = E#employee{salary = Salary}, - mnesia:dirty_write(employee, New). diff --git a/lib/dialyzer/test/race_SUITE_data/src/mnesia_dirty_read_two_write_one.erl b/lib/dialyzer/test/race_SUITE_data/src/mnesia_dirty_read_two_write_one.erl deleted file mode 100644 index e523a03789b5..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/mnesia_dirty_read_two_write_one.erl +++ /dev/null @@ -1,20 +0,0 @@ -%% This tests the presence of possible races due to an mnesia:dirty_read/ -%% mnesia:dirty_write combination. It takes into account the argument types -%% of the calls. - --module(mnesia_dirty_read_two_write_one). --export([raise/2]). - --record(employee, {emp_no, - name, - salary, - sex, - phone, - room_no}). - - -raise(Eno, Raise) -> - [E] = mnesia:dirty_read(employee, Eno), - Salary = E#employee.salary + Raise, - New = E#employee{salary = Salary}, - mnesia:dirty_write(New). diff --git a/lib/dialyzer/test/race_SUITE_data/src/mnesia_dirty_read_write_double1.erl b/lib/dialyzer/test/race_SUITE_data/src/mnesia_dirty_read_write_double1.erl deleted file mode 100644 index 2bd18e4772a0..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/mnesia_dirty_read_write_double1.erl +++ /dev/null @@ -1,25 +0,0 @@ -%% This tests the presence of possible races due to an mnesia:dirty_read/ -%% mnesia:dirty_write combination. It takes into account multiple -%% mnesia:dirty_writes that might exist. - --module(mnesia_dirty_read_write_double1). --export([raise/3]). - --record(employee, {emp_no, - name, - salary, - sex, - phone, - room_no}). - - -raise(Eno, Raise, Room) -> - [E] = mnesia:dirty_read(employee, Eno), - Salary = E#employee.salary + Raise, - New = E#employee{salary = Salary}, - mnesia:dirty_write(employee, New), - move(E, Room). - -move(E, Room) -> - New = E#employee{room_no = Room}, - mnesia:dirty_write(employee, New). diff --git a/lib/dialyzer/test/race_SUITE_data/src/mnesia_dirty_read_write_double2.erl b/lib/dialyzer/test/race_SUITE_data/src/mnesia_dirty_read_write_double2.erl deleted file mode 100644 index cdbfdc700a02..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/mnesia_dirty_read_write_double2.erl +++ /dev/null @@ -1,25 +0,0 @@ -%% This tests the presence of possible races due to an mnesia:dirty_read/ -%% mnesia:dirty_write combination. It takes into account multiple -%% mnesia:dirty_writes that might exist. - --module(mnesia_dirty_read_write_double2). --export([raise/3]). - --record(employee, {emp_no, - name, - salary, - sex, - phone, - room_no}). - - -raise(Eno, Raise, Room) -> - [E] = mnesia:dirty_read({employee, Eno}), - Salary = E#employee.salary + Raise, - New = E#employee{salary = Salary}, - mnesia:dirty_write(New), - move(E, Room). - -move(E, Room) -> - New = E#employee{room_no = Room}, - mnesia:dirty_write(New). diff --git a/lib/dialyzer/test/race_SUITE_data/src/mnesia_dirty_read_write_double3.erl b/lib/dialyzer/test/race_SUITE_data/src/mnesia_dirty_read_write_double3.erl deleted file mode 100644 index 051524917e23..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/mnesia_dirty_read_write_double3.erl +++ /dev/null @@ -1,25 +0,0 @@ -%% This tests the presence of possible races due to an mnesia:dirty_read/ -%% mnesia:dirty_write combination. It takes into account multiple -%% mnesia:dirty_writes that might exist. - --module(mnesia_dirty_read_write_double3). --export([raise/3]). - --record(employee, {emp_no, - name, - salary, - sex, - phone, - room_no}). - - -raise(Eno, Raise, Room) -> - [E] = mnesia:dirty_read({employee, Eno}), - Salary = E#employee.salary + Raise, - New = E#employee{salary = Salary}, - mnesia:dirty_write(employee, New), - move(E, Room). - -move(E, Room) -> - New = E#employee{room_no = Room}, - mnesia:dirty_write(employee, New). diff --git a/lib/dialyzer/test/race_SUITE_data/src/mnesia_dirty_read_write_double4.erl b/lib/dialyzer/test/race_SUITE_data/src/mnesia_dirty_read_write_double4.erl deleted file mode 100644 index 96752a60452a..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/mnesia_dirty_read_write_double4.erl +++ /dev/null @@ -1,25 +0,0 @@ -%% This tests the presence of possible races due to an mnesia:dirty_read/ -%% mnesia:dirty_write combination. It takes into account multiple -%% mnesia:dirty_writes that might exist. - --module(mnesia_dirty_read_write_double4). --export([raise/3]). - --record(employee, {emp_no, - name, - salary, - sex, - phone, - room_no}). - - -raise(Eno, Raise, Room) -> - [E] = mnesia:dirty_read(employee, Eno), - Salary = E#employee.salary + Raise, - New = E#employee{salary = Salary}, - mnesia:dirty_write(New), - move(E, Room). - -move(E, Room) -> - New = E#employee{room_no = Room}, - mnesia:dirty_write(New). diff --git a/lib/dialyzer/test/race_SUITE_data/src/mnesia_dirty_read_write_one.erl b/lib/dialyzer/test/race_SUITE_data/src/mnesia_dirty_read_write_one.erl deleted file mode 100644 index aee64337364b..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/mnesia_dirty_read_write_one.erl +++ /dev/null @@ -1,20 +0,0 @@ -%% This tests the presence of possible races due to an mnesia:dirty_read/ -%% mnesia:dirty_write combination. It takes into account the argument types -%% of the calls. - --module(mnesia_dirty_read_write_one). --export([raise/2]). - --record(employee, {emp_no, - name, - salary, - sex, - phone, - room_no}). - - -raise(Eno, Raise) -> - [E] = mnesia:dirty_read({employee, Eno}), - Salary = E#employee.salary + Raise, - New = E#employee{salary = Salary}, - mnesia:dirty_write(New). diff --git a/lib/dialyzer/test/race_SUITE_data/src/mnesia_dirty_read_write_two.erl b/lib/dialyzer/test/race_SUITE_data/src/mnesia_dirty_read_write_two.erl deleted file mode 100644 index 037aeddafd27..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/mnesia_dirty_read_write_two.erl +++ /dev/null @@ -1,20 +0,0 @@ -%% This tests the presence of possible races due to an mnesia:dirty_read/ -%% mnesia:dirty_write combination. It takes into account the argument types -%% of the calls. - --module(mnesia_dirty_read_write_two). --export([raise/2]). - --record(employee, {emp_no, - name, - salary, - sex, - phone, - room_no}). - - -raise(Eno, Raise) -> - [E] = mnesia:dirty_read(employee, Eno), - Salary = E#employee.salary + Raise, - New = E#employee{salary = Salary}, - mnesia:dirty_write(employee, New). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_control_flow1.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_control_flow1.erl deleted file mode 100644 index e65f6c3e23ad..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_control_flow1.erl +++ /dev/null @@ -1,17 +0,0 @@ -%% This tests the presence of possible races due to a whereis/register -%% combination. It takes into account control flow that might exist. - --module(whereis_control_flow1). --export([start/2]). - -start(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - case Pid =:= self() of - true -> ok; - false -> register(AnAtom, Pid) - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_control_flow2.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_control_flow2.erl deleted file mode 100644 index 41039482c909..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_control_flow2.erl +++ /dev/null @@ -1,19 +0,0 @@ -%% This tests the presence of possible races due to a whereis/register -%% combination. It takes into account control flow that might exist. - --module(whereis_control_flow2). --export([start/2]). - -start(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - case Pid =:= self() of - true -> - io:format("self",[]), - register(AnAtom, Pid); - false -> register(AnAtom, Pid) - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_control_flow3.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_control_flow3.erl deleted file mode 100644 index 94f8445fada0..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_control_flow3.erl +++ /dev/null @@ -1,25 +0,0 @@ -%% This tests the presence of possible races due to a whereis/register -%% combination. It takes into account control flow that might exist. - --module(whereis_control_flow3). --export([start/3]). - -start(AnAtom, Fun, FunName) -> - Pid = - case FunName of - master -> - case whereis(AnAtom) of - undefined -> - spawn(Fun); - P when is_pid(P) -> - P - end; - slave -> - case whereis(AnAtom) of - undefined -> - spawn(Fun); - P when is_pid(P) -> - P - end - end, - register(AnAtom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_control_flow4.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_control_flow4.erl deleted file mode 100644 index 2a5976078908..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_control_flow4.erl +++ /dev/null @@ -1,29 +0,0 @@ -%% This tests the presence of possible races due to a whereis/register -%% combination. It takes into account control flow that might exist. - --module(whereis_control_flow4). --export([start/1]). - -start(Fun) -> - case whereis(maria) of - undefined -> - Pid1 = spawn(Fun), - case Pid1 =:= self() of - true -> - case whereis(kostis) of - undefined -> - Pid2 = spawn(Fun), - case Pid2 =:= self() of - true -> - register(maria, Pid1), - register(kostis, Pid2); - false -> ok - end; - P when is_pid(P) -> - ok - end; - false -> ok - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_control_flow5.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_control_flow5.erl deleted file mode 100644 index 8de9cb2dadfa..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_control_flow5.erl +++ /dev/null @@ -1,12 +0,0 @@ -%% This tests the presence of possible races due to a whereis/unregister -%% combination. It takes into account control flow that might exist. - --module(whereis_control_flow5). --export([start/1]). - -start(AnAtom) -> - case whereis(AnAtom) of - undefined -> ok; - P when is_pid(P) -> - unregister(AnAtom) - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_control_flow6.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_control_flow6.erl deleted file mode 100644 index 03c5095a503d..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_control_flow6.erl +++ /dev/null @@ -1,12 +0,0 @@ -%% This tests the presence of possible races due to a whereis/unregister -%% combination. It takes into account control flow that might exist. - --module(whereis_control_flow6). --export([start/0]). - -start() -> - case whereis(kostis) of - undefined -> ok; - P when is_pid(P) -> - unregister(kostis) - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_atoms_no_race.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_atoms_no_race.erl deleted file mode 100644 index 704ee6015d34..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_atoms_no_race.erl +++ /dev/null @@ -1,23 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust even when the functions are called with different atoms -%% as arguments. - --module(whereis_diff_atoms_no_race). --export([test/0]). - -test() -> - Fun = fun () -> foo end, - {no_race(maria, Fun)}. - -no_race(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - AnotherAtom = kostis, - aux(AnotherAtom, Pid); - P when is_pid(P) -> - ok - end. - -aux(Atom, Pid) -> - register(Atom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_atoms_race.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_atoms_race.erl deleted file mode 100644 index 6c834caa0c51..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_atoms_race.erl +++ /dev/null @@ -1,34 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust even when the functions are called with different atoms -%% as arguments. - --module(whereis_diff_atoms_race). --export([test/0]). %, race/1, no_race/1]). - -test() -> - Fun = fun () -> foo end, - {race(maria, Fun), no_race(maria, Fun)}. - -race(AnAtom, Fun) -> - %AnAtom = maria, - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - aux(AnAtom, Pid); - P when is_pid(P) -> - ok - end. - -no_race(AnAtom, Fun) -> - %AnAtom = maria, - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - AnotherAtom = kostis, - aux(AnotherAtom, Pid); - P when is_pid(P) -> - ok - end. - -aux(Atom, Pid) -> - register(Atom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions1.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions1.erl deleted file mode 100644 index 6a1c197c06c6..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions1.erl +++ /dev/null @@ -1,22 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate functions. - --module(whereis_diff_functions1). --export([start/2]). - -continue(Fun) -> - case whereis(master) of - undefined -> - register(master, spawn(Fun)); - _ -> ok - end. - -start(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - register(AnAtom, Pid); - _ -> - ok - end, - continue(Fun). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions1_nested.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions1_nested.erl deleted file mode 100644 index 4967dec13375..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions1_nested.erl +++ /dev/null @@ -1,23 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate functions. - --module(whereis_diff_functions1_nested). --export([test/2]). - -test(AnAtom, Fun) -> - start(AnAtom, Fun). - -start(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - race1(AnAtom, Pid); - P when is_pid(P) -> - true - end. - -race1(Atom, Pid) -> - race2(Atom, Pid). - -race2(Atom, Pid) -> - register(Atom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions1_pathsens.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions1_pathsens.erl deleted file mode 100644 index ff6506eee845..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions1_pathsens.erl +++ /dev/null @@ -1,32 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate functions. -%% It takes into account control flow that might exist. - --module(whereis_diff_functions1_pathsens). --export([test/1]). - -test(FunName) -> - start(kostis, mod:function(), FunName). - -start(AnAtom, Fun, FunName) -> - Pid = - case FunName of - master -> - case whereis(AnAtom) of - undefined -> - spawn(Fun); - P when is_pid(P) -> - P - end; - slave -> - case whereis(AnAtom) of - undefined -> - spawn(Fun); - P when is_pid(P) -> - P - end - end, - race(AnAtom, Pid). - -race(Atom, Pid) -> - register(Atom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions1_twice.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions1_twice.erl deleted file mode 100644 index dd395bb6d886..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions1_twice.erl +++ /dev/null @@ -1,30 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having multiple calls in separate functions. - --module(whereis_diff_functions1_twice). --export([test/2]). - -test(AnAtom, Fun) -> - start(AnAtom, Fun). - -start(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid1 = spawn(Fun), - race(AnAtom, Pid1), - case whereis(AnAtom) of - undefined -> - Pid2 = spawn(Fun), - race_again(AnAtom, Pid2); - P when is_pid(P) -> - true - end; - P when is_pid(P) -> - true - end. - -race(Atom, Pid) -> - register(Atom, Pid). - -race_again(Atom, Pid) -> - register(Atom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions2.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions2.erl deleted file mode 100644 index eaf98291ed4e..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions2.erl +++ /dev/null @@ -1,25 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate functions. - --module(whereis_diff_functions2). --export([test/0]). - -test() -> - start(kostis, mod:function()). - -start(AnAtom, Fun) -> - Pid1 = spawn(Fun), - no_race(Pid1), - case whereis(AnAtom) of - undefined -> - Pid2 = spawn(Fun), - race(AnAtom, Pid2); - P when is_pid(P) -> - true - end. - -no_race(Pid) -> - register(master, Pid). - -race(Atom, Pid) -> - register(Atom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions2_nested.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions2_nested.erl deleted file mode 100644 index 5ae8784389e4..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions2_nested.erl +++ /dev/null @@ -1,20 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate functions. - --module(whereis_diff_functions2_nested). --export([start/2]). - -start(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - race1(AnAtom, Pid); - P when is_pid(P) -> - true - end. - -race1(Atom, Pid) -> - race2(Atom, Pid). - -race2(Atom, Pid) -> - register(Atom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions2_pathsens.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions2_pathsens.erl deleted file mode 100644 index e9ce4bc48e0f..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions2_pathsens.erl +++ /dev/null @@ -1,29 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate functions. -%% It takes into account control flow that might exist. - --module(whereis_diff_functions2_pathsens). --export([race/4]). - -start(AnAtom, Fun, FunName) -> - Pid = - case FunName of - master -> - case whereis(AnAtom) of - undefined -> - spawn(Fun); - P when is_pid(P) -> - P - end; - slave -> - case whereis(AnAtom) of - undefined -> - spawn(Fun); - P when is_pid(P) -> - P - end - end. - -race(Atom, Fun, FunName, Pid) -> - start(Atom, Fun, FunName), - register(Atom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions2_twice.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions2_twice.erl deleted file mode 100644 index d5efe631b8ad..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions2_twice.erl +++ /dev/null @@ -1,27 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having multiple calls in separate functions. - --module(whereis_diff_functions2_twice). --export([start/2]). - -start(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid1 = spawn(Fun), - race(AnAtom, Pid1), - case whereis(AnAtom) of - undefined -> - Pid2 = spawn(Fun), - race_again(AnAtom, Pid2); - P when is_pid(P) -> - true - end; - P when is_pid(P) -> - true - end. - -race(Atom, Pid) -> - register(Atom, Pid). - -race_again(Atom, Pid) -> - register(Atom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions3.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions3.erl deleted file mode 100644 index 093f02a06f62..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions3.erl +++ /dev/null @@ -1,11 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate functions. - --module(whereis_diff_functions3). --export([start/1]). - -start(AnAtom) -> - register(AnAtom, race(AnAtom)). - -race(Atom) -> - whereis(Atom). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions3_nested.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions3_nested.erl deleted file mode 100644 index 5c28fc74f649..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions3_nested.erl +++ /dev/null @@ -1,21 +0,0 @@ -%% This tests that the race condition detection between whereis/unregister -%% is robust w.r.t. having the calls in separate functions. - --module(whereis_diff_functions3_nested). --export([test/1]). - -test(AnAtom) -> - start(AnAtom). - -start(AnAtom) -> - case whereis(AnAtom) of - undefined -> true; - P when is_pid(P) -> - race1(AnAtom) - end. - -race1(Atom) -> - race2(Atom). - -race2(Atom) -> - unregister(Atom). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions3_pathsens.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions3_pathsens.erl deleted file mode 100644 index a3a245b9ea80..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions3_pathsens.erl +++ /dev/null @@ -1,29 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate functions. -%% It takes into account control flow that might exist. - --module(whereis_diff_functions3_pathsens). --export([start/3]). - -start(AnAtom, Fun, FunName) -> - Pid = - case FunName of - master -> - case whereis(AnAtom) of - undefined -> - spawn(Fun); - P when is_pid(P) -> - P - end; - slave -> - case whereis(AnAtom) of - undefined -> - spawn(Fun); - P when is_pid(P) -> - P - end - end, - race(AnAtom, Pid). - -race(Atom, Pid) -> - register(Atom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions4.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions4.erl deleted file mode 100644 index e40483d48752..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions4.erl +++ /dev/null @@ -1,32 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate functions. - --module(whereis_diff_functions4). --export([test/2]). - -test(AnAtom, Fun) -> - start(AnAtom, Fun). - -start(AnAtom, Fun) -> - Pid1 = spawn(Fun), - no_race(Pid1), - case whereis(AnAtom) of - undefined -> - Pid2 = spawn(Fun), - race(AnAtom, Pid2), - case whereis(AnAtom) of - undefined -> - Pid3 = spawn(Fun), - race(AnAtom, Pid3); - P when is_pid(P) -> - true - end; - P when is_pid(P) -> - true - end. - -no_race(Pid) -> - register(master, Pid). - -race(Atom, Pid) -> - register(Atom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions5.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions5.erl deleted file mode 100644 index a2c4352803fc..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions5.erl +++ /dev/null @@ -1,22 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate functions. - --module(whereis_diff_functions5). --export([start/2]). - -start(AnAtom, Fun) -> - Pid1 = spawn(Fun), - no_race(Pid1), - case whereis(AnAtom) of - undefined -> - Pid2 = spawn(Fun), - race(AnAtom, Pid2); - P when is_pid(P) -> - true - end. - -no_race(Pid) -> - register(master, Pid). - -race(Atom, Pid) -> - register(Atom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions6.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions6.erl deleted file mode 100644 index f016d795333b..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_functions6.erl +++ /dev/null @@ -1,29 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate functions. - --module(whereis_diff_functions6). --export([start/2]). - -start(AnAtom, Fun) -> - Pid1 = spawn(Fun), - no_race(Pid1), - case whereis(AnAtom) of - undefined -> - Pid2 = spawn(Fun), - race(AnAtom, Pid2), - case whereis(AnAtom) of - undefined -> - Pid3 = spawn(Fun), - race(AnAtom, Pid3); - P when is_pid(P) -> - true - end; - P when is_pid(P) -> - true - end. - -no_race(Pid) -> - register(master, Pid). - -race(Atom, Pid) -> - register(Atom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules1/whereis_diff_modules1.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules1/whereis_diff_modules1.erl deleted file mode 100644 index 00cb29cec015..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules1/whereis_diff_modules1.erl +++ /dev/null @@ -1,16 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate modules. - --module(whereis_diff_modules1). --export([start/2]). - -start(AnAtom, Fun) -> - Pid1 = spawn(Fun), - whereis_diff_modules2:no_race(Pid1), - case whereis(AnAtom) of - undefined -> - Pid2 = spawn(Fun), - whereis_diff_modules2:race(AnAtom, Pid2); - P when is_pid(P) -> - true - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules1/whereis_diff_modules2.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules1/whereis_diff_modules2.erl deleted file mode 100644 index e5f6fdeb7bd0..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules1/whereis_diff_modules2.erl +++ /dev/null @@ -1,11 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate modules. - --module(whereis_diff_modules2). --export([no_race/1, race/2]). - -no_race(Pid) -> - register(master, Pid). - -race(Atom, Pid) -> - register(Atom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules1_pathsens/whereis_diff_modules1_pathsens.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules1_pathsens/whereis_diff_modules1_pathsens.erl deleted file mode 100644 index a5f1d4d3c727..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules1_pathsens/whereis_diff_modules1_pathsens.erl +++ /dev/null @@ -1,26 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate modules (backward analysis). -%% It takes into account control flow that might exist. - --module(whereis_diff_modules1_pathsens). --export([start/3]). - -start(AnAtom, Fun, FunName) -> - Pid = - case FunName of - master -> - case whereis(AnAtom) of - undefined -> - spawn(Fun); - P when is_pid(P) -> - P - end; - slave -> - case whereis(AnAtom) of - undefined -> - spawn(Fun); - P when is_pid(P) -> - P - end - end, - whereis_diff_modules2_pathsens:race(AnAtom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules1_pathsens/whereis_diff_modules2_pathsens.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules1_pathsens/whereis_diff_modules2_pathsens.erl deleted file mode 100644 index d24d13976b2e..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules1_pathsens/whereis_diff_modules2_pathsens.erl +++ /dev/null @@ -1,12 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate modules (backward analysis). -%% It takes into account control flow that might exist. - --module(whereis_diff_modules2_pathsens). --export([no_race/1, race/2]). - -no_race(Pid) -> - register(master, Pid). - -race(Atom, Pid) -> - register(Atom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules1_rec/whereis_diff_modules1_rec.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules1_rec/whereis_diff_modules1_rec.erl deleted file mode 100644 index a397954eea4f..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules1_rec/whereis_diff_modules1_rec.erl +++ /dev/null @@ -1,22 +0,0 @@ -%% This tests the presence of possible races due to a register/whereis -%% combination in an indirectly recursive inter-modular function. - --module(whereis_diff_modules1_rec). --export([start/4]). - -start(AnAtom, NextAtom, Fun, Id) -> - case AnAtom of - undefined -> register(start, Id); - _ -> register(AnAtom, Id) - end, - case whereis(NextAtom) of - undefined -> - Pid = spawn(Fun), - case Pid =:= self() of - true -> ok; - false -> - whereis_diff_modules2_rec:continue(NextAtom, mod:next(), Pid, Id) - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules1_rec/whereis_diff_modules2_rec.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules1_rec/whereis_diff_modules2_rec.erl deleted file mode 100644 index 4b46b4a8e574..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules1_rec/whereis_diff_modules2_rec.erl +++ /dev/null @@ -1,8 +0,0 @@ -%% This tests the presence of possible races due to a register/whereis -%% combination in a recursive function. - --module(whereis_diff_modules2_rec). --export([continue/4]). - -continue(Atom, NextAtom, Fun, Id) -> - whereis_diff_modules1_rec:start(Atom, NextAtom, Fun, Id). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules2/whereis_diff_modules3.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules2/whereis_diff_modules3.erl deleted file mode 100644 index 60b5a1d3780d..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules2/whereis_diff_modules3.erl +++ /dev/null @@ -1,8 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate modules. - --module(whereis_diff_modules3). --export([start/1]). - -start(AnAtom) -> - register(AnAtom, whereis_diff_modules4:race(AnAtom)). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules2/whereis_diff_modules4.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules2/whereis_diff_modules4.erl deleted file mode 100644 index 1ab4fbf8d8d2..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules2/whereis_diff_modules4.erl +++ /dev/null @@ -1,11 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate modules. - --module(whereis_diff_modules4). --export([no_race/1, race/1]). - -no_race(Pid) -> - register(master, Pid). - -race(Atom) -> - whereis(Atom). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules2_pathsens/whereis_diff_modules3_pathsens.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules2_pathsens/whereis_diff_modules3_pathsens.erl deleted file mode 100644 index cb2f85a103b7..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules2_pathsens/whereis_diff_modules3_pathsens.erl +++ /dev/null @@ -1,25 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate modules (forward analysis). -%% It takes into account control flow that might exist. - --module(whereis_diff_modules3_pathsens). --export([start/3]). - -start(AnAtom, Fun, FunName) -> - Pid = - case FunName of - master -> - case whereis(AnAtom) of - undefined -> - spawn(Fun); - P when is_pid(P) -> - P - end; - slave -> - case whereis(AnAtom) of - undefined -> - spawn(Fun); - P when is_pid(P) -> - P - end - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules2_pathsens/whereis_diff_modules4_pathsens.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules2_pathsens/whereis_diff_modules4_pathsens.erl deleted file mode 100644 index 952f9312f437..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules2_pathsens/whereis_diff_modules4_pathsens.erl +++ /dev/null @@ -1,13 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate modules (forward analysis). -%% It takes into account control flow that might exist. - --module(whereis_diff_modules4_pathsens). --export([no_race/1, race/4]). - -no_race(Pid) -> - register(master, Pid). - -race(Atom, Fun, FunName, Pid) -> - whereis_diff_modules3_pathsens:start(Atom, Fun, FunName), - register(Atom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules2_rec/whereis_diff_modules3_rec.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules2_rec/whereis_diff_modules3_rec.erl deleted file mode 100644 index 0320140768b5..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules2_rec/whereis_diff_modules3_rec.erl +++ /dev/null @@ -1,25 +0,0 @@ -%% This tests the presence of possible races due to a register/whereis -%% combination in an indirectly recursive inter-modular function. - --module(whereis_diff_modules3_rec). --export([test/0, start/4]). - -test() -> - start(undefined, second, mod:f(), self()). - -start(AnAtom, NextAtom, Fun, Id) -> - case AnAtom of - undefined -> register(start, Id); - _ -> register(AnAtom, Id) - end, - case whereis(NextAtom) of - undefined -> - Pid = spawn(Fun), - case Pid =:= self() of - true -> ok; - false -> - whereis_diff_modules4_rec:continue(NextAtom, mod:next(), Pid, Id) - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules2_rec/whereis_diff_modules4_rec.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules2_rec/whereis_diff_modules4_rec.erl deleted file mode 100644 index d49c59ed5c7a..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules2_rec/whereis_diff_modules4_rec.erl +++ /dev/null @@ -1,8 +0,0 @@ -%% This tests the presence of possible races due to a register/whereis -%% combination in a recursive function. - --module(whereis_diff_modules4_rec). --export([continue/4]). - -continue(Atom, NextAtom, Fun, Id) -> - whereis_diff_modules3_rec:start(Atom, NextAtom, Fun, Id). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules3/whereis_diff_modules5.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules3/whereis_diff_modules5.erl deleted file mode 100644 index 591732aa31c6..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules3/whereis_diff_modules5.erl +++ /dev/null @@ -1,23 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate modules. - --module(whereis_diff_modules5). --export([start/2]). - -start(AnAtom, Fun) -> - Pid1 = spawn(Fun), - whereis_diff_modules6:no_race(Pid1), - case whereis(AnAtom) of - undefined -> - Pid2 = spawn(Fun), - whereis_diff_modules6:race(AnAtom, Pid2), - case whereis(AnAtom) of - undefined -> - Pid3 = spawn(Fun), - whereis_diff_modules6:race(AnAtom, Pid3); - P when is_pid(P) -> - true - end; - P when is_pid(P) -> - true - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules3/whereis_diff_modules6.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules3/whereis_diff_modules6.erl deleted file mode 100644 index 159d96cfc565..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules3/whereis_diff_modules6.erl +++ /dev/null @@ -1,11 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate modules. - --module(whereis_diff_modules6). --export([no_race/1, race/2]). - -no_race(Pid) -> - register(master, Pid). - -race(Atom, Pid) -> - register(Atom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules_nested/whereis_diff_modules1_nested.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules_nested/whereis_diff_modules1_nested.erl deleted file mode 100644 index a25d2f8784ef..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules_nested/whereis_diff_modules1_nested.erl +++ /dev/null @@ -1,14 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate modules. - --module(whereis_diff_modules1_nested). --export([start/2]). - -start(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - whereis_diff_modules2_nested:race(AnAtom, Pid); - P when is_pid(P) -> - true - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules_nested/whereis_diff_modules2_nested.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules_nested/whereis_diff_modules2_nested.erl deleted file mode 100644 index 32a55e731a57..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules_nested/whereis_diff_modules2_nested.erl +++ /dev/null @@ -1,11 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate modules. - --module(whereis_diff_modules2_nested). --export([no_race/1, race/2]). - -no_race(Pid) -> - register(master, Pid). - -race(Atom, Pid) -> - whereis_diff_modules3_nested:race(Atom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules_nested/whereis_diff_modules3_nested.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules_nested/whereis_diff_modules3_nested.erl deleted file mode 100644 index 414129611f0c..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules_nested/whereis_diff_modules3_nested.erl +++ /dev/null @@ -1,11 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate modules. - --module(whereis_diff_modules3_nested). --export([no_race/1, race/2]). - -no_race(Pid) -> - register(master, Pid). - -race(Atom, Pid) -> - register(Atom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules_twice/whereis_diff_modules1_twice.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules_twice/whereis_diff_modules1_twice.erl deleted file mode 100644 index 92f2cb1fbcd8..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules_twice/whereis_diff_modules1_twice.erl +++ /dev/null @@ -1,21 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having multiple calls in separate modules. - --module(whereis_diff_modules1_twice). --export([start/2]). - -start(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid1 = spawn(Fun), - whereis_diff_modules2_twice:race(AnAtom, Pid1), - case whereis(AnAtom) of - undefined -> - Pid2 = spawn(Fun), - whereis_diff_modules2_twice:race_again(AnAtom, Pid2); - P when is_pid(P) -> - true - end; - P when is_pid(P) -> - true - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules_twice/whereis_diff_modules2_twice.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules_twice/whereis_diff_modules2_twice.erl deleted file mode 100644 index 390c0dcc9437..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_modules_twice/whereis_diff_modules2_twice.erl +++ /dev/null @@ -1,11 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate modules. - --module(whereis_diff_modules2_twice). --export([race/2, race_again/2]). - -race(Atom, Pid) -> - register(Atom, Pid). - -race_again(Atom, Pid) -> - register(Atom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_vars_no_race.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_vars_no_race.erl deleted file mode 100644 index 8466004ce4a9..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_vars_no_race.erl +++ /dev/null @@ -1,13 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust even when the functions are called with different variables -%% as arguments. - --module(whereis_diff_vars_no_race). --export([test/3]). - -test(AnAtom, AnotherAtom, Pid) -> - {aux(AnAtom, Pid), aux(AnotherAtom, Pid)}. - -aux(Atom, Pid) -> - register(Atom, Pid), - whereis(Atom). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_vars_race.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_vars_race.erl deleted file mode 100644 index 90791de1b2e6..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_diff_vars_race.erl +++ /dev/null @@ -1,19 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust even when the functions are called with different variables -%% as arguments. - --module(whereis_diff_vars_race). --export([test/2]). - -test(AnAtom, AnotherAtom) -> - Fun = fun () -> foo end, - {aux(AnAtom, AnotherAtom, Fun), aux(AnotherAtom, AnAtom, Fun)}. - -aux(Atom1, Atom2, Fun) -> - case whereis(Atom1) of - undefined -> - Pid = spawn(Fun), - register(Atom2, Pid); - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module1/whereis_intra_inter_module1.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module1/whereis_intra_inter_module1.erl deleted file mode 100644 index 677551c99d9d..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module1/whereis_intra_inter_module1.erl +++ /dev/null @@ -1,19 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate functions and modules. - --module(whereis_intra_inter_module1). --export([start/2]). - -start(AnAtom, Fun) -> - Pid1 = spawn(Fun), - whereis_intra_inter_module2:no_race(Pid1), - case whereis(AnAtom) of - undefined -> - Pid2 = spawn(Fun), - continue(AnAtom, Pid2); - P when is_pid(P) -> - true - end. - -continue(Atom, Pid) -> - whereis_intra_inter_module2:race(Atom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module1/whereis_intra_inter_module2.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module1/whereis_intra_inter_module2.erl deleted file mode 100644 index e7acee0cfd9d..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module1/whereis_intra_inter_module2.erl +++ /dev/null @@ -1,11 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate functions and modules. - --module(whereis_intra_inter_module2). --export([no_race/1, race/2]). - -no_race(Pid) -> - register(master, Pid). - -race(Atom, Pid) -> - register(Atom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module2/whereis_intra_inter_module3.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module2/whereis_intra_inter_module3.erl deleted file mode 100644 index c8103db12248..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module2/whereis_intra_inter_module3.erl +++ /dev/null @@ -1,16 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate functions and modules. - --module(whereis_intra_inter_module3). --export([start/2]). - -start(AnAtom, Fun) -> - Pid1 = spawn(Fun), - whereis_intra_inter_module4:no_race(Pid1), - case whereis(AnAtom) of - undefined -> - Pid2 = spawn(Fun), - whereis_intra_inter_module4:race(AnAtom, Pid2); - P when is_pid(P) -> - true - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module2/whereis_intra_inter_module4.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module2/whereis_intra_inter_module4.erl deleted file mode 100644 index 4094a9522368..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module2/whereis_intra_inter_module4.erl +++ /dev/null @@ -1,14 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate functions and modules. - --module(whereis_intra_inter_module4). --export([no_race/1, race/2]). - -no_race(Pid) -> - register(master, Pid). - -race(Atom, Pid) -> - continue(Atom, Pid). - -continue(Atom, Pid) -> - register(Atom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module3/whereis_intra_inter_module5.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module3/whereis_intra_inter_module5.erl deleted file mode 100644 index 2a2977915365..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module3/whereis_intra_inter_module5.erl +++ /dev/null @@ -1,19 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate functions and modules. - --module(whereis_intra_inter_module5). --export([start/2]). - -start(AnAtom, Fun) -> - Pid1 = spawn(Fun), - whereis_intra_inter_module6:no_race(Pid1), - case whereis(AnAtom) of - undefined -> - Pid2 = spawn(Fun), - continue(AnAtom, Pid2); - P when is_pid(P) -> - true - end. - -continue(Atom, Pid) -> - whereis_intra_inter_module6:race(Atom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module3/whereis_intra_inter_module6.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module3/whereis_intra_inter_module6.erl deleted file mode 100644 index cd05431cd55e..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module3/whereis_intra_inter_module6.erl +++ /dev/null @@ -1,14 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate functions and modules. - --module(whereis_intra_inter_module6). --export([no_race/1, race/2]). - -no_race(Pid) -> - register(master, Pid). - -race(Atom, Pid) -> - continue(Atom, Pid). - -continue(Atom, Pid) -> - register(Atom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module4/whereis_intra_inter_module7.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module4/whereis_intra_inter_module7.erl deleted file mode 100644 index 1f702e7af34c..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module4/whereis_intra_inter_module7.erl +++ /dev/null @@ -1,11 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate functions and modules. - --module(whereis_intra_inter_module7). --export([start/2]). - -start(AnAtom, Fun) -> - register(AnAtom, continue(AnAtom, Fun)). - -continue(AnAtom, Fun) -> - whereis_intra_inter_module8:continue(AnAtom, Fun). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module4/whereis_intra_inter_module8.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module4/whereis_intra_inter_module8.erl deleted file mode 100644 index 581817308b92..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module4/whereis_intra_inter_module8.erl +++ /dev/null @@ -1,13 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate functions and modules. - --module(whereis_intra_inter_module8). --export([continue/2]). - -continue(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun); - P when is_pid(P) -> - P - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module5/whereis_intra_inter_module10.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module5/whereis_intra_inter_module10.erl deleted file mode 100644 index 7ed50ea742b0..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module5/whereis_intra_inter_module10.erl +++ /dev/null @@ -1,16 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate functions and modules. - --module(whereis_intra_inter_module10). --export([continue/2]). - -continue(AnAtom, Fun) -> - aux(AnAtom, Fun). - -aux(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun); - P when is_pid(P) -> - P - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module5/whereis_intra_inter_module9.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module5/whereis_intra_inter_module9.erl deleted file mode 100644 index 5c5d92b7707a..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module5/whereis_intra_inter_module9.erl +++ /dev/null @@ -1,11 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate functions and modules. - --module(whereis_intra_inter_module9). --export([start/2]). - -start(AnAtom, Fun) -> - register(AnAtom, continue(AnAtom, Fun)). - -continue(AnAtom, Fun) -> - whereis_intra_inter_module10:continue(AnAtom, Fun). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module6/whereis_intra_inter_module11.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module6/whereis_intra_inter_module11.erl deleted file mode 100644 index 82abe2f4a88b..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module6/whereis_intra_inter_module11.erl +++ /dev/null @@ -1,27 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate functions and modules. - --module(whereis_intra_inter_module11). --export([start/2, start_again/2]). - -start(AnAtom, Fun) -> - Pid1 = spawn(Fun), - whereis_intra_inter_module12:no_race(Pid1), - case whereis(AnAtom) of - undefined -> - Pid2 = spawn(Fun), - whereis_intra_inter_module12:race(AnAtom, Pid2); - P when is_pid(P) -> - true - end. - -start_again(AnAtom, Fun) -> - Pid1 = spawn(Fun), - whereis_intra_inter_module12:no_race(Pid1), - case whereis(AnAtom) of - undefined -> - Pid2 = spawn(Fun), - whereis_intra_inter_module12:continue(AnAtom, Pid2); - P when is_pid(P) -> - true - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module6/whereis_intra_inter_module12.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module6/whereis_intra_inter_module12.erl deleted file mode 100644 index c2f5d560a06a..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module6/whereis_intra_inter_module12.erl +++ /dev/null @@ -1,14 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate functions and modules. - --module(whereis_intra_inter_module12). --export([no_race/1, race/2, continue/2]). - -no_race(Pid) -> - register(master, Pid). - -race(Atom, Pid) -> - continue(Atom, Pid). - -continue(Atom, Pid) -> - register(Atom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module7/whereis_intra_inter_module13.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module7/whereis_intra_inter_module13.erl deleted file mode 100644 index 3cd5cc6fa6fe..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module7/whereis_intra_inter_module13.erl +++ /dev/null @@ -1,19 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate functions and modules. - --module(whereis_intra_inter_module13). --export([start/2]). - -start(AnAtom, Fun) -> - Pid1 = spawn(Fun), - whereis_intra_inter_module14:no_race(Pid1), - case whereis(AnAtom) of - undefined -> - Pid2 = spawn(Fun), - continue(AnAtom, Pid2); - P when is_pid(P) -> - true - end. - -continue(Atom, Pid) -> - whereis_intra_inter_module14:race(Atom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module7/whereis_intra_inter_module14.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module7/whereis_intra_inter_module14.erl deleted file mode 100644 index 6b6a982055ac..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module7/whereis_intra_inter_module14.erl +++ /dev/null @@ -1,22 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate functions and modules. - --module(whereis_intra_inter_module14). --export([no_race/1, race/2, start/2]). - -no_race(Pid) -> - register(master, Pid). - -race(Atom, Pid) -> - register(Atom, Pid). - -start(AnAtom, Fun) -> - Pid1 = spawn(Fun), - no_race(Pid1), - case whereis(AnAtom) of - undefined -> - Pid2 = spawn(Fun), - race(AnAtom, Pid2); - P when is_pid(P) -> - true - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module8/whereis_intra_inter_module15.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module8/whereis_intra_inter_module15.erl deleted file mode 100644 index c60d166fa9e7..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module8/whereis_intra_inter_module15.erl +++ /dev/null @@ -1,19 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate functions and modules. - --module(whereis_intra_inter_module15). --export([start/2, continue/2]). - -start(AnAtom, Fun) -> - Pid1 = spawn(Fun), - whereis_intra_inter_module16:no_race(Pid1), - case whereis(AnAtom) of - undefined -> - Pid2 = spawn(Fun), - continue(AnAtom, Pid2); - P when is_pid(P) -> - true - end. - -continue(Atom, Pid) -> - whereis_intra_inter_module16:race(Atom, Pid). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module8/whereis_intra_inter_module16.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module8/whereis_intra_inter_module16.erl deleted file mode 100644 index 279e633d66fa..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_intra_inter_module8/whereis_intra_inter_module16.erl +++ /dev/null @@ -1,22 +0,0 @@ -%% This tests that the race condition detection between whereis/register -%% is robust w.r.t. having the calls in separate functions and modules. - --module(whereis_intra_inter_module16). --export([no_race/1, race/2, start/2]). - -no_race(Pid) -> - register(master, Pid). - -race(Atom, Pid) -> - register(Atom, Pid). - -start(AnAtom, Fun) -> - Pid1 = spawn(Fun), - no_race(Pid1), - case whereis(AnAtom) of - undefined -> - Pid2 = spawn(Fun), - whereis_intra_inter_module15:continue(AnAtom, Pid2); - P when is_pid(P) -> - true - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_param.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_param.erl deleted file mode 100644 index 7bcde321a137..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_param.erl +++ /dev/null @@ -1,16 +0,0 @@ -%% This tests the presence of possible races due to a whereis/register -%% combination in higher order functions. - --module(whereis_param). --export([start/2]). - -start(AnAtom, Fun) -> - register(AnAtom, continue(AnAtom, Fun)). - -continue(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun); - P when is_pid(P) -> - P - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_param_inter_module/whereis_param_inter_module1.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_param_inter_module/whereis_param_inter_module1.erl deleted file mode 100644 index 8bac0326a58d..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_param_inter_module/whereis_param_inter_module1.erl +++ /dev/null @@ -1,8 +0,0 @@ -%% This tests the presence of possible races due to a whereis/register -%% combination in higher order functions and inter-module calls. - --module(whereis_param_inter_module1). --export([start/2]). - -start(AnAtom, Fun) -> - register(AnAtom, whereis_param_inter_module2:continue(AnAtom, Fun)). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_param_inter_module/whereis_param_inter_module2.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_param_inter_module/whereis_param_inter_module2.erl deleted file mode 100644 index 61252add9aa1..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_param_inter_module/whereis_param_inter_module2.erl +++ /dev/null @@ -1,13 +0,0 @@ -%% This tests the presence of possible races due to a whereis/register -%% combination in higher order functions and inter-module calls. - --module(whereis_param_inter_module2). --export([continue/2]). - -continue(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun); - P when is_pid(P) -> - P - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_rec_function1.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_rec_function1.erl deleted file mode 100644 index c8095fbf4c9c..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_rec_function1.erl +++ /dev/null @@ -1,19 +0,0 @@ -%% This tests the presence of possible races due to a whereis/register -%% combination in a recursive function. - --module(whereis_rec_function1). --export([start/2]). - -start(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - case Pid =:= self() of - true -> ok; - false -> - register(AnAtom, Pid), - start(AnAtom, Fun) - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_rec_function2.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_rec_function2.erl deleted file mode 100644 index 2721c9e19cc3..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_rec_function2.erl +++ /dev/null @@ -1,24 +0,0 @@ -%% This tests the presence of possible races due to a register/whereis -%% combination in a recursive function. - --module(whereis_rec_function2). --export([test/0]). - -test() -> - start(undefined, second, mod:f(), self()). - -start(AnAtom, NextAtom, Fun, Id) -> - case AnAtom of - undefined -> register(start, Id); - _ -> register(AnAtom, Id) - end, - case whereis(NextAtom) of - undefined -> - Pid = spawn(Fun), - case Pid =:= self() of - true -> ok; - false -> start(NextAtom, mod:next(), Pid, Id) - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_rec_function3.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_rec_function3.erl deleted file mode 100644 index e101f34fba10..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_rec_function3.erl +++ /dev/null @@ -1,27 +0,0 @@ -%% This tests the presence of possible races due to a register/whereis -%% combination in a recursive function. - --module(whereis_rec_function3). --export([test/0]). - -test() -> - start(undefined, second, mod:f(), self()). - -start(AnAtom, NextAtom, Fun, Id) -> - case AnAtom of - undefined -> register(start, Id); - _ -> register(AnAtom, Id) - end, - Pid = - case whereis(NextAtom) of - undefined -> spawn(Fun); - P1 when is_pid(P1) -> P1 - end, - case whereis(NextAtom) of - undefined -> - case Pid =:= self() of - true -> ok; - false -> start(NextAtom, mod:next(), Pid, Id), io:format("", []) - end; - P2 when is_pid(P2) -> ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_rec_function4.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_rec_function4.erl deleted file mode 100644 index 4894d3397b3d..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_rec_function4.erl +++ /dev/null @@ -1,27 +0,0 @@ -%% This tests the presence of possible races due to a register/whereis -%% combination in an indirectly recursive function. - --module(whereis_rec_function4). --export([test/0]). - -test() -> - start(undefined, second, mod:f(), self()). - -start(AnAtom, NextAtom, Fun, Id) -> - case AnAtom of - undefined -> register(start, Id); - _ -> register(AnAtom, Id) - end, - case whereis(NextAtom) of - undefined -> - Pid = spawn(Fun), - case Pid =:= self() of - true -> ok; - false -> continue(NextAtom, mod:next(), Pid, Id) - end; - P when is_pid(P) -> - ok - end. - -continue(Atom, NextAtom, Fun, Id) -> - start(Atom, NextAtom, Fun, Id). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_rec_function5.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_rec_function5.erl deleted file mode 100644 index d821f829a2ac..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_rec_function5.erl +++ /dev/null @@ -1,21 +0,0 @@ -%% This tests the presence of possible races due to a register/whereis -%% combination in a recursive function. - --module(whereis_rec_function5). --export([start/4]). - -start(AnAtom, NextAtom, Fun, Id) -> - case AnAtom of - undefined -> register(start, Id); - _ -> register(AnAtom, Id) - end, - case whereis(NextAtom) of - undefined -> - Pid = spawn(Fun), - case Pid =:= self() of - true -> ok; - false -> start(NextAtom, mod:next(), Pid, Id) - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_rec_function6.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_rec_function6.erl deleted file mode 100644 index 4ec4baf0be3e..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_rec_function6.erl +++ /dev/null @@ -1,24 +0,0 @@ -%% This tests the presence of possible races due to a register/whereis -%% combination in an indirectly recursive function. - --module(whereis_rec_function6). --export([start/4]). - -start(AnAtom, NextAtom, Fun, Id) -> - case AnAtom of - undefined -> register(start, Id); - _ -> register(AnAtom, Id) - end, - case whereis(NextAtom) of - undefined -> - Pid = spawn(Fun), - case Pid =:= self() of - true -> ok; - false -> continue(NextAtom, mod:next(), Pid, Id) - end; - P when is_pid(P) -> - ok - end. - -continue(Atom, NextAtom, Fun, Id) -> - start(Atom, NextAtom, Fun, Id). diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_rec_function7.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_rec_function7.erl deleted file mode 100644 index 76674431179b..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_rec_function7.erl +++ /dev/null @@ -1,19 +0,0 @@ -%% This tests the presence of possible races due to a whereis/register -%% combination in a recursive function. - --module(whereis_rec_function7). --export([start/2]). - -start(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - case Pid =:= self() of - true -> ok; - false -> - start(AnAtom, Fun), - register(AnAtom, Pid) - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_rec_function8.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_rec_function8.erl deleted file mode 100644 index a06fb75f64ed..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_rec_function8.erl +++ /dev/null @@ -1,22 +0,0 @@ -%% This tests the presence of possible races due to a whereis/register -%% combination in a recursive function. - --module(whereis_rec_function8). --export([test/2]). - -test(AnAtom, Fun) -> - start(AnAtom, Fun). - -start(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - case Pid =:= self() of - true -> ok; - false -> - start(AnAtom, Fun), - register(AnAtom, Pid) - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_try_catch.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_try_catch.erl deleted file mode 100644 index 39bb440f56da..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_try_catch.erl +++ /dev/null @@ -1,25 +0,0 @@ -% This tests that warnings do appear when a whereis/register combination -% is handled by try/catch. - --module(whereis_try_catch). --export([race/1, no_race/1]). - -race(Pid) -> - case whereis(master) of - undefined -> - try - io:format("exception", []) - catch - _ -> register(master, Pid) - end - end. - -no_race(Pid) -> - case whereis(master) of - undefined -> - try - register(master, Pid) - catch - _ -> io:format("exception", []) - end - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars1.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_vars1.erl deleted file mode 100644 index 9b249e72bea1..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars1.erl +++ /dev/null @@ -1,17 +0,0 @@ -%% This tests that no warnings appear when there is no specific -%% information about the types and the variables are not bound. - --module(whereis_vars1). --export([start/3]). - -start(AnAtom, OtherAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - case Pid =:= self() of - true -> ok; - false -> register(OtherAtom, Pid) - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars10.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_vars10.erl deleted file mode 100644 index 5c1896d6b46b..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars10.erl +++ /dev/null @@ -1,22 +0,0 @@ -%% This tests that warnings do appear when there is no specific -%% information about the types and the variables are bound. - --module(whereis_vars10). --export([start/2]). - -start(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - OtherAtom = kostis, - case Pid =:= self() of - true -> ok; - false -> - case AnAtom =/= OtherAtom of - true -> ok; - false -> register(OtherAtom, Pid) - end - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars11.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_vars11.erl deleted file mode 100644 index dc8551b3f2ef..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars11.erl +++ /dev/null @@ -1,22 +0,0 @@ -%% This tests that no warnings appear when there is no specific -%% information about the types and the variables are not bound. - --module(whereis_vars11). --export([start/2]). - -start(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - OtherAtom = kostis, - case Pid =:= self() of - true -> ok; - false -> - case AnAtom of - OtherAtom -> ok; - _Other -> register(OtherAtom, Pid) - end - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars12.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_vars12.erl deleted file mode 100644 index 38b0dc5d04ba..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars12.erl +++ /dev/null @@ -1,22 +0,0 @@ -%% This tests that warnings do appear when there is no specific -%% information about the types and the variables are bound. - --module(whereis_vars12). --export([start/2]). - -start(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - OtherAtom = kostis, - case Pid =:= self() of - true -> ok; - false -> - if - AnAtom =:= OtherAtom -> register(OtherAtom, Pid); - AnAtom =/= OtherAtom -> ok - end - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars13.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_vars13.erl deleted file mode 100644 index 3a04bba02fc8..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars13.erl +++ /dev/null @@ -1,22 +0,0 @@ -%% This tests that warnings do appear when there is no specific -%% information about the types and the variables are bound. - --module(whereis_vars13). --export([start/3]). - -start(AnAtom, APid, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - OtherAtom = kostis, - case Pid =:= self() of - true -> ok; - false -> - if - {AnAtom, Pid} =:= {OtherAtom, APid} -> register(OtherAtom, APid); - {AnAtom, Pid} =/= {OtherAtom, APid} -> ok - end - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars14.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_vars14.erl deleted file mode 100644 index c6888475514e..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars14.erl +++ /dev/null @@ -1,22 +0,0 @@ -%% This tests that warnings do appear when there is no specific -%% information about the types and the variables are bound. - --module(whereis_vars14). --export([start/3]). - -start(AnAtom, APid, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - OtherAtom = kostis, - case Pid =:= self() of - true -> ok; - false -> - if - [AnAtom, Pid] =:= [OtherAtom, APid] -> register(OtherAtom, APid); - [AnAtom, Pid] =/= [OtherAtom, APid] -> ok - end - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars15.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_vars15.erl deleted file mode 100644 index 4b3a72537e21..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars15.erl +++ /dev/null @@ -1,23 +0,0 @@ -%% This tests that warnings do appear when there is no specific -%% information about the types and the variables are bound. - --module(whereis_vars15). --export([start/3]). - -start(AnAtom, OtherAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - case Pid =:= self() of - true -> ok; - false -> - case AnAtom of - maria -> ok; - kostis when AnAtom =:= OtherAtom -> - register(OtherAtom, Pid); - _Other -> ok - end - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars16.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_vars16.erl deleted file mode 100644 index 7badb8df22ac..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars16.erl +++ /dev/null @@ -1,23 +0,0 @@ -%% This tests that warnings do appear when there is no specific -%% information about the types and the variables are bound. - --module(whereis_vars16). --export([start/4]). - -start(AnAtom, OtherAtom, APid, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - case Pid =:= self() of - true -> ok; - false -> - case AnAtom of - maria -> ok; - kostis when {AnAtom, Pid} =:= {OtherAtom, APid} -> - register(OtherAtom, APid); - _Other -> ok - end - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars17.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_vars17.erl deleted file mode 100644 index bc7ef5e98056..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars17.erl +++ /dev/null @@ -1,23 +0,0 @@ -%% This tests that warnings do appear when there is no specific -%% information about the types and the variables are bound. - --module(whereis_vars17). --export([start/4]). - -start(AnAtom, OtherAtom, APid, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - case Pid =:= self() of - true -> ok; - false -> - case AnAtom of - maria -> ok; - kostis when [AnAtom, Pid] =:= [OtherAtom, APid] -> - register(OtherAtom, APid); - _Other -> ok - end - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars18.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_vars18.erl deleted file mode 100644 index 06416fa98796..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars18.erl +++ /dev/null @@ -1,22 +0,0 @@ -%% This tests that no warnings appear when there is no specific -%% information about the types and the variables are not bound. - --module(whereis_vars18). --export([start/2]). - -start(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - OtherAtom = kostis, - case Pid =:= self() of - true -> ok; - false -> - case AnAtom =:= OtherAtom of - true -> ok; - false -> register(OtherAtom, Pid) - end - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars19.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_vars19.erl deleted file mode 100644 index ae5b28e42d98..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars19.erl +++ /dev/null @@ -1,23 +0,0 @@ -%% This tests that no warnings appear when there is no specific -%% information about the types and the variables are not bound. - --module(whereis_vars19). --export([start/3]). - -start(AnAtom, OtherAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - case Pid =:= self() of - true -> ok; - false -> - case AnAtom of - maria -> ok; - kostis when AnAtom =/= OtherAtom -> - register(OtherAtom, Pid); - _Other -> ok - end - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars2.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_vars2.erl deleted file mode 100644 index bafb5d4644e4..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars2.erl +++ /dev/null @@ -1,18 +0,0 @@ -%% This tests that warnings do appear when there is no specific -%% information about the types and the variables are bound. - --module(whereis_vars2). --export([start/2]). - -start(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - OtherAtom = AnAtom, - case Pid =:= self() of - true -> ok; - false -> register(OtherAtom, Pid) - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars20.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_vars20.erl deleted file mode 100644 index 87c6caadf0f6..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars20.erl +++ /dev/null @@ -1,22 +0,0 @@ -%% This tests that no warnings appear when there is no specific -%% information about the types and the variables are not bound. - --module(whereis_vars20). --export([start/2]). - -start(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - OtherAtom = kostis, - case Pid =:= self() of - true -> ok; - false -> - if - AnAtom =:= OtherAtom -> ok; - AnAtom =/= OtherAtom -> register(OtherAtom, Pid) - end - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars21.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_vars21.erl deleted file mode 100644 index 73d22d34675b..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars21.erl +++ /dev/null @@ -1,23 +0,0 @@ -%% This tests that no warnings appear when there is no specific -%% information about the types and the variables are not bound. - --module(whereis_vars21). --export([start/3]). - -start(AnAtom, OtherAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - case Pid =:= self() of - true -> ok; - false -> - case AnAtom of - maria when AnAtom =/= OtherAtom -> ok; - kostis when AnAtom =/= OtherAtom -> - register(OtherAtom, Pid); - _Other -> ok - end - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars22.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_vars22.erl deleted file mode 100644 index dd16928e3318..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars22.erl +++ /dev/null @@ -1,27 +0,0 @@ -%% This tests that warnings do appear when there is no specific -%% information about the types and the variables are bound. - --module(whereis_vars22). --export([start/2]). - -start(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - OtherAtom = kostis, - case Pid =:= self() of - true -> ok; - false -> - Same = - case AnAtom of - OtherAtom -> true; - _Other -> false - end, - case Same of - true -> register(OtherAtom, Pid); - false -> ok - end - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars3.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_vars3.erl deleted file mode 100644 index 16c9a6c8bca8..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars3.erl +++ /dev/null @@ -1,18 +0,0 @@ -%% This tests that warnings do appear when there is no specific -%% information about the types and the variables are bound. - --module(whereis_vars3). --export([start/2]). - -start(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - {OtherAtom, APid} = {AnAtom, Pid}, - case Pid =:= self() of - true -> ok; - false -> register(OtherAtom, APid) - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars4.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_vars4.erl deleted file mode 100644 index da5b329ca9f0..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars4.erl +++ /dev/null @@ -1,18 +0,0 @@ -%% This tests that warnings do appear when there is no specific -%% information about the types and the variables are bound. - --module(whereis_vars4). --export([start/2]). - -start(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - [OtherAtom, APid] = [AnAtom, Pid], - case Pid =:= self() of - true -> ok; - false -> register(OtherAtom, APid) - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars5.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_vars5.erl deleted file mode 100644 index dff8646ea88a..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars5.erl +++ /dev/null @@ -1,22 +0,0 @@ -%% This tests that warnings do appear when there is no specific -%% information about the types and the variables are bound. - --module(whereis_vars5). --export([start/2]). - -start(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - OtherAtom = kostis, - case Pid =:= self() of - true -> ok; - false -> - case AnAtom of - OtherAtom -> register(OtherAtom, Pid); - _Other -> ok - end - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars6.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_vars6.erl deleted file mode 100644 index cf22ab1883dd..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars6.erl +++ /dev/null @@ -1,22 +0,0 @@ -%% This tests that warnings do appear when there is no specific -%% information about the types and the variables are bound. - --module(whereis_vars6). --export([start/2]). - -start(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - OtherAtom = kostis, - case Pid =:= self() of - true -> ok; - false -> - case {AnAtom, Pid} of - {OtherAtom, APid} -> register(OtherAtom, APid); - _Other -> ok - end - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars7.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_vars7.erl deleted file mode 100644 index 4bce53982a2b..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars7.erl +++ /dev/null @@ -1,22 +0,0 @@ -%% This tests that warnings do appear when there is no specific -%% information about the types and the variables are bound. - --module(whereis_vars7). --export([start/2]). - -start(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - OtherAtom = kostis, - case Pid =:= self() of - true -> ok; - false -> - case [AnAtom, Pid] of - [OtherAtom, APid] -> register(OtherAtom, APid); - _Other -> ok - end - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars8.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_vars8.erl deleted file mode 100644 index 937b83cf024f..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars8.erl +++ /dev/null @@ -1,22 +0,0 @@ -%% This tests that warnings do appear when there is no specific -%% information about the types and the variables are bound. - --module(whereis_vars8). --export([start/2]). - -start(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - OtherAtom = kostis, - case Pid =:= self() of - true -> ok; - false -> - case AnAtom =:= OtherAtom of - true -> register(OtherAtom, Pid); - false -> ok - end - end; - P when is_pid(P) -> - ok - end. diff --git a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars9.erl b/lib/dialyzer/test/race_SUITE_data/src/whereis_vars9.erl deleted file mode 100644 index 9beb67ca3854..000000000000 --- a/lib/dialyzer/test/race_SUITE_data/src/whereis_vars9.erl +++ /dev/null @@ -1,22 +0,0 @@ -%% This tests that warnings do appear when there is no specific -%% information about the types and the variables are bound. - --module(whereis_vars9). --export([start/2]). - -start(AnAtom, Fun) -> - case whereis(AnAtom) of - undefined -> - Pid = spawn(Fun), - OtherAtom = kostis, - case Pid =:= self() of - true -> ok; - false -> - case AnAtom == OtherAtom of - true -> register(OtherAtom, Pid); - false -> ok - end - end; - P when is_pid(P) -> - ok - end.