aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2012-02-23 14:36:49 +0100
committerSverker Eriksson <[email protected]>2012-02-23 14:37:23 +0100
commit3398aa592af611b84edad4fa56e88379df6d1735 (patch)
tree85def0f7ec0332102aa5bc85cd4705c81e1dc982 /lib/stdlib/test
parent045810f873df73a09b105d051eed244be2edf7ee (diff)
parentde742bb6eb202c5a524bab3617a2ede918598705 (diff)
downloadotp-3398aa592af611b84edad4fa56e88379df6d1735.tar.gz
otp-3398aa592af611b84edad4fa56e88379df6d1735.tar.bz2
otp-3398aa592af611b84edad4fa56e88379df6d1735.zip
Merge branch 'sverk/ets-compress-bug' into maint
* sverk/ets-compress-bug: erts: Fail binary_to_term if bignum arity is too large erts: Fix bignum-bug in ETS with compressed option OTP-9932
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r--lib/stdlib/test/ets_SUITE.erl18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/stdlib/test/ets_SUITE.erl b/lib/stdlib/test/ets_SUITE.erl
index 101828fdef..59532b65a0 100644
--- a/lib/stdlib/test/ets_SUITE.erl
+++ b/lib/stdlib/test/ets_SUITE.erl
@@ -72,6 +72,7 @@
exit_many_many_tables_owner/1]).
-export([write_concurrency/1, heir/1, give_away/1, setopts/1]).
-export([bad_table/1, types/1]).
+-export([otp_9932/1]).
-export([otp_9423/1]).
-export([init_per_testcase/2, end_per_testcase/2]).
@@ -145,6 +146,7 @@ all() ->
exit_many_large_table_owner, exit_many_tables_owner,
exit_many_many_tables_owner, write_concurrency, heir,
give_away, setopts, bad_table, types,
+ otp_9932,
otp_9423].
groups() ->
@@ -5434,6 +5436,22 @@ types_do(Opts) ->
?line verify_etsmem(EtsMem).
+%% OTP-9932: Memory overwrite when inserting large integers in compressed bag.
+%% Will crash with segv on 64-bit opt if not fixed.
+otp_9932(Config) when is_list(Config) ->
+ T = ets:new(xxx, [bag, compressed]),
+ Fun = fun(N) ->
+ Key = {1316110174588445 bsl N,1316110174588583 bsl N},
+ S = {Key, Key},
+ true = ets:insert(T, S),
+ [S] = ets:lookup(T, Key),
+ true = ets:insert(T, S),
+ [S] = ets:lookup(T, Key)
+ end,
+ lists:foreach(Fun, lists:seq(0, 16)),
+ ets:delete(T).
+
+
otp_9423(doc) -> ["vm-deadlock caused by race between ets:delete and others on write_concurrency table"];
otp_9423(Config) when is_list(Config) ->
InitF = fun(_) -> {0,0} end,