diff options
author | José Valim <[email protected]> | 2017-05-10 14:20:13 +0200 |
---|---|---|
committer | José Valim <[email protected]> | 2017-05-15 16:27:39 +0200 |
commit | 7ff352ef8a5393a017ce493ba1a1fc3be54be245 (patch) | |
tree | 4623c2cbe6a4f25b9983f011a30be621bcc8fa5c /scripts | |
parent | 8baada6ba97f7809c99cae4e799fddb273a54882 (diff) | |
download | otp-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 'scripts')
0 files changed, 0 insertions, 0 deletions