SourceTree crashes on adding a repo, adding a account, fresh after reinstall
Asked by TNTworks:

As of today, SourceTree started to crash on opening new tabs on a working setup.

After reinstall I cannot add any new accounts, I cannot open the "Local repositories" tab as everything makes it a crash.

Also adding a new folder crashes it.

Tried to removed AppData folders all of it, downgrade and it still crashes.

Help?!?


Answers:
author: TNTworks
body: The issue was in a different Color Management settings in Windows compared to default Windows'.

More speficially under Color Management -\> Advanced -\> Windows Color System Defaults -\> Device Profile which was set to Virtual sRBG instead of System Default value.

This was due to me experimenting with a new monitor setup.

The issue is explained in this SO: <https://stackoverflow.com/questions/63510630/wpf-bitmapimage-exception-the-image-data-generated-an-overflow-during-processin>

The stacktrace makes me feel this is a .NET's internal issue with color profile, or some missing flag like in the SO thread, aka Ignore Col.Profile.

The .NET stacktrace from Windows' Event Viewer is :

*** ** * ** ***

Exception Info: System.ArithmeticException

Exception Info: System.OverflowException  
at System.Windows.Media.Imaging.ColorConvertedBitmap.FinalizeCreation()  
at System.Windows.Media.Imaging.BitmapSource.CreateCachedBitmap(System.Windows.Media.Imaging.BitmapFrame, System.Windows.Media.Imaging.BitmapSourceSafeMILHandle, System.Windows.Media.Imaging.BitmapCreateOptions, System.Windows.Media.Imaging.BitmapCacheOption, System.Windows.Media.Imaging.BitmapPalette)  
at System.Windows.Media.Imaging.BitmapFrameDecode.FinalizeCreation()  
at System.Windows.Media.Imaging.BitmapDecoder.SetupFrames(System.Windows.Media.Imaging.BitmapDecoder, System.Collections.ObjectModel.ReadOnlyCollection\`1\<System.Windows.Media.Imaging.BitmapFrame\>)  
at System.Windows.Media.Imaging.BitmapDecoder.get_Frames()  
at System.Windows.Media.Imaging.BitmapFrame.CreateFromUriOrStream(System.Uri, System.Uri, System.IO.Stream, System.Windows.Media.Imaging.BitmapCreateOptions, System.Windows.Media.Imaging.BitmapCacheOption, System.Net.Cache.RequestCachePolicy)  
at System.Windows.Media.ImageSourceConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext, System.Globalization.CultureInfo, System.Object)  
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CallProvideValue(System.Windows.Markup.MarkupExtension, System.IServiceProvider)

Exception Info: System.Windows.Markup.XamlParseException  
at System.Windows.Markup.XamlReader.RewrapException(System.Exception, System.Xaml.IXamlLineInfo, System.Uri)  
at System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader, System.Xaml.IXamlObjectWriterFactory, Boolean, System.Object, System.Xaml.XamlObjectWriterSettings, System.Uri)  
at System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader, Boolean, System.Object, System.Xaml.Permissions.XamlAccessLevel, System.Uri)  
at System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream, System.Windows.Markup.ParserContext, System.Object, Boolean)  
at SourceTree.View.Hosted.HostedAccountWindow.InitializeComponent()  
at SourceTree.View.Hosted.HostedAccountWindow..ctor()  
at SourceTree.Accounts.AccountManager.PromptAddAccount()  
at SourceTree.ViewModel.Hosted.HostedProjectsViewModel.\<.ctor\>b__47_3()  
at ReactiveUI.ReactiveCommand+\<\>c__DisplayClass0_0.\<Create\>b__1(System.IObserver\`1\<System.Reactive.Unit\>)  
at System.Reactive.Linq.QueryLanguage+CreateWithDisposableObservable\`1\[\[System.Reactive.Unit, System.Reactive, Version=4.1.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263\]\].SubscribeCore(System.IObserver\`1\<System.Reactive.Unit\>)  
at System.Reactive.ObservableBase\`1\[\[System.Reactive.Unit, System.Reactive, Version=4.1.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263\]\].Subscribe(System.IObserver\`1\<System.Reactive.Unit\>)

Exception Info: ReactiveUI.UnhandledErrorException  
at ReactiveUI.RxApp+\<\>c__DisplayClass11_0.\<.cctor\>b__2()  
at System.Reactive.Concurrency.Scheduler.Invoke(System.Reactive.Concurrency.IScheduler, System.Action)  
at System.Reactive.Concurrency.DispatcherScheduler+\<\>c__DisplayClass12_0\`1\[\[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\]\].\<Schedule\>b__0()  
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)  
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)  
at System.Windows.Threading.DispatcherOperation.InvokeImpl()  
at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object)  
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)  
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)  
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)  
at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)  
at System.Windows.Threading.DispatcherOperation.Invoke()  
at System.Windows.Threading.Dispatcher.ProcessQueue()  
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)  
at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)  
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)  
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)  
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)  
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)  
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)  
at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)  
at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)  
at System.Windows.Application.RunDispatcher(System.Object)  
at System.Windows.Application.RunInternal(System.Windows.Window)  
at SourceTree.App.Main()

*** ** * ** ***


author: Vipin Yadav
body: Which version of sourcetree are you using? It would be great if you can add snapshot and logs.