You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Seeing this when running Erlang.mk tests but very rarely:
RFailed to write log message to stdout, trying stderr
=ERROR REPORT==== 13-Nov-2024::12:24:26.444773 ===
Writer crashed (epipe)
untime terminating during boot ({terminated,[{io,put_chars,["done (passed successfully)\n"],[{file,"io.erl"},{line,198},{error_info,#{cause=>{io,terminated},module=>erl_stdlib_errors}}]},{dialyzer,cl_halt,2,[{file,"dialyzer.erl"},{line,691}]},{init,start_it,1,[]},{init,start_eFailed to write log message to stdout, trying stderr
m,1,[]},{init,do_boot,=ERROR REPORT==== 13-Nov-2024::12:24:26.481899 ===
Error in process <0.10.0> with exit value:
{terminated,[{io,put_chars,
["done (passed successfully)\n"],
[{file,"io.erl"},
{line,198},
{error_info,#{cause => {io,terminated},
module => erl_stdlib_errors}}]},
{dialyzer,cl_halt,2,[{file,"dialyzer.erl"},{line,691}]},
{init,start_it,1,[]},
{init,start_em,1,[]},
{init,do_boot,3,[]}]}
3,[]}]})
Crash dump is being written to: erl_crash.dump...done
To Reproduce
Basically it happens because my tests do dialyzer --something | grep -q value and grep exits before Dialyzer has finished outputting everything.
Presumably this can reproduce eventually but I've only seen it twice:
git clone https://github.com/ninenines/erlang.mk
cd erlang.mk
make check c=dialyzer -j8 -k
Expected behavior
No error message, pipe was closed so Erlang should handle that gracefully.
This is caused by #6253. Before that change the dialyzer process just crashed without anything being logged. Now the crash is logged to stderr.
I think the solution here is to put a catch around the io:format in dialyzer. This error log message may be benign, but if we discard all log messages we will also throw away messages that would have been useful. We could also change io:format to not throw an error when stdout is closed, but just discard the output.
Adding a catch would only accidentally fix it. In my case grep matches on the previous io:format call and closes stdout, making the next io:format fail. But really any io:format after stdout closes could crash.
I think a proper fix would be to detect that stdout was closed normally (SIGPIPE?) and discard the output in that case (the recipient of the output doesn't want it anymore).
Describe the bug
Seeing this when running Erlang.mk tests but very rarely:
To Reproduce
Basically it happens because my tests do
dialyzer --something | grep -q value
andgrep
exits before Dialyzer has finished outputting everything.Presumably this can reproduce eventually but I've only seen it twice:
Expected behavior
No error message, pipe was closed so Erlang should handle that gracefully.
Affected versions
OTP-27.1.2 at least.
Additional context
#3150
The text was updated successfully, but these errors were encountered: