aboutsummaryrefslogtreecommitdiffstats
path: root/lib/observer/src/crashdump_viewer.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2017-12-27 11:50:59 +0100
committerSiri Hansen <[email protected]>2018-01-03 10:55:30 +0100
commitb591bc32b73241032d4ba7c54f214f68d8b3b983 (patch)
tree9cce3637ff57398bd8000ca059b1b2ae937abeec /lib/observer/src/crashdump_viewer.erl
parent0c08677522f1add0f6161328a0009e3ac3401f1e (diff)
downloadotp-b591bc32b73241032d4ba7c54f214f68d8b3b983.tar.gz
otp-b591bc32b73241032d4ba7c54f214f68d8b3b983.tar.bz2
otp-b591bc32b73241032d4ba7c54f214f68d8b3b983.zip
[cdv] Don't crash when dump is truncated in module attributes
This bug was introduced by commit 3b964e8dbaa0cd73ca7a983b3ce948e0dbd2c35c
Diffstat (limited to 'lib/observer/src/crashdump_viewer.erl')
-rw-r--r--lib/observer/src/crashdump_viewer.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/observer/src/crashdump_viewer.erl b/lib/observer/src/crashdump_viewer.erl
index feaec5c678..c100e8d057 100644
--- a/lib/observer/src/crashdump_viewer.erl
+++ b/lib/observer/src/crashdump_viewer.erl
@@ -2027,12 +2027,16 @@ all_modinfo(Fd,LM,LineHead,DecodeOpts) ->
end.
get_attribute(Fd, DecodeOpts) ->
+ Term = do_get_attribute(Fd, DecodeOpts),
+ io_lib:format("~tp~n",[Term]).
+
+do_get_attribute(Fd, DecodeOpts) ->
Bytes = bytes(Fd, ""),
try get_binary(Bytes, DecodeOpts) of
{Bin,_} ->
try binary_to_term(Bin) of
Term ->
- io_lib:format("~tp~n",[Term])
+ Term
catch
_:_ ->
{"WARNING: The term is probably truncated!",