[jcifs] Re: Deadlock in SmbTree.treeConnect()

Ronny Schuetz Usenet.r96 at gishpuppy.com
Wed Apr 23 11:16:45 GMT 2008


Hi,

I ran into several deadlock issues some time ago and the only solution 
was to add one more lock object to the library to avoid deadlock 
situations by synchronizing on this object first. This change has been 
incorporated into the official library version later, but IIRC before 
1.2.13.

However, looks like I missed some places ... You could try to change

  SmbTransport#getSmbSession(NtlmPasswordAuthentication)

in the following way: Remove the synchronized method modifier of the 
method and enclose the original body of the method into

      synchronized(setupDiscoLock) {
      synchronized(this) {

      [... original body ...]

      }}

Removing the synchronized method modifier from

  SmbTransport#getSmbSession()

might be a good idea as well.

However, this is entirely untested. If you can somehow reproduce the 
issue, you could try to test if this change fixes the bug.

Best regards,
Ronny



More information about the jcifs mailing list