Skip to content

Commit

Permalink
Disable application_controller hijacking (re-opens #2)
Browse files Browse the repository at this point in the history
Application controller has inner state that is not guaranteed to be restored
after completion of an interleaving and needs to be checked.
  • Loading branch information
aronisstav committed Jun 2, 2014
1 parent 3c43099 commit fb41833
Show file tree
Hide file tree
Showing 12 changed files with 4,504 additions and 336 deletions.
3 changes: 2 additions & 1 deletion src/concuerror_callback.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1566,8 +1566,9 @@ system_processes_wrappers(Info) ->
Name <- Registered,
hijacked =:= hijack_or_wrap_system(Name, Info)].

%% XXX: Application controller support needs to be checked
hijack_or_wrap_system(Name, Info)
when Name =:= application_controller ->
when Name =:= application_controller_disabled ->
#concuerror_info{
logger = Logger,
modules = Modules,
Expand Down
2,417 changes: 2,129 additions & 288 deletions tests-long/suites/gproc/ref/t_reg_or_locate2.out

Large diffs are not rendered by default.

55 changes: 36 additions & 19 deletions tests-long/suites/gproc/ref/t_simple_reg.out
Original file line number Diff line number Diff line change
Expand Up @@ -14,47 +14,64 @@ Concuerror started with options:
{print_depth,20},
{quiet,true},
{scheduling,round_robin},
{show_races,true},
{strict_scheduling,false},
{symbolic_names,true},
{timeout,infinity},
{treat_as_normal,[shutdown]}]
################################################################################
No errors found!
################################################################################
Concuerror Warnings:
--------------------------------------------------------------------------------
Some abnormal exit reasons were treated as normal (--treat_as_normal).
################################################################################
Concuerror Tips:
--------------------------------------------------------------------------------
An abnormal exit signal was sent to a process. This is probably the worst thing that can happen race-wise, as any other side-effecting operation races with the arrival of the signal. If the test produces too many interleavings consider refactoring your code.
################################################################################
Concuerror Info:
--------------------------------------------------------------------------------
Instrumented: test
Instrumented: io_lib
Instrumented: gproc_sup
Instrumented: supervisor
Instrumented: gen_server
Hijacked application_controller
Instrumented: application
Instrumented: application_controller
Instrumented: gen
Instrumented: code
Instrumented: code_server
Instrumented: erl_prim_loader
Instrumented: filename
Instrumented: epp
Instrumented: proplists
Instrumented: erl_scan
Instrumented: lists
Instrumented: erl_parse
Instrumented: init
Instrumented: application_master
Instrumented: proc_lib
Instrumented: gproc_app
Instrumented: gproc_sup
Instrumented: supervisor
Instrumented: erlang
Instrumented: init
Instrumented: sys
Instrumented: application
Instrumented: application_controller
Instrumented: lists
Instrumented: gproc
Instrumented: gproc_lib
Instrumented: error_logger
Instrumented: gen_event
Instrumented: gproc_monitor
Instrumented: gproc_bcast
Instrumented: gproc_pool
Some errors were silenced (--ignore_error).
################################################################################
Concuerror Race Pairs (turn off with: --show_races false):
--------------------------------------------------------------------------------
You can disable race pair messages with --show_races false
* <0.88.0>: true = ets:delete(gproc, {<0.60.0>,l})
in gproc.erl line 2373
is in race with
Exit signal (shutdown) from <0.73.0> reaches <0.88.0>
* <0.88.0>: 0 = ets:select_delete(gproc, [{{{<0.60.0>,...},'_'},[],[...]}])
in gproc.erl line 2372
is in race with
Exit signal (shutdown) from <0.73.0> reaches <0.88.0>
* <0.88.0>: [] = ets:select(gproc, [{{{<0.60.0>,...},'$2'},[{...}],[...]}])
in gproc.erl line 2317
is in race with
Exit signal (shutdown) from <0.73.0> reaches <0.88.0>
* <0.88.0>: true = ets:member(gproc, {<0.60.0>,l})
in gproc.erl line 2313
is in race with
Exit signal (shutdown) from <0.73.0> reaches <0.88.0>
################################################################################
Done! (Exit status: completed)
Summary: 0 errors, 1/1 interleavings explored
Summary: 0 errors, 5/5 interleavings explored
71 changes: 52 additions & 19 deletions tests-long/suites/gproc/ref/t_simple_reg_or_locate.out
Original file line number Diff line number Diff line change
Expand Up @@ -14,47 +14,80 @@ Concuerror started with options:
{print_depth,20},
{quiet,true},
{scheduling,round_robin},
{show_races,true},
{strict_scheduling,false},
{symbolic_names,true},
{timeout,infinity},
{treat_as_normal,[shutdown]}]
################################################################################
No errors found!
################################################################################
Concuerror Warnings:
--------------------------------------------------------------------------------
Some abnormal exit reasons were treated as normal (--treat_as_normal).
################################################################################
Concuerror Tips:
--------------------------------------------------------------------------------
An abnormal exit signal was sent to a process. This is probably the worst thing that can happen race-wise, as any other side-effecting operation races with the arrival of the signal. If the test produces too many interleavings consider refactoring your code.
################################################################################
Concuerror Info:
--------------------------------------------------------------------------------
Instrumented: test
Instrumented: io_lib
Instrumented: gproc_sup
Instrumented: supervisor
Instrumented: gen_server
Hijacked application_controller
Instrumented: application
Instrumented: application_controller
Instrumented: gen
Instrumented: code
Instrumented: code_server
Instrumented: erl_prim_loader
Instrumented: filename
Instrumented: epp
Instrumented: proplists
Instrumented: erl_scan
Instrumented: lists
Instrumented: erl_parse
Instrumented: init
Instrumented: application_master
Instrumented: proc_lib
Instrumented: gproc_app
Instrumented: gproc_sup
Instrumented: supervisor
Instrumented: erlang
Instrumented: init
Instrumented: sys
Instrumented: application
Instrumented: application_controller
Instrumented: lists
Instrumented: gproc
Instrumented: gproc_lib
Instrumented: error_logger
Instrumented: gen_event
Instrumented: gproc_monitor
Instrumented: gproc_bcast
Instrumented: gproc_pool
Some errors were silenced (--ignore_error).
################################################################################
Concuerror Race Pairs (turn off with: --show_races false):
--------------------------------------------------------------------------------
You can disable race pair messages with --show_races false
* <0.88.0>: true = ets:delete(gproc, {<0.60.0>,l})
in gproc.erl line 2373
is in race with
Exit signal (shutdown) from <0.73.0> reaches <0.88.0>
* <0.88.0>: 2 = ets:select_delete(gproc, [{{{<0.60.0>,...},'_'},[],[...]}])
in gproc.erl line 2372
is in race with
Exit signal (shutdown) from <0.73.0> reaches <0.88.0>
* <0.88.0>: true = ets:delete(gproc, {{n,l,name2},n})
in gproc.erl line 2325
is in race with
Exit signal (shutdown) from <0.73.0> reaches <0.88.0>
* <0.88.0>: [{{{n,...},n},<0.60.0>,my_val}] = ets:lookup(gproc, {{n,l,name2},n})
in gproc.erl line 2323
is in race with
Exit signal (shutdown) from <0.73.0> reaches <0.88.0>
* <0.88.0>: true = ets:delete(gproc, {{n,l,name},n})
in gproc.erl line 2325
is in race with
Exit signal (shutdown) from <0.73.0> reaches <0.88.0>
* <0.88.0>: [{{{n,...},n},<0.60.0>,undefined}] = ets:lookup(gproc, {{n,l,name},n})
in gproc.erl line 2323
is in race with
Exit signal (shutdown) from <0.73.0> reaches <0.88.0>
* <0.88.0>: [{{n,l,...},[]},{{n,...},[]}] = ets:select(gproc, [{{{<0.60.0>,...},'$2'},[{...}],[...]}])
in gproc.erl line 2317
is in race with
Exit signal (shutdown) from <0.73.0> reaches <0.88.0>
* <0.88.0>: true = ets:member(gproc, {<0.60.0>,l})
in gproc.erl line 2313
is in race with
Exit signal (shutdown) from <0.73.0> reaches <0.88.0>
################################################################################
Done! (Exit status: completed)
Summary: 0 errors, 1/1 interleavings explored
Summary: 0 errors, 9/9 interleavings explored
61 changes: 58 additions & 3 deletions tests-long/suites/gproc/ref/test3.out
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Concuerror started with options:
{print_depth,20},
{quiet,true},
{scheduling,round_robin},
{show_races,true},
{strict_scheduling,false},
{symbolic_names,true},
{timeout,infinity},
Expand All @@ -33,10 +34,9 @@ Concuerror Info:
--------------------------------------------------------------------------------
Instrumented: test
Instrumented: io_lib
Instrumented: gen_server
Hijacked application_controller
Instrumented: gproc_sup
Instrumented: supervisor
Instrumented: gen_server
Instrumented: gen
Instrumented: proc_lib
Instrumented: erlang
Expand All @@ -53,5 +53,60 @@ Instrumented: gproc_monitor
Instrumented: gproc_bcast
Instrumented: gproc_pool
################################################################################
Concuerror Race Pairs (turn off with: --show_races false):
--------------------------------------------------------------------------------
You can disable race pair messages with --show_races false
* Message ({token,[]}) from <0.60.0> reaches <0.102.0>
is in race with
Message ({#Ref<0.0.0.568>,true}) from <0.88.0> reaches <0.102.0>
* <0.88.0>: true = ets:delete(gproc, {<0.102.0>,l})
in gproc.erl line 2373
is in race with
Exit signal (shutdown) from <0.73.0> reaches <0.88.0>
* <0.88.0>: 1 = ets:select_delete(gproc, [{{{<0.102.0>,...},'_'},[],[...]}])
in gproc.erl line 2372
is in race with
Exit signal (shutdown) from <0.73.0> reaches <0.88.0>
* <0.88.0>: true = ets:delete(gproc, {{n,l,name},n})
in gproc.erl line 2325
is in race with
Exit signal (shutdown) from <0.73.0> reaches <0.88.0>
* <0.88.0>: [{{{n,...},n},<0.102.0>,undefined}] = ets:lookup(gproc, {{n,l,name},n})
in gproc.erl line 2323
is in race with
Exit signal (shutdown) from <0.73.0> reaches <0.88.0>
* <0.88.0>: [{{n,l,...},[]}] = ets:select(gproc, [{{{<0.102.0>,...},'$2'},[{...}],[...]}])
in gproc.erl line 2317
is in race with
Exit signal (shutdown) from <0.73.0> reaches <0.88.0>
* <0.88.0>: true = ets:member(gproc, {<0.102.0>,l})
in gproc.erl line 2313
is in race with
Exit signal (shutdown) from <0.73.0> reaches <0.88.0>
* <0.88.0>: true = ets:delete(gproc, {<0.102.0>,l})
in gproc.erl line 2373
is in race with
Exit signal (shutdown) from <0.73.0> reaches <0.88.0>
* <0.88.0>: 1 = ets:select_delete(gproc, [{{{<0.102.0>,...},'_'},[],[...]}])
in gproc.erl line 2372
is in race with
Exit signal (shutdown) from <0.73.0> reaches <0.88.0>
* <0.88.0>: true = ets:delete(gproc, {{n,l,name},n})
in gproc.erl line 2325
is in race with
Exit signal (shutdown) from <0.73.0> reaches <0.88.0>
* <0.88.0>: [{{{n,...},n},<0.102.0>,undefined}] = ets:lookup(gproc, {{n,l,name},n})
in gproc.erl line 2323
is in race with
Exit signal (shutdown) from <0.73.0> reaches <0.88.0>
* <0.88.0>: [{{n,l,...},[]}] = ets:select(gproc, [{{{<0.102.0>,...},'$2'},[{...}],[...]}])
in gproc.erl line 2317
is in race with
Exit signal (shutdown) from <0.73.0> reaches <0.88.0>
* <0.88.0>: true = ets:member(gproc, {<0.102.0>,l})
in gproc.erl line 2313
is in race with
Exit signal (shutdown) from <0.73.0> reaches <0.88.0>
################################################################################
Done! (Exit status: completed)
Summary: 0 errors, 7/7 interleavings explored
Summary: 0 errors, 14/14 interleavings explored
Loading

0 comments on commit fb41833

Please sign in to comment.