From 112b7d7a1946f6b90b3497ef4c176c6d066571e2 Mon Sep 17 00:00:00 2001 From: Daniil Fedotov Date: Fri, 16 Jun 2017 17:41:59 +0100 Subject: Support arbitrary crash report in proc_lib. The `error_logger_format_depth` variable is `unlimited` by default. This can cause errors when logging crash reports using sasl logger, because `io_lib:format("~P"...` does not support `unlimited` as a depth parameter. Use formatter string "~p" for unlimited depth. A way to reproduce the error: Start erl with sasl logger: erl -boot start_sasl -sasl errlog_type error -sasl sasl_error_logger tty Report arbitrary error: error_logger:error_report(crash_report, [fake_crash_report, foo]). --- lib/stdlib/src/proc_lib.erl | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/stdlib/src/proc_lib.erl') diff --git a/lib/stdlib/src/proc_lib.erl b/lib/stdlib/src/proc_lib.erl index 9ce8e7d60e..a00221fa6a 100644 --- a/lib/stdlib/src/proc_lib.erl +++ b/lib/stdlib/src/proc_lib.erl @@ -784,6 +784,8 @@ format_link_report([], _, _) -> format_report(Rep, Indent, Extra) when is_list(Rep) -> format_rep(Rep, Indent, Extra); +format_report(Rep, Indent, {Enc,unlimited}) -> + io_lib:format("~s~"++modifier(Enc)++"p~n", [Indent, Rep]); format_report(Rep, Indent, {Enc,Depth}) -> io_lib:format("~s~"++modifier(Enc)++"P~n", [Indent, Rep, Depth]). -- cgit v1.2.3