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

Attila Rajmund Nohl attila.r.nohl@REDACTED
Mon Jun 25 18:00:08 CEST 2018


2018-06-22 13:53 GMT+02:00 Bekes, Andras G <Andras.Bekes@REDACTED>:
> 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).
>
> ok
>
> 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?

I raised a ticket about a similar issue a couple of months ago on
bugs.erlang.org, but got similar answer as you. I cannot link the
ticket number as all I get on bugs.erlang.org is this:

type Exception report

message Unable to establish a connection with the database.
(Connection refused. Check that the hostname and port are correct and
that the postmaster is accepting TCP/IP connections.)

description The server encountered an internal error that prevented it
from fulfilling this request.

exception

com.opensymphony.module.propertyset.PropertyImplementationException:
Unable to establish a connection with the database. (Connection
refused. Check that the hostname and port are correct and that the
postmaster is accepting TCP/IP connections.)



More information about the erlang-questions mailing list