diff options
author | Rickard Green <[email protected]> | 2017-06-08 14:41:24 +0200 |
---|---|---|
committer | Rickard Green <[email protected]> | 2017-06-08 14:41:24 +0200 |
commit | 94379b22116ec5d1efd56a0ace837054b3da6fa2 (patch) | |
tree | 505a13ccadad53d80ac8fba058be6f79916dcc71 /erts/emulator/test | |
parent | b85e77fb68add53eefa8aaa89a1e6f923fda9565 (diff) | |
parent | b1f76e2f15c9d8c741ecb4bddc0b38740f3e7143 (diff) | |
download | otp-94379b22116ec5d1efd56a0ace837054b3da6fa2.tar.gz otp-94379b22116ec5d1efd56a0ace837054b3da6fa2.tar.bz2 otp-94379b22116ec5d1efd56a0ace837054b3da6fa2.zip |
Merge branch 'maint-19' into maint
* maint-19:
Updated OTP version
Update release notes
Update version numbers
erts: Fix so that 81b628 (sigterm=kill) works
Updated OTP version
Prepare release
Update testcase to check that purge handle hibernated process correct
Do not GC hibernated process from other processes
Fix check_process_code() on hibernated process
Unconditionally clear IO buffers on send/shutdown errors
Diffstat (limited to 'erts/emulator/test')
-rw-r--r-- | erts/emulator/test/code_SUITE.erl | 44 |
1 files changed, 41 insertions, 3 deletions
diff --git a/erts/emulator/test/code_SUITE.erl b/erts/emulator/test/code_SUITE.erl index 3ee14f2d1c..1065b56e19 100644 --- a/erts/emulator/test/code_SUITE.erl +++ b/erts/emulator/test/code_SUITE.erl @@ -645,9 +645,40 @@ constant_pools(Config) when is_list(Config) -> erlang:purge_module(literals), OldHeap ! done, receive - {'EXIT',OldHeap,{A,B,C,[1,2,3|_]=Seq}} when length(Seq) =:= 16 -> - ok - end. + {'EXIT',OldHeap,{A,B,C,[1,2,3|_]=Seq}} when length(Seq) =:= 16 -> + ok + end, + + {module,literals} = erlang:load_module(literals, Code), + %% Have a hibernated process that references the literals + %% in the 'literals' module. + {Hib, Mon} = spawn_monitor(fun() -> hibernated(Self) end), + receive go -> ok end, + [{heap_size,OldHeapSz}, + {total_heap_size,OldTotHeapSz}] = process_info(Hib, [heap_size, + total_heap_size]), + OldHeapSz = OldTotHeapSz, + io:format("OldHeapSz=~p OldTotHeapSz=~p~n", [OldHeapSz, OldTotHeapSz]), + true = erlang:delete_module(literals), + false = erlang:check_process_code(Hib, literals), + erlang:check_process_code(self(), literals), + erlang:purge_module(literals), + receive after 1000 -> ok end, + [{heap_size,HeapSz}, + {total_heap_size,TotHeapSz}] = process_info(Hib, [heap_size, + total_heap_size]), + io:format("HeapSz=~p TotHeapSz=~p~n", [HeapSz, TotHeapSz]), + Hib ! hej, + receive + {'DOWN', Mon, process, Hib, Reason} -> + {undef, [{no_module, + no_function, + [{A,B,C,[1,2,3|_]=Seq}], _}]} = Reason, + 16 = length(Seq) + end, + HeapSz = TotHeapSz, %% Ensure restored to hibernated state... + true = HeapSz > OldHeapSz, + ok. no_old_heap(Parent) -> A = literals:a(), @@ -670,6 +701,13 @@ old_heap(Parent) -> exit(Res) end. +hibernated(Parent) -> + A = literals:a(), + B = literals:b(), + Res = {A,B,literals:huge_bignum(),lists:seq(1, 16)}, + Parent ! go, + erlang:hibernate(no_module, no_function, [Res]). + create_old_heap() -> case process_info(self(), [heap_size,total_heap_size]) of [{heap_size,Sz},{total_heap_size,Total}] when Sz < Total -> |