colin-lee / ganymed-ssh-2

Automatically exported from code.google.com/p/ganymed-ssh-2
Other
0 stars 0 forks source link

Connection.authenticateWithPassword(userid,pwd) method blocked #56

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
conn = new Connection(Ip);
            boolean result;
            try {
                conn.connect(null,1000,0);
                       result = conn.authenticateWithPassword(userId, password);
                        }catch (IOException e) {

                conn.close();
                return null;
            }

When the program executes the method conn.authenticateWithPassword then 
blocked。

jstack info:
"main" prio=6 tid=0x0067c400 nid=0x1974 in Object.wait() [0x00fff000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x23c00660> (a java.util.Vector)
    at java.lang.Object.wait(Object.java:503)
    at ch.ethz.ssh2.auth.AuthenticationManager.deQueue(AuthenticationManager.java:82)
    - locked <0x23c00660> (a java.util.Vector)
    at ch.ethz.ssh2.auth.AuthenticationManager.getNextMessage(AuthenticationManager.java:99)
    at ch.ethz.ssh2.auth.AuthenticationManager.initialize(AuthenticationManager.java:135)
    at ch.ethz.ssh2.auth.AuthenticationManager.authenticatePassword(AuthenticationManager.java:267)
    at ch.ethz.ssh2.Connection.authenticateWithPassword(Connection.java:309)
    - locked <0x23bf9450> (a ch.ethz.ssh2.Connection)

This is a real problem. For example: When the code 
"conn.authenticateWithPassword" is executing and the remote server has been 
restarted or turned off, after that we will have a hung thread.
In this case the timeout isn't work properly.

Please investigate this problem.

Original issue reported on code.google.com by maksym.s...@hivext.net on 3 Jun 2015 at 10:58