<div dir="ltr"><div><div><div>I'm relatively new to erlang but ran across a weird issue which seems like a bug. When I redirect the output to 'head -20', it causes the VM to crash. Some other types of pipes are fine though.<br><br></div><div>I've encountered this initially on FreeBSD 10.1 with Erlang/OTP 17 but also reproduced on Ubuntu 14.04 with Erlang R16B03<br></div><div><br></div>Minimal test case below:<br><br>$ cat redirection_test.erl <br>-module(redirection_test).<br>-export([start/0]).<br><br>f(0) -> 0;<br>f(N) -> io:format("~p ~n", [N]), f(N-1).<br><br>start() -> io:format("~p ~n", [f(100)]).<br>$ erlc redirection_test.erl <br>$ erl -noinput -s redirection_test -s init stop  | head -20<br>100 <br>99 <br>...<br>84 <br>83 <br>82 <br>81 <br><br>Crash dump was written to: erl_crash.dump<br>init terminating in do_boot ()<br>$ uname -a<br>Linux erlang-test 3.13.0-43-generic #72-Ubuntu SMP Mon Dec 8 19:35:06 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux<br>$ erl --version<br>Erlang R16B03 (erts-5.10.4) [source] [64-bit] [async-threads:10] [kernel-poll:false]<br><br>Eshell V5.10.4  (abort with ^G)<br><br><br></div>Thanks,<br></div>Eric<br><div><div><br></div></div></div>