<div dir="ltr"><br><br>On Fri, Jun 22, 2018 at 1:53 PM, Bekes, Andras G wrote:<br>><br>> Hi Erlangers,<br>><br>>  <br>><br>> I noticed that calling inet:getstat/1 is a dangerous operation, as it can kill the whole VM if used inappropriately.<br>><br>>  <br>><br>> It is easy to reproduce:<br>><br>>  <br>><br>> Eshell V9.3  (abort with ^G)<br>><br>> 1> application:start(sasl).<br>><br>> ok<br>><br>> 2> [inet:getstat(X) || X<-erlang:ports()].<br>><br>> Failed to write to erl_child_setup: 9<br>><br>> Crash dump is being written to: erl_crash.dump...done<br>><br>>  <br>><br>> Without sasl, it doesn’t kill the VM, but the terminal gets into a faulty state and further work is not possible.<br>><br>> I know calling it on a non-socket is an erroneous action, but crashing the VM doesn’t seem to be the most appropriate consequence.<br>><br>> What do you think?<br>><br>>  <br>><br>> Regards,<br>><br>>  <br>><br>> Andras G. Bekes<br>><br>> ________________________________<br>> erlang-questions mailing list<br>> <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>> <a href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a><br>><br><br>Broadcasting random stuff around is dangerous. Different ports (and processes) have different protocols that they expect to be used. A message that means something for one port may mean something completely different for another port.<br><br>Regards,<br>Rickard<br>--<br>Rickard Green, Erlang/OTP, Ericsson AB</div>