[erlang-questions] The port "tty_sl -c -e"is out of control

Lukas Larsson lukas@REDACTED
Wed Mar 8 13:22:25 CET 2017


The port seems to have gotten stuck while flushing it's output to stdout.
When a port is flushing, it is invalid to interact with (as you see through
the badarg you get from port_close), but it still shows up in
erlang:ports() as it is not completely gone yet.

Since you are using run_erl, it seems like for some reason that program is
not reading from the dup:ed stdout fd. Does the syslog/run_erl log tell you
anything about what may be going on there?


On Wed, Mar 8, 2017 at 10:55 AM, 叶少波 <ye02@REDACTED> wrote:

> Hi erlang expets,
> I met a problem about the erlang port "tty_sl -c- e".
> The scenario is like this:
> 1) I start two erlang nodes (Lets say one is Node1, another one is Node2)
> by run_erl, they are connected together.
>     I can login to these two nodes by to_erl and do anythings on the
> erlang shell. It run very well.
> 2) But today I tried to use to_erl to login to the Node1, I can`t type
> anything on the shell, it seems the shell is hanging;
>    Then I login to the Node2 and run rpc:call(node1, shell, start, []) to
> start a new shell on Node1, and I check the port
>    info of the port "tty_sl -c -e", it shows below:
> (node1@REDACTED)7> Port.
> #Port<0.4832>
> (node1@REDACTED)8> erlang:port_info(Port).
> [{name,"tty_sl -c -e"},
>  {links,[]},
>  {id,38656},
>  {connected,<0.1502.0>},
>  {input,2552},
>  {output,1751871},
>  {os_pid,undefined}]
> you can see here, the "links" is empty and the connected process does`t
> exist.
> (node1@REDACTED)3> erlang:process_info(pid(0, 1502, 0)).
> undefined
> 3) I tried to close the port by erlang:port_close(Port), the result is as
> below:
> (titan1_ps3@REDACTED)4> erlang:port_close(Port).
> ** exception error: bad argument
>      in function  port_close/1
>         called as port_close(#Port<0.4832>)
> It seems the port already died.
> As I know, the port will be closed if the linked process dies. But here we
> can see the port does`t exit.
> Do you know what is the reason? Or how can I kill the port?
> Actually  I met this problem several times before, I had to reboot the node
> the fix.
> Thanks,
> BRs/Michael
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170308/5063edaf/attachment.htm>

More information about the erlang-questions mailing list