diff options
author | Sverker Eriksson <[email protected]> | 2017-07-11 19:33:19 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2017-07-11 19:35:47 +0200 |
commit | 5e8f74d6c2d98f22e5f32e866064974de6ee4e33 (patch) | |
tree | 3b3a0001c09d31489e1b35da0dd93e29f21c46da /erts/emulator/test/nif_SUITE.erl | |
parent | 040bdce67f88d833bfb59adae130a4ffb4c180f0 (diff) | |
download | otp-5e8f74d6c2d98f22e5f32e866064974de6ee4e33.tar.gz otp-5e8f74d6c2d98f22e5f32e866064974de6ee4e33.tar.bz2 otp-5e8f74d6c2d98f22e5f32e866064974de6ee4e33.zip |
erts: Fix bug in enif_whereis_pid/port
that could cause heap corruption if
whereis lookup conflicts with other register updater
AND other thread sends on-heap message while main lock is released.
Also improved enif_whereis from dirty nifs by passing c_p as NULL.
Diffstat (limited to 'erts/emulator/test/nif_SUITE.erl')
-rw-r--r-- | erts/emulator/test/nif_SUITE.erl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/erts/emulator/test/nif_SUITE.erl b/erts/emulator/test/nif_SUITE.erl index 05c250125d..0337274178 100644 --- a/erts/emulator/test/nif_SUITE.erl +++ b/erts/emulator/test/nif_SUITE.erl @@ -2886,11 +2886,15 @@ nif_whereis_parallel(Config) when is_list(Config) -> true = lists:all(PidReg, Procs), %% tell them all to 'fire' as fast as we can - [P ! {Ref, send_proc} || {_, P, _} <- Procs], + repeat(10, fun(_) -> + [P ! {Ref, send_proc} || {_, P, _} <- Procs] + end, void), %% each gets forwarded through two processes - true = lists:all(RecvNum, NSeq), - true = lists:all(RecvNum, NSeq), + repeat(10, fun(_) -> + true = lists:all(RecvNum, NSeq), + true = lists:all(RecvNum, NSeq) + end, void), %% tell them all to 'quit' by name [N ! {Ref, quit} || {N, _, _} <- Procs], |