aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test/beam_lib_SUITE.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-09-28 11:08:06 +0200
committerBjörn Gustavsson <[email protected]>2011-09-28 11:08:06 +0200
commitb83073436a39553da458b19ef572ded9cd051611 (patch)
tree2f26fb6d7f55dcc1b617fd3b9f652d2fb259547e /lib/stdlib/test/beam_lib_SUITE.erl
parenta1e73008b8dc8161922b1a47ffad4a4b61885ef8 (diff)
parentbc4362edacedb40c6edb9e855aa234c066b8292f (diff)
downloadotp-b83073436a39553da458b19ef572ded9cd051611.tar.gz
otp-b83073436a39553da458b19ef572ded9cd051611.tar.bz2
otp-b83073436a39553da458b19ef572ded9cd051611.zip
Merge branch 'bjorn/stdlib/fix-beam_lib-race/OTP-9586' into dev
* bjorn/stdlib/fix-beam_lib-race/OTP-9586: beam_lib: Handle rare race in the crypto key server functionality
Diffstat (limited to 'lib/stdlib/test/beam_lib_SUITE.erl')
-rw-r--r--lib/stdlib/test/beam_lib_SUITE.erl10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/stdlib/test/beam_lib_SUITE.erl b/lib/stdlib/test/beam_lib_SUITE.erl
index 91fff3cee4..27520a5c88 100644
--- a/lib/stdlib/test/beam_lib_SUITE.erl
+++ b/lib/stdlib/test/beam_lib_SUITE.erl
@@ -571,8 +571,18 @@ do_encrypted_abstr(Beam, Key) ->
?line {ok,{simple,[{"Abst",Abst}]}} = beam_lib:chunks(Beam, ["Abst"]),
?line {ok,cleared} = beam_lib:clear_crypto_key_fun(),
+
+ %% Try to force a stop/start race.
+ ?line start_stop_race(10000),
+
ok.
+start_stop_race(0) ->
+ ok;
+start_stop_race(N) ->
+ {error,_} = beam_lib:crypto_key_fun(bad_fun),
+ undefined = beam_lib:clear_crypto_key_fun(),
+ start_stop_race(N-1).
bad_fun(F) ->
{error,E} = beam_lib:crypto_key_fun(F),