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

Re: Crash @TortoiseSVN.dll!0000000002de72d9() - TortoiseSVN 1.6.6 x64 on WinXP x64

From: Nils Maier <testnutzer123_at_gmail.com>
Date: Sun, 20 Dec 2009 04:39:26 -0800 (PST)

On 17 Dez., 19:26, Stefan Küng <tortoise..._at_gmail.com> wrote:
> On 17.12.2009 16:52, suneel wrote:
>
> > Hi
> >             I too am facing the same issue as you are. My computer is
> >   winXp64 bit and has all the patches. The frequency of the crash has
> >   become more and more frequent, like atleast 12 per day. When i am
> >   working and simply switch the explorer and click on the right side
> >   pane of the explorer, it crashes.
>
> Then please, download the debug symbols from here:http://sourceforge.net/projects/tortoisesvn/files/
> (the file with the "pdb" in its name, compressed with 7-zip).
>
> copy/move the debug symbol files to c:\program files\tortoisesvn\bin and
> wait for the crash. Then start a debugger and send me the stack trace.
>
> Stefan
>

Fired up the debugger (VS2008) and these are the interesting bits of
the stack:

...
         msvcr90.dll!_invalid_parameter_noinfo() Line 126 C++
         TortoiseSVN.dll!std::_Tree<std::_Tset_traits<CShellExt *
__ptr64,std::less<CShellExt * __ptr64>,std::allocator<CShellExt *
__ptr64>,0> >::const_iterator::_Inc() Line 391 + 0x6 bytes C++
         TortoiseSVN.dll!std::_Tree<std::_Tset_traits<char const *
__ptr64,StringPool::LessString,std::allocator<char const * __ptr64>,0>
>::erase(std::_Tree<std::_Tset_traits<char const
*,StringPool::LessString,std::allocator<char const *>,0>
>::const_iterator _First=0xeb67a24c391eb481 <Bad Ptr>,
std::_Tree<std::_Tset_traits<char const
*,StringPool::LessString,std::allocator<char const *>,0>
>::const_iterator _Last=...) Line 943 + 0x3b bytes C++
         TortoiseSVN.dll!std::_Tree<std::_Tset_traits<CShellExt *
__ptr64,std::less<CShellExt * __ptr64>,std::allocator<CShellExt *
__ptr64>,0> >::erase(CShellExt * const & _Keyval=0x000000000303ec60)
Line 954 C++
         TortoiseSVN.dll!CShellExt::~CShellExt() Line 82 C++
         TortoiseSVN.dll!CShellExt::`scalar deleting destructor'() + 0x17
bytes C++
> TortoiseSVN.dll!CShellExt::Release() Line 290 + 0x31 bytes C++
         shell32.dll!CFSFolder::_LoadColumnHandlers() - 0x38d bytes
...

The code in question is:
TortoiseShell/ShellExt.cpp:80: g_exts.erase(this);
I *think* the crash is due to lack of protection against parallel
modification by different threads. Basically multiple erase() are
executed in parallel and the first erase modifies the list while the
others still run and then operate on outdated data.
The whole g_exts stuff is actually a no-op and can be omitted it
seems.
If not and tracking the instances in g_exsts is indeed required for
some reason then put in some critical section or mutex and be done.

I guess this does not surface in 32bit builds because, IIRC, the 32bit
explorer will not use multiple threads for shell extensions, while the
64bit actually does (at least on XP x64) among other differences.

Another problem, but likely unrelated:
Looking at AddRef/Release shows that the ref counters are modified in
a non-atomic way. Better use InterlockedIncrement/
InterlockedDecrement.

Cheers
Nils

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2431794

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2009-12-20 13:45:36 CET

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