Quantcast

The port "tty_sl -c -e"is out of control

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

The port "tty_sl -c -e"is out of control

叶少波-2
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@servicer_3_1)7> Port.
#Port<0.4832>               
(node1@servicer_3_1)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@servicer_3_1)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@servicer_3_1)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
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: The port "tty_sl -c -e"is out of control

Lukas Larsson-8
Hello,

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?

Lukas

On Wed, Mar 8, 2017 at 10:55 AM, 叶少波 <[hidden email]> 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@servicer_3_1)7> Port.
#Port<0.4832>               
(node1@servicer_3_1)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@servicer_3_1)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@servicer_3_1)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
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Loading...