From: Florian Z. <fl...@fl...> - 2011-03-04 14:30:03
|
Hi, > On Sat, 26 Feb 2011, Florian Zumbiehl wrote: > > while reading the source of sshfs, I noticed that there (almost certainly) > > is a race condition between sftp_request_send() and process_one_request() > > when the former is waiting on sshfs.outstanding_cond for the pipeline to > > empty: If the ssh connection then disappears, the first sftp_read() in > > process_one_request(), for example, could return -1, causing > > process_one_request() to do the same, causing process_requests() to > > close the fds, to reset sshfs.processing_thread_started, to clean the > > request hash table, and to then terminate the thread, leaving noone to > > wake up the thread sleeping in sftp_request_send(), thus resulting in > > a deadlock. > > Thanks for the report. > > Could you please test the attached patch? Does it fix the deadlock? Erm, I don't have a clue how to provoke that deadlock, or at least I haven't tried--I just noticed it while reading the source. And after all, testing doesn't really work for concurrency problems anyhow ;-) As I also don't know the source particularly well, I guess you should be able to judge whether that would make things correct better than I could. Florian |