Vladimir Kvashin
2016-02-10 08:38:24 UTC
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=***@24a91105
owned by SFTP: : Uploading /home/kiss/netbeans-8.1/cnd/bin/Linux-x86_64/rfs_controller ***@11.44.33.55 <mailto:***@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 ***@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 ***@11.44.33.55 <mailto:***@11.44.33.55>:/var/tmp/dlight_ikiss/6b88f630/tools/Linux-x86_64/rfs_controller" Id=388 in BLOCKED on lock=***@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 ***@24a91105
at com.jcraft.jsch.Session.connect(Session.java:342)
Thank you!
Vladimir
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=***@24a91105
owned by SFTP: : Uploading /home/kiss/netbeans-8.1/cnd/bin/Linux-x86_64/rfs_controller ***@11.44.33.55 <mailto:***@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 ***@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 ***@11.44.33.55 <mailto:***@11.44.33.55>:/var/tmp/dlight_ikiss/6b88f630/tools/Linux-x86_64/rfs_controller" Id=388 in BLOCKED on lock=***@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 ***@24a91105
at com.jcraft.jsch.Session.connect(Session.java:342)
Thank you!
Vladimir