[erlang-questions] standard_error not handling eagain?
Sun Aug 9 14:53:29 CEST 2015
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 :
Arg0 = [ [["1234567890" || _ <- [1,2,3,4,5,6,7,8,9,0]], 32,
|| 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 .
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?
UENISHI Kota :-)
More information about the erlang-questions