aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2017-04-05 14:32:16 +0200
committerRickard Green <[email protected]>2017-04-07 15:02:10 +0200
commit8f452530e61b299d4d48f82f41ab5364723607ae (patch)
tree29bc2e4cfac2bcd5fdc4cdee4996a39350a1a32a /erts/emulator/test
parent671d690debf653a6b1e86c3e7880b9c5640b1324 (diff)
downloadotp-8f452530e61b299d4d48f82f41ab5364723607ae.tar.gz
otp-8f452530e61b299d4d48f82f41ab5364723607ae.tar.bz2
otp-8f452530e61b299d4d48f82f41ab5364723607ae.zip
Stack guard for PCRE
Diffstat (limited to 'erts/emulator/test')
-rw-r--r--erts/emulator/test/erts_debug_SUITE.erl14
1 files changed, 12 insertions, 2 deletions
diff --git a/erts/emulator/test/erts_debug_SUITE.erl b/erts/emulator/test/erts_debug_SUITE.erl
index 23871585f7..c9c664de38 100644
--- a/erts/emulator/test/erts_debug_SUITE.erl
+++ b/erts/emulator/test/erts_debug_SUITE.erl
@@ -23,14 +23,15 @@
-export([all/0, suite/0,
test_size/1,flat_size_big/1,df/1,term_type/1,
- instructions/1]).
+ instructions/1, stack_check/1]).
suite() ->
[{ct_hooks,[ts_install_cth]},
{timetrap, {minutes, 2}}].
all() ->
- [test_size, flat_size_big, df, instructions, term_type].
+ [test_size, flat_size_big, df, instructions, term_type,
+ stack_check].
test_size(Config) when is_list(Config) ->
ConsCell1 = id([a|b]),
@@ -181,6 +182,15 @@ df(Config) when is_list(Config) ->
true = (P0 == pps()),
ok.
+stack_check(Config) when is_list(Config) ->
+ erts_debug:set_internal_state(available_internal_state,true),
+ %% Recurses on the C stack until stacklimit is reached. That
+ %% is, tests that the stack limit functionality works (used
+ %% by PCRE). VM will crash if it doesn't work...
+ Size = erts_debug:get_internal_state(stack_check),
+ erts_debug:set_internal_state(available_internal_state,false),
+ {comment, "Stack size: "++integer_to_list(Size)++" bytes"}.
+
df_smoke([M|Ms]) ->
io:format("~p", [M]),
erts_debug:df(M),