[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

deadlock in TSVNCache

From: Xi Wang <xi.wang_at_gmail.com>
Date: Wed, 21 May 2008 23:33:39 +0800

Hi,

Here is a deadlock case that has been happening here.

The bug exists in the current branch (1.4.x). When the deadlock occurs,
Windows Explorer may stop responding and the (green) icon overlay on files
may disappear. It seems to have been fixed in the latest trunk (1.5.x).

We guess that two threads with a global read-write lock
(CSVNStatusCache::Instance().m_rwSection) are involved.

[1] Folder Crawler Thread

CFolderCrawler::WorkerThread (FolderCrawler.cpp:280, 421)
CCachedDirectory::RefreshStatus (CacheDirectory.cpp:765, 786)
(holding m_critSec at :763)
CCachedDirectory::GetStatusForMember (:403)
(holding m_critSecPath at :378)
(holding m_critSec at :388)
svn_client_status2
CCachedDirectory::GetStatusCallback (586, 622, 636)
CSVNStatusCache::GetDirectoryCacheEntry (:361)
WaitToWrite();

Note that the thread tries to acquire the write lock while holding
m_critSec and m_critSecPath.

[2] Instance Thread (to communicate with each session of explorer.exe)

InstanceThread (TSVNCache.cpp:665)
GetAnswerToRequest (:474)
(holding the read lock at :473)
CSVNStatusCache::GetStatusForPath (SVNStatusCache.cpp:428)
CCachedDirectory::GetStatusForMember (CacheDirectory.cpp:301, 313)

There are several points there trying to acquire m_critSec or
m_critSecPath while holding the read lock.

Thanks,
Xi

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_tortoisesvn.tigris.org
For additional commands, e-mail: dev-help_at_tortoisesvn.tigris.org
Received on 2008-05-21 17:37:26 CEST

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.