aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHenrik Nord <[email protected]>2015-08-20 10:14:16 +0200
committerHenrik Nord <[email protected]>2015-08-20 10:14:16 +0200
commite3a5ad489d6e6cc190b609f8648b6af993c1b333 (patch)
treee1d401a2e0a74ba22f6d5b908a793eea8b37f88b /lib
parenta2670f0822fc6729df956c8ec8c381340ff0a5fb (diff)
parent6b4c2dbd1b4a30f421611987acec6315c62ac9d5 (diff)
downloadotp-e3a5ad489d6e6cc190b609f8648b6af993c1b333.tar.gz
otp-e3a5ad489d6e6cc190b609f8648b6af993c1b333.tar.bz2
otp-e3a5ad489d6e6cc190b609f8648b6af993c1b333.zip
Merge branch 'maint-18' into maint
Diffstat (limited to 'lib')
-rw-r--r--lib/kernel/test/standard_error_SUITE.erl31
1 files changed, 29 insertions, 2 deletions
diff --git a/lib/kernel/test/standard_error_SUITE.erl b/lib/kernel/test/standard_error_SUITE.erl
index e8917bbd47..97ead9b9fd 100644
--- a/lib/kernel/test/standard_error_SUITE.erl
+++ b/lib/kernel/test/standard_error_SUITE.erl
@@ -21,13 +21,13 @@
-module(standard_error_SUITE).
-export([all/0,suite/0]).
--export([badarg/1,getopts/1]).
+-export([badarg/1,getopts/1,output/1]).
suite() ->
[{ct_hooks,[ts_install_cth]}].
all() ->
- [badarg,getopts].
+ [badarg,getopts,output].
badarg(Config) when is_list(Config) ->
{'EXIT',{badarg,_}} = (catch io:put_chars(standard_error, [oops])),
@@ -37,3 +37,30 @@ badarg(Config) when is_list(Config) ->
getopts(Config) when is_list(Config) ->
[{encoding,latin1}] = io:getopts(standard_error),
ok.
+
+%% Test that writing a lot of output to standard_error does not cause the
+%% processes handling it to terminate like this:
+%%
+%% =ERROR REPORT==== 9-Aug-2015::23:19:23 ===
+%% ** Generic server standard_error_sup terminating
+%% ** Last message in was {'EXIT',<0.28.0>,eagain}
+%% ** When Server state == {state,standard_error,undefined,<0.28.0>,
+%% {local,standard_error_sup}}
+%% ** Reason for termination ==
+%% ** eagain
+%%
+%% This problem, observed with Erlang 18.0.2, was fixed in fd_driver by
+%% properly handling EAGAIN if it arises on file descriptor writes.
+%%
+output(Config) when is_list(Config) ->
+ Ref = monitor(process, standard_error_sup),
+ Chars = [ [["1234567890" || _ <- lists:seq(1,10)], $\s,
+ integer_to_list(L), $\r, $\n] || L <- lists:seq(1, 100) ],
+ ok = io:put_chars(standard_error, Chars),
+ receive
+ {'DOWN', Ref, process, _, _} ->
+ error(standard_error_noproc)
+ after
+ 500 ->
+ ok
+ end.