summaryrefslogtreecommitdiff
path: root/lib/inets
diff options
context:
space:
mode:
authorBjörn Gustavsson <bjorn@erlang.org>2020-02-18 06:26:33 +0100
committerBjörn Gustavsson <bjorn@erlang.org>2020-02-21 10:16:21 +0100
commit38df9be8e5fabf9de15524fe176696b7e3bbeac7 (patch)
tree04d854ba115edc3cd9c0adf424d2f3b9aec90353 /lib/inets
parent468b9a20b7f9d9585df750987b52e9e8f942f0ff (diff)
downloaderlang-38df9be8e5fabf9de15524fe176696b7e3bbeac7.tar.gz
Don't keep stacktraces forever
The `erlang:get_stacktrace/0` BIF retrieves the stacktrace from the previous error in the process. The problem is that the very existence of `erlang:get_stacktrace/0` means that the stacktrace and potentially function arguments must be kept indefinitely. Therefore, in OTP 21, the `erlang:get_stacktrace/0` BIF was deprecated and the syntax of try/catch extended to allow matching out the stacktrace directly. This commit changes `erlang:get_stacktrace/0` for OTP 23 to always return an empty list (`[]`) and eliminates the need to keep the stacktrace forever. `erlang:get_stacktrace/0` is scheduled for removal in OTP 24.
Diffstat (limited to 'lib/inets')
-rw-r--r--lib/inets/test/httpd_SUITE.erl4
-rw-r--r--lib/inets/test/httpd_test_lib.erl8
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/inets/test/httpd_SUITE.erl b/lib/inets/test/httpd_SUITE.erl
index 52dcba94b9..da60a9a9c2 100644
--- a/lib/inets/test/httpd_SUITE.erl
+++ b/lib/inets/test/httpd_SUITE.erl
@@ -773,11 +773,11 @@ post_204(Config) ->
ct:fail({connect_error, ConnectError,
[SockType, Host, Port, TranspOpts]})
catch
- T:E ->
+ T:E:Stk ->
ct:fail({connect_failure,
[{type, T},
{error, E},
- {stacktrace, erlang:get_stacktrace()},
+ {stacktrace, Stk},
{args, [SockType, Host, Port, TranspOpts]}]})
end.
diff --git a/lib/inets/test/httpd_test_lib.erl b/lib/inets/test/httpd_test_lib.erl
index c5efe98555..31a9c72e9c 100644
--- a/lib/inets/test/httpd_test_lib.erl
+++ b/lib/inets/test/httpd_test_lib.erl
@@ -119,11 +119,11 @@ verify_request(SocketType, Host, Port, TranspOpts, Node, RequestStr, Options, Ti
ct:fail({connect_error, ConnectError,
[SocketType, Host, Port, TranspOpts]})
catch
- T:E ->
+ T:E:Stk ->
ct:fail({connect_failure,
[{type, T},
{error, E},
- {stacktrace, erlang:get_stacktrace()},
+ {stacktrace, Stk},
{args, [SocketType, Host, Port, TranspOpts]}]})
end.
@@ -136,11 +136,11 @@ verify_request_N(SocketType, Host, Port, TranspOpts, Node, RequestStr, Options,
ct:fail({connect_error, ConnectError,
[SocketType, Host, Port, TranspOpts]})
catch
- T:E ->
+ T:E:Stk ->
ct:fail({connect_failure,
[{type, T},
{error, E},
- {stacktrace, erlang:get_stacktrace()},
+ {stacktrace, Stk},
{args, [SocketType, Host, Port, TranspOpts]}]})
end.