aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test
diff options
context:
space:
mode:
authorJosé Valim <[email protected]>2017-05-10 14:20:13 +0200
committerJosé Valim <[email protected]>2017-05-15 16:27:39 +0200
commit7ff352ef8a5393a017ce493ba1a1fc3be54be245 (patch)
tree4623c2cbe6a4f25b9983f011a30be621bcc8fa5c /lib/stdlib/test
parent8baada6ba97f7809c99cae4e799fddb273a54882 (diff)
downloadotp-7ff352ef8a5393a017ce493ba1a1fc3be54be245.tar.gz
otp-7ff352ef8a5393a017ce493ba1a1fc3be54be245.tar.bz2
otp-7ff352ef8a5393a017ce493ba1a1fc3be54be245.zip
Do not discard stacktraces on gen_server exits
Prior to this patch, the stacktrace of an error or exit in a callback would always be discarded in crash reports. For example, an exit(crashed) in handle_call/3 would emit: =CRASH REPORT==== 10-May-2017::14:15:50 === crasher: initial call: gen_server_SUITE:init/1 pid: <0.201.0> registered_name: [] exception exit: crashed in function gen_server:terminate/8 (src/gen_server.erl, line 828) Note that the stacktrace is pointing to the gen_server internal terminate implementation that calls exit/1. This patch uses erlang:raise/3 so the stacktrace is not lost, allowing proc_lib to show the class, reason and stacktrace coming from the user implementation (in this case gen_server_SUITE): =CRASH REPORT==== 10-May-2017::14:16:44 === crasher: initial call: gen_server_SUITE:init/1 pid: <0.197.0> registered_name: [] exception exit: crashed in function gen_server_SUITE:handle_call/3 (gen_server_SUITE.erl, line 1529) This change is completely backwards compatible as using erlang:raise/3 will still emit the same exit reason to any linked process and monitor as before.
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r--lib/stdlib/test/gen_server_SUITE.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/stdlib/test/gen_server_SUITE.erl b/lib/stdlib/test/gen_server_SUITE.erl
index 7e3c71715e..2e9dc4d4fb 100644
--- a/lib/stdlib/test/gen_server_SUITE.erl
+++ b/lib/stdlib/test/gen_server_SUITE.erl
@@ -404,7 +404,7 @@ crash(Config) when is_list(Config) ->
end,
receive
{error_report,_,{Pid4,crash_report,[List4|_]}} ->
- {exit,crashed,_} = proplists:get_value(error_info, List4),
+ {exit,crashed,[{?MODULE, handle_call, 3, _}|_]} = proplists:get_value(error_info, List4),
Pid4 = proplists:get_value(pid, List4);
Other4 ->
io:format("Unexpected: ~p", [Other4]),