Handle CStreamException and don't crash UI

108 views
Skip to first unread message

André Ziegler

unread,
Sep 25, 2020, 3:29:23 AM9/25/20
to TortoiseSVN
From time to time I get crashes while showing rev logs. Windbg shows me that in CBinaryInStreamBase (binarystream.h) you throw an exception, but this is never handled:

throw CStreamException("unexpected end of stream");

this cause the UI to close without letting the user know what happens. 

ucrtbase!abort+0x4e
ucrtbase!terminate+0x1f
VCRUNTIME140_1!FindHandler<__FrameHandler4>(struct EHExceptionRecord * pExcept = 0x000000e8`61e2e8e0, unsigned int64 * pRN = 0x000000e8`61e2d9d0, struct _CONTEXT * pContext = 0x000000e8`61e2e2d0, struct _xDISPATCHER_CONTEXT * pDC = 0x000000e8`61e2dab0, struct FH4::FuncInfo4 * pFuncInfo = 0x000000e8`61e2d9a0, unsigned char recursive = 0x00 '', int CatchDepth = 0n0, unsigned int64 * pMarkerRN = 0x00000000`00000000)+0x46f [d:\agent\_work\2\s\src\vctools\crt\vcruntime\src\eh\frame.cpp @ 682] 
VCRUNTIME140_1!__InternalCxxFrameHandler<__FrameHandler4>(struct EHExceptionRecord * pExcept = 0x000000e8`61e2e8e0, unsigned int64 * pRN = 0x000000e8`61e2d9d0, struct _CONTEXT * pContext = 0x000000e8`61e2e2d0, struct _xDISPATCHER_CONTEXT * pDC = 0x000000e8`61e2dab0, struct FH4::FuncInfo4 * pFuncInfo = 0x000000e8`61e2d9a0, int CatchDepth = 0n0, unsigned int64 * pMarkerRN = 0x00000000`00000000, unsigned char recursive = 0x00 '')+0x267 [d:\agent\_work\2\s\src\vctools\crt\vcruntime\src\eh\frame.cpp @ 352] 
VCRUNTIME140_1!__CxxFrameHandler4(struct EHExceptionRecord * pExcept = 0x000000e8`61e2e8e0, unsigned int64 RN = <Value unavailable error>, struct _CONTEXT * pContext = 0x000000e8`61e2e2d0, struct _xDISPATCHER_CONTEXT * pDC = 0x000000e8`61e2dab0)+0xa9 [d:\agent\_work\2\s\src\vctools\crt\vcruntime\src\eh\risctrnsctrl.cpp @ 290] 
TortoiseProc!__GSHandlerCheck_EH4(struct _EXCEPTION_RECORD * ExceptionRecord = 0x000000e8`61e2e8e0, void * EstablisherFrame = 0x000000e8`61e2eac0, struct _CONTEXT * ContextRecord = 0x000000e8`61e2e2d0, struct _DISPATCHER_CONTEXT * DispatcherContext = 0x000000e8`61e2dab0)+0x64 [d:\A01\_work\6\s\src\vctools\crt\vcstartup\src\gs\amd64\gshandlereh4.cpp @ 86] 
ntdll!RtlpExecuteHandlerForException+0xd
ntdll!RtlDispatchException+0x197
ntdll!RtlRaiseException+0x18d
KERNELBASE!RaiseException+0x68
VCRUNTIME140!_CxxThrowException(void * pExceptionObject = 0x000000e8`61e2ea20, struct _s__ThrowInfo * pThrowInfo = <Value unavailable error>)+0x90 [d:\agent\_work\2\s\src\vctools\crt\vcruntime\src\eh\throw.cpp @ 75] 
TortoiseProc!CBinaryInStreamBase::GetByte(void)+0x71 [C:\TSVN_BRANCH\tortoisesvn\src\LogCache\Streams\BinaryInStream.h @ 71] 
TortoiseProc!CPackedDWORDInStreamBase::InternalGetValue+0x8 [C:\TSVN_BRANCH\tortoisesvn\src\LogCache\Streams\PackedDWORDInStream.cpp @ 42] 
TortoiseProc!CPackedDWORDInStreamBase::GetValue(void)+0x38 [C:\TSVN_BRANCH\tortoisesvn\src\LogCache\Streams\PackedDWORDInStream.h @ 87] 
TortoiseProc!CDiffInStreamBase<CPackedDWORDInStreamBase,unsigned long>::GetValue+0x8 [C:\TSVN_BRANCH\tortoisesvn\src\LogCache\Streams\DiffIntegerInStream.h @ 62] 
TortoiseProc!LogCache::operator>>(class IHierarchicalInStream * stream = 0x000000e8`60d1d180, class LogCache::CSkipRevisionInfo * container = 0x000000e8`60d6fd00)+0x1c2 [C:\TSVN_BRANCH\tortoisesvn\src\LogCache\Containers\SkipRevisionInfo.cpp @ 479] 
TortoiseProc!LogCache::CCachedLogInfo::Load(int maxFailures = 0n151)+0x26e [C:\TSVN_BRANCH\tortoisesvn\src\LogCache\Containers\CachedLogInfo.cpp @ 354] 
TortoiseProc!LogCache::CLogCachePool::GetCache(class ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > > * uuid = <Value unavailable error>, class ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > > * root = <Value unavailable error>)+0x255 [C:\TSVN_BRANCH\tortoisesvn\src\LogCache\LogCachePool.cpp @ 221] 
TortoiseProc!CCacheLogQuery::GetRelativeRepositoryPath(class CTSVNPath * url = 0x000000e8`61e2f230)+0x77 [C:\TSVN_BRANCH\tortoisesvn\src\LogCache\CacheLogQuery.cpp @ 1173] 
TortoiseProc!CCacheLogQuery::Log(class CTSVNPathList * targets = <Value unavailable error>, class SVNRev * peg_revision = 0x000000e8`5cb3d8e0, class SVNRev * start = 0x000000e8`5cb3d900, class SVNRev * end = 0x000000e8`5cb3d958, int limit = 0n100, bool strictNodeHistory = false, class ILogReceiver * receiver = 0x000000e8`5cb3c3c8, bool includeChanges = false, bool includeMerges = false, bool includeStandardRevProps = true, bool includeUserRevProps = false, class std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > > * userRevProps = 0x000000e8`61e2f478 { size=0 })+0x2c5 [C:\TSVN_BRANCH\tortoisesvn\src\LogCache\CacheLogQuery.cpp @ 1448] 
TortoiseProc!SVN::ReceiveLog(class CTSVNPathList * pathlist = 0x000000e8`61e2fa18, class SVNRev * revisionPeg = 0x000000e8`5cb3d8e0, class SVNRev * revisionStart = 0x000000e8`5cb3d900, class SVNRev * revisionEnd = 0x000000e8`5cb3d958, int limit = 0n100, bool strict = false, bool withMerges = false, bool refresh = false)+0x197 [C:\TSVN_BRANCH\tortoisesvn\src\SVN\SVN.cpp @ 1955] 
15 000000e8`61e2f510 00007ff7`41ba38a5 TortoiseProc!CLogDlg::LogThread(void)+0x2094 [C:\TSVN_BRANCH\tortoisesvn\src\TortoiseProc\LogDialog\LogDlg.cpp @ 1810] 
16 000000e8`61e2fe50 00007ff7`41ba4590 TortoiseProc!async::CJobBase::Execute(void)+0x25 [C:\TSVN_BRANCH\tortoisesvn\src\AsyncFramework\JobBase.cpp @ 84] 
 TortoiseProc!async::CJobScheduler::ThreadFunc(void * arg = 0x000000e8`60cfe630)+0x30 [C:\TSVN_BRANCH\tortoisesvn\src\AsyncFramework\JobScheduler.cpp @ 396] 
TortoiseProc!async::CThread::ThreadFunc(void * arg = 0x000000e8`6074ec30)+0x3a [C:\TSVN_BRANCH\tortoisesvn\src\AsyncFramework\Thread.cpp @ 43] 
ucrtbase!thread_start<void +0xa6
kernel32!BaseThreadInitThunk+0x22
ntdll!RtlUserThreadStart+0x34

It would be better to handle it and tell user that reading log had some issues and add a button to retry it.

Stefan

unread,
Sep 25, 2020, 4:29:54 PM9/25/20
to TortoiseSVN
thanks for the report.
Fixed in r28979

André Ziegler

unread,
Nov 3, 2020, 1:10:23 AM11/3/20
to TortoiseSVN
still got it in 1.14.0.28980

Stefan

unread,
Nov 4, 2020, 1:24:11 PM11/4/20
to TortoiseSVN
On Tuesday, November 3, 2020 at 7:10:23 AM UTC+1 André Ziegler wrote:
still got it in 1.14.0.28980


with the same stacktrace?

André Ziegler

unread,
Nov 5, 2020, 3:30:07 AM11/5/20
to TortoiseSVN
yes,still same FAIL_FAST_FATAL_APP_EXIT_c0000409_ucrtbase.dll!abort crash with same callstack. I saw you haven't merged r28981 to 1.14 branch

André Ziegler

unread,
Nov 9, 2020, 6:43:26 AM11/9/20
to TortoiseSVN
ok, I've installed 1.14.0.29019 and look what happens 

André Ziegler

unread,
Apr 12, 2021, 4:22:18 PM4/12/21
to TortoiseSVN
ok, it works now for a longer time without any issues.

I think I found the underlaying issue. The old SSD reached the maximum amount of write operations and was not able to read the log cache data and so TSVN crashed. After replacing the SSD with a newer one, everything is fine.
Reply all
Reply to author
Forward
0 new messages