[erlang-questions] standard_error not handling eagain?

José Valim jose.valim@REDACTED
Sun Aug 9 17:03:33 CEST 2015


Thanks for a report that includes a way to reproduce the issue!

For reference, this has been reported a couple days ago as well:
http://erlang.org/pipermail/erlang-questions/2015-August/085375.html



*José Valim*
www.plataformatec.com.br
Skype: jv.ptec
Founder and Director of R&D

On Sun, Aug 9, 2015 at 2:53 PM, UENISHI Kota <kuenishi@REDACTED> wrote:

> Hi folks,
> I'm asking here as I'm not sure how it should be although this looks
> like a bug to me.  Reproduced in MacOS (mine is 10.10.4) AND 18.0
> (maint-18 HEAD), but couldn't reproduce in Linux (Ubuntu 14.04) with
> 18.0 or R16B02 with Mac.
>
> To reproduce, it's pretty easy: just print out to standard_error by
> using io:put_char/1 or io:format/3, with writing a long iolist at
> least more than a thousand characters [1]:
>
> main(_) ->
>     Arg0 = [ [["1234567890" || _ <- [1,2,3,4,5,6,7,8,9,0]], 32,
> integer_to_list(L), $\n]
>              || L <- lists:seq(1, 200) ],
>     io:format(standard_error, "~p~n", [whereis(standard_error)]),
>     R = io:put_chars(standard_error, Arg0),
>     io:format(standard_error, "~p, ~p~n", [R, whereis(standard_error)]).
>
> My result of this code is also copied in that gist [2].
>
> This phenomena seems to happen when writing a long buffer to FD 2 via
> port driver  and suddenly gets EAGAIN back, and the port exits with
> that error. I believe standard_error should not exit but should retry
> writing when eagain or eintr was received. Thoughts?
>
> [1] https://gist.github.com/kuenishi/76333a8a93bc8ccad308#file-stderr-erl
> [2]
> https://gist.github.com/kuenishi/76333a8a93bc8ccad308#file-otp-18-0-maint-18-head
>
> --
> UENISHI Kota :-)
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150809/a819a11d/attachment.htm>


More information about the erlang-questions mailing list