diff options
author | Sverker Eriksson <[email protected]> | 2017-11-06 17:59:28 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2017-11-06 17:59:28 +0100 |
commit | d563fdd7f3bfa5df218e3965ca45a0348514a2a7 (patch) | |
tree | 378f0a097e6308de1fa9664578439c74820d1f9b /erts/emulator/test/process_SUITE.erl | |
parent | 07b8f441ca711f9812fad9e9115bab3c3aa92f79 (diff) | |
download | otp-d563fdd7f3bfa5df218e3965ca45a0348514a2a7.tar.gz otp-d563fdd7f3bfa5df218e3965ca45a0348514a2a7.tar.bz2 otp-d563fdd7f3bfa5df218e3965ca45a0348514a2a7.zip |
erts: Fix bug in systask scheduling
when request id is an immediate.
Ex:
erlang:garbage_collect(P, [{async,Immediate}]).
may crash the VM.
Diffstat (limited to 'erts/emulator/test/process_SUITE.erl')
-rw-r--r-- | erts/emulator/test/process_SUITE.erl | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/erts/emulator/test/process_SUITE.erl b/erts/emulator/test/process_SUITE.erl index bf31655066..932d0f87f1 100644 --- a/erts/emulator/test/process_SUITE.erl +++ b/erts/emulator/test/process_SUITE.erl @@ -2365,8 +2365,13 @@ system_task_on_suspended(Config) when is_list(Config) -> end. gc_request_when_gc_disabled(Config) when is_list(Config) -> - Master = self(), AIS = erts_debug:set_internal_state(available_internal_state, true), + gc_request_when_gc_disabled_do(ref), + gc_request_when_gc_disabled_do(immed), + erts_debug:set_internal_state(available_internal_state, AIS). + +gc_request_when_gc_disabled_do(ReqIdType) -> + Master = self(), {P, M} = spawn_opt(fun () -> true = erts_debug:set_internal_state(gc_state, false), @@ -2378,7 +2383,10 @@ gc_request_when_gc_disabled(Config) when is_list(Config) -> receive after 100 -> ok end end, [monitor, link]), receive {P, gc_state, false} -> ok end, - ReqId = make_ref(), + ReqId = case ReqIdType of + ref -> make_ref(); + immed -> immed + end, async = garbage_collect(P, [{async, ReqId}]), receive {garbage_collect, ReqId, Result} -> @@ -2387,7 +2395,6 @@ gc_request_when_gc_disabled(Config) when is_list(Config) -> ok end, receive {garbage_collect, ReqId, true} -> ok end, - erts_debug:set_internal_state(available_internal_state, AIS), receive {'DOWN', M, process, P, _Reason} -> ok end, ok. |