[erlang-questions] Erlang VM crashed due to io output?

Torbjorn Tornkvist tobbe@REDACTED
Thu Jul 19 11:28:50 CEST 2007


Ludovic Coquelle wrote:
> Sorry for posting again this question, but I think there is something
> important to know and I can't figure out what.
> 
> I run a command printing simple text on default io device (stdout):
> bash> erl -noshell -eval "lists:foreach(fun(N) -> io:format(\"~w~n\",
> [N]) end, lists:seq(1,5)), erlang:halt()."
> 1
> 2
> 3
> 4
> 5
> 
> That's the behaviour I expected.
> But if I try to pipe the result, erlang crash:
> bash> erl -noshell -eval "lists:foreach(fun(N) -> io:format(\"~w~n\",
> [N]) end, lists:seq(1,5)), erlang:halt()." | head -n 3
> 1
> 2
> 3

I can't reproduce this behaviour.
I'm running R11B2 on Debian and the above works perfectly.
What OS are you running this on?

--Tobbe

> Crash dump was written to: erl_crash.dump
> init terminating in do_boot ()
> 
> What's happening?
> Is it a normal behaviour?
> 




More information about the erlang-questions mailing list