Sourcetree 2.3.5.0 always crashed after startup
Asked by pmcarreiro:

Hello,

<br />

After he starts and when he is refreshing the repos, appears a crash screen "Sourcetree has stopped working" (Debug - Close).

If i select debug in VS 2017 appears the following error:  
"Unhandled exception at 0x00007FFD776687BB (ntdll.dll) in SourceTree.exe: 0xC0000374: A heap has been corrupted (parameters: 0x00007FFD776CC6E0). occurred"

OS Systems: Windows 10 1709

But if i trie to execute the installation file, he tries to update and then starts the sourcetree and no error occurs (if i tried to open the installed, the error occurs always).

Best regards,

Paulo


Answers:
author: minnsey
body: Hi  

The installer should place sourcetree.exe in %localappdata%\\Sourcetree\\app-2.3.5\\sourcetree.exe can you run that without crashing?  

The installer also creates a shortcut at %localappdata%\\Sourcetree\\sourcetree.exe can you run that without crashing?  

If that still crashes, after you have tried running it can you check to see if there is anything in %localappdata%\\Atlassian\\Sourcetree\\sourcetree.log

thanks

comments: author: pmcarreiro
body: Hi Michael,

Thanks for the quick answer.
> *"The installer should place sourcetree.exe in %localappdata%\\Sourcetree\\app-2.3.5\\sourcetree.exe can you run that without crashing?"*

Yes i can.
> *"The installer also creates a shortcut at %localappdata%\\Sourcetree\\sourcetree.exe can you run that without crashing?"*

No, it continues to crash.
> If that still crashes, after you have tried running it can you check to see if there is anything in %localappdata%\\Atlassian\\Sourcetree\\sourcetree.log

Yes, there is log information.

*"ERROR \[2017-12-11 14:52:47,929\] \[1\] \[SourceTree.App\] \[.ctor\] - finish EnsureSquirrelExecutionStubIsCopied
ERROR \[2017-12-11 14:52:57,651\] \[8\] \[SourceTree.Repo.RepoHandlerGit\] \[Summary\] - Get summary failed, falling back to git.exe
LibGit2Sharp.LibGit2SharpException: No error message has been provided by the native library
at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)
at LibGit2Sharp.Core.Proxy.git_status_list_new(RepositoryHandle repo, GitStatusOptions options)
at LibGit2Sharp.RepositoryStatus..ctor(Repository repo, StatusOptions options)
at SourceTree.Repo.RepoHandlerGit.Summary(String path)
ERROR \[2017-12-11 14:52:58,489\] \[PriorityScheduler: 1\] \[SourceTree.Repo.RepoHandlerGit\] \[Summary\] - Get summary failed, falling back to git.exe
LibGit2Sharp.LibGit2SharpException: No error message has been provided by the native library
at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)
at LibGit2Sharp.Core.Proxy.git_status_list_new(RepositoryHandle repo, GitStatusOptions options)
at LibGit2Sharp.RepositoryStatus..ctor(Repository repo, StatusOptions options)
at SourceTree.Repo.RepoHandlerGit.Summary(String path)
ERROR \[2017-12-11 14:53:07,264\] \[8\] \[SourceTree.Repo.RepoHandlerGit\] \[CurrentBranch\] - Get current branch failed, falling back to git.exe
LibGit2Sharp.LibGit2SharpException: Corrupt repository. The 'HEAD' reference is missing.
at LibGit2Sharp.Repository.get_Head()
at SourceTree.Repo.RepoHandlerGit.CurrentBranch(String path)
ERROR \[2017-12-11 14:53:07,849\] \[PriorityScheduler: 1\] \[SourceTree.Repo.RepoHandlerGit\] \[CurrentBranch\] - Get current branch failed, falling back to git.exe
LibGit2Sharp.LibGit2SharpException: Corrupt repository. The 'HEAD' reference is missing.
at LibGit2Sharp.Repository.get_Head()
at SourceTree.Repo.RepoHandlerGit.CurrentBranch(String path)
ERROR \[2017-12-11 14:53:11,188\] \[PriorityScheduler: 0\] \[SourceTree.Repo.RepoHandlerGit\] \[Summary\] - Get summary failed, falling back to git.exe
LibGit2Sharp.LibGit2SharpException: No error message has been provided by the native library
at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)
at LibGit2Sharp.Core.Proxy.git_status_list_new(RepositoryHandle repo, GitStatusOptions options)
at LibGit2Sharp.RepositoryStatus..ctor(Repository repo, StatusOptions options)
at SourceTree.Repo.RepoHandlerGit.Summary(String path)
ERROR \[2017-12-11 14:53:18,998\] \[PriorityScheduler: 0\] \[SourceTree.Repo.RepoHandlerGit\] \[CurrentBranch\] - Get current branch failed, falling back to git.exe
LibGit2Sharp.LibGit2SharpException: Corrupt repository. The 'HEAD' reference is missing.
at LibGit2Sharp.Repository.get_Head()
at SourceTree.Repo.RepoHandlerGit.CurrentBranch(String path) "*

Best regards,

Paulo