[jcifs] Thread deadlock

Allen, Michael B (RSCH) Michael_B_Allen at ml.com
Tue Mar 18 13:17:08 EST 2003



> -----Original Message-----
> From:	Jason Scherer [SMTP:jscherer at blackfintech.com]
> Sent:	Monday, March 17, 2003 8:58 PM
> To:	jcifs at lists.samba.org
> Subject:	[jcifs] Thread deadlock
> 
> I have written a program that recurses a directory structure and copies
> the files to a network drive using the jcifs api.  The code would
> "sometimes" stop when trying to copy the files.  I downloaded and compiled
> the code to try and debug this problem, and what I have found is that the
> SmbFile.copyTo0 method has a deadlock issue in the w.wait() call below.
> synchronized( w ) {
> while( !w.ready ) {
> try {
> w.wait();
> 
	How do you know it's a deadlock? Can you post a thread monitor dump please?
	On Unix you can do SIGQUIT by pressing Ctrl-\ on the commandline. On windwos
	this is Ctrl-Break.

	Also let it hang for 120 seconds. It may be a socket error that may take 1min 15
	sec to timeout (doesn't sound like it though).

	Also it would be great if you could isolate some minimal code that reproduces the
	problem. I have several threaded examples used to test that code.

	Otherwise please explain how you think a deadlock could occur in that code. It's
	just not that complicated.

	Mike





More information about the jcifs mailing list