[JSch-users] Deadlock in KnownHosts
Status: Alpha
Brought to you by:
ymnk
|
From: Vladimir K. <vla...@or...> - 2016-02-10 08:38:34
|
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 |