<div dir="ltr">Thanks for a report that includes a way to reproduce the issue!<div><br></div><div>For reference, this has been reported a couple days ago as well: <a href="http://erlang.org/pipermail/erlang-questions/2015-August/085375.html">http://erlang.org/pipermail/erlang-questions/2015-August/085375.html</a></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div><br></div><div><br></div><div><span style="font-size:13px"><div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><b>José Valim</b></span></div><div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><div><span style="font-family:verdana,sans-serif;font-size:x-small"><a href="http://www.plataformatec.com.br/" style="color:rgb(42,93,176)" target="_blank">www.plataformatec.com.br</a></span></div><div><span style="font-family:verdana,sans-serif;font-size:x-small">Skype: jv.ptec</span></div><div><span style="font-family:verdana,sans-serif;font-size:x-small">Founder and Director of R&D</span></div></span></div></span></div></div></div></div></div>
<br><div class="gmail_quote">On Sun, Aug 9, 2015 at 2:53 PM, UENISHI Kota <span dir="ltr"><<a href="mailto:kuenishi@gmail.com" target="_blank">kuenishi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi folks,<br>
I'm asking here as I'm not sure how it should be although this looks<br>
like a bug to me.  Reproduced in MacOS (mine is 10.10.4) AND 18.0<br>
(maint-18 HEAD), but couldn't reproduce in Linux (Ubuntu 14.04) with<br>
18.0 or R16B02 with Mac.<br>
<br>
To reproduce, it's pretty easy: just print out to standard_error by<br>
using io:put_char/1 or io:format/3, with writing a long iolist at<br>
least more than a thousand characters [1]:<br>
<br>
main(_) -><br>
    Arg0 = [ [["1234567890" || _ <- [1,2,3,4,5,6,7,8,9,0]], 32,<br>
integer_to_list(L), $\n]<br>
             || L <- lists:seq(1, 200) ],<br>
    io:format(standard_error, "~p~n", [whereis(standard_error)]),<br>
    R = io:put_chars(standard_error, Arg0),<br>
    io:format(standard_error, "~p, ~p~n", [R, whereis(standard_error)]).<br>
<br>
My result of this code is also copied in that gist [2].<br>
<br>
This phenomena seems to happen when writing a long buffer to FD 2 via<br>
port driver  and suddenly gets EAGAIN back, and the port exits with<br>
that error. I believe standard_error should not exit but should retry<br>
writing when eagain or eintr was received. Thoughts?<br>
<br>
[1] <a href="https://gist.github.com/kuenishi/76333a8a93bc8ccad308#file-stderr-erl" rel="noreferrer" target="_blank">https://gist.github.com/kuenishi/76333a8a93bc8ccad308#file-stderr-erl</a><br>
[2] <a href="https://gist.github.com/kuenishi/76333a8a93bc8ccad308#file-otp-18-0-maint-18-head" rel="noreferrer" target="_blank">https://gist.github.com/kuenishi/76333a8a93bc8ccad308#file-otp-18-0-maint-18-head</a><br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
UENISHI Kota :-)<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</font></span></blockquote></div><br></div>