Hi,

Recently a classical deadlock was found in KnownHosts.

It is described in a bug that was filed against NetBeans
https://netbeans.org/bugzilla/show_bug.cgi?id=257800
but the reason is obviously in jsch itself.

The questions are:
- is this problem already known?
- are there any plans to fix it?
- does jsch accept contributions? if yes, I can try fixing this and propose a patch

The below is jsut a copy-paste of some info from the bug:

"SFTP" thread
- has locked KnownHosts instance
- then tries to lock KnownHosts.pool

"ConnectionManager queue" thread
- has locked KnownHosts.pool
- then tries to lock KnownHosts instance

Below are minimal thread fgarments that illustrate this (note that there are no 
NB code in these stacks):

"ConnectionManager queue" Id=371 in BLOCKED on 
lock=com.jcraft.jsch.KnownHosts@24a91105
     owned by SFTP: : Uploading 
/home/kiss/netbeans-8.1/cnd/bin/Linux-x86_64/rfs_controller touser@11.44.33.55 
<mailto:user@11.44.33.55>:/var/tmp/dlight_ikiss/6b88f630/tools/Linux-x86_64/rfs_controller
 Id=388
    at com.jcraft.jsch.KnownHosts.getHMACSHA1(KnownHosts.java:486)
    at com.jcraft.jsch.KnownHosts.access$000(KnownHosts.java:35)
    at com.jcraft.jsch.KnownHosts$HashedHostKey.isMatched(KnownHosts.java:540)
    at com.jcraft.jsch.KnownHosts.getHostKey(KnownHosts.java:361)
      - locked java.util.Vector@79ee48d
    at com.jcraft.jsch.Session.checkHost(Session.java:809)
    at com.jcraft.jsch.Session.connect(Session.java:342)

"SFTP: : Uploading /home/kiss/netbeans-8.1/cnd/bin/Linux-x86_64/rfs_controller 
touser@11.44.33.55 
<mailto:user@11.44.33.55>:/var/tmp/dlight_ikiss/6b88f630/tools/Linux-x86_64/rfs_controller"
 Id=388 in BLOCKED on lock=java.util.Vector@79ee48d
     owned by ConnectionManager queue Id=371
    at com.jcraft.jsch.KnownHosts.check(KnownHosts.java:263)
    at com.jcraft.jsch.Session.checkHost(Session.java:732)
      - locked com.jcraft.jsch.KnownHosts@24a91105
    at com.jcraft.jsch.Session.connect(Session.java:342)


Thank you!
Vladimir
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
JSch-users mailing list
JSch-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to