-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugIssue is reported as a bugIssue is reported as a bugteam:VMAssigned to OTP team VMAssigned to OTP team VM
Description
Describe the bug
logger logs REPORT_CB/2 CRASH when using formatter config single_line => false, chars_limit => 32768
To Reproduce
Run erl and evaluate two expressions:
> logger:set_handler_config(default, formatter, {logger_formatter, #{single_line => false, chars_limit => 32768}}).
> proc_lib:spawn(fun() -> ets:first(a) end).
Expected behavior
Crash report is formatted nicely
Affected versions
- OTP 25.2
Additional context
-
Suspicious code lines
- https://github.com/erlang/otp/blob/master/lib/stdlib/src/erl_error.erl#L324
- calls
sub/3withEncas 2nd arg
- calls
- https://github.com/erlang/otp/blob/master/lib/stdlib/src/erl_error.erl#L559-L561
- on the other hand,
Encseems the 3rd arg ofsub/3
- on the other hand,
- https://github.com/erlang/otp/blob/master/lib/stdlib/src/erl_error.erl#L324
-
Sample output of reproduce steps:
% erl
Erlang/OTP 25 [erts-13.1.3] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit:ns]
Eshell V13.1.3 (abort with ^G)
1> logger:set_handler_config(default, formatter, {logger_formatter, #{single_line => false, chars_limit => 32768}}).
ok
2> proc_lib:spawn(fun() -> ets:first(a) end).
<0.104.0>
3> 2022-12-22T11:41:57.342140+09:00 error:
REPORT_CB/2 CRASH: #{label => {proc_lib,crash},
report =>
[[{initial_call,{erl_eval,'-expr/6-fun-2-',[]}},
{pid,<0.104.0>},
{registered_name,[]},
{error_info,
{error,badarg,
[{ets,first,
[a],
[{error_info,
#{cause => id,module => erl_stdlib_errors}}]},
{proc_lib,init_p,3,
[{file,"proc_lib.erl"},{line,225}]}]}},
{ancestors,[<0.100.0>]},
{message_queue_len,0},
{messages,[]},
{links,[]},
{dictionary,[]},
{trap_exit,false},
{status,running},
{heap_size,233},
{stack_size,28},
{reductions,169}],
[]]}; Reason: {error,function_clause,
[{unicode_util,cp,
[utf8],
[{file,"unicode_util.erl"},
{line,293}]},
{unicode_util,gc,1,
[{file,"unicode_util.erl"},
{line,393}]},
{string,length_1,2,
[{file,"string.erl"},{line,554}]},
{erl_error,sub,3,
[{file,"erl_error.erl"},{line,561}]},
{erl_error,format_stacktrace2,8,
[{file,"erl_error.erl"},{line,324}]},
{erl_error,format_exception,8,
[{file,"erl_error.erl"},{line,101}]},
{proc_lib,format_exception,5,
[{file,"proc_lib.erl"},{line,980}]},
{proc_lib,format_own_report,6,
[{file,"proc_lib.erl"},{line,881}]}]}
Metadata
Metadata
Assignees
Labels
bugIssue is reported as a bugIssue is reported as a bugteam:VMAssigned to OTP team VMAssigned to OTP team VM