[erlang-questions] inet:getstat on non-socket crashes the VM?

Bekes, Andras G Andras.Bekes@REDACTED
Fri Jun 22 13:53:37 CEST 2018

Hi Erlangers,

I noticed that calling inet:getstat/1 is a dangerous operation, as it can kill the whole VM if used inappropriately.

It is easy to reproduce:

Eshell V9.3  (abort with ^G)
1> application:start(sasl).
2> [inet:getstat(X) || X<-erlang:ports()].
Failed to write to erl_child_setup: 9
Crash dump is being written to: erl_crash.dump...done

Without sasl, it doesn't kill the VM, but the terminal gets into a faulty state and further work is not possible.
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.
What do you think?


Andras G. Bekes

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180622/b6369c1d/attachment.htm>

More information about the erlang-questions mailing list