You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched issues to ensure it has not already been reported
GitVersion package
GitVersion.Tool
GitVersion version
6.0.3
Operating system
Windows
What are you seeing?
following exception is thrown every time Gitversion is executed.
the Exceptions began with version 6.0.3
ERROR[24-10-1511:11:33:93]An unexpected error occurred:
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.String.Ctor(SByte*value,Int32startIndex,Int32length,Encodingenc)
at LibGit2Sharp.Core.EncodingMarshaler.FromNative(Encodingencoding,Byte*pNativeData)in/_/LibGit2Sharp/Core/EncodingMarshaler.cs:line 120
at LibGit2Sharp.Signature..ctor(git_signature*sig)in/_/LibGit2Sharp/Signature.cs:line 22
at LibGit2Sharp.Core.Proxy.git_commit_author(ObjectHandleobj)in/_/LibGit2Sharp/Core/Proxy.cs:line 289
at LibGit2Sharp.Core.LazyGroup`1.Dependent`2.LibGit2Sharp.Core.LazyGroup<T>.IEvaluator<TInput>.Evaluate(TInputinput)in/_/LibGit2Sharp/Core/LazyGroup.cs:line 93
at LibGit2Sharp.Core.LazyGroup`1.<Evaluate>b__6_0(Tinput)in/_/LibGit2Sharp/Core/LazyGroup.cs:line 37
at LibGit2Sharp.Core.GitObjectLazyGroup.EvaluateInternal(Action`1evaluator)in/_/LibGit2Sharp/Core/GitObjectLazyGroup.cs:line 19
at LibGit2Sharp.Core.LazyGroup`1.Evaluate()in/_/LibGit2Sharp/Core/LazyGroup.cs:line 35
at GitVersion.Git.Commit..ctor(CommitinnerCommit)in/_/src/GitVersion.LibGit2Sharp/Git/Commit.cs:line 18
at System.Linq.Enumerable.SelectEnumerableIterator`2.ToArray()
at System.Lazy`1.ViaFactory(LazyThreadSafetyModemode)
at System.Lazy`1.ExecutionAndPublication(LazyHelperexecutionAndPublication,BooleanuseDefaultConstructor)
at System.Lazy`1.CreateValue()
at GitVersion.Git.CommitCollection.GetEnumerator()in/_/src/GitVersion.LibGit2Sharp/Git/CommitCollection.cs:line 18
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at GitVersion.RepositoryStore.GetSourceBranches(IBranchbranch,IGitVersionConfigurationconfiguration, IEnumerable`1excludedBranches)+MoveNext()in/_/src/GitVersion.Core/Core/RepositoryStore.cs:line 139
at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1items)
at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1source)
at GitVersion.VersionCalculation.EffectiveBranchConfigurationFinder.GetEffectiveConfigurationsRecursive(IBranchbranch,IGitVersionConfigurationconfiguration,IBranchConfigurationchildBranchConfiguration, HashSet`1traversedBranches)+MoveNext()in/_/src/GitVersion.Core/VersionCalculation/EffectiveBranchConfigurationFinder.cs:line 37
at GitVersion.VersionCalculation.EffectiveBranchConfigurationFinder.GetEffectiveConfigurationsRecursive(IBranchbranch,IGitVersionConfigurationconfiguration,IBranchConfigurationchildBranchConfiguration, HashSet`1traversedBranches)+MoveNext()in/_/src/GitVersion.Core/VersionCalculation/EffectiveBranchConfigurationFinder.cs:line 56
at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1items)
at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1source)
at GitVersion.VersionCalculation.NextVersionCalculator.<>c__DisplayClass14_0.<<GetNextVersions>g__GetNextVersionsInternal|0>d.MoveNext()in/_/src/GitVersion.Core/VersionCalculation/VersionCalculators/NextVersionCalculator.cs:line 244
at System.Collections.Generic.List`1..ctor(IEnumerable`1collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1source)
at GitVersion.VersionCalculation.NextVersionCalculator.GetNextVersions(IBranchbranch,IGitVersionConfigurationconfiguration)in/_/src/GitVersion.Core/VersionCalculation/VersionCalculators/NextVersionCalculator.cs:line 239
at GitVersion.VersionCalculation.NextVersionCalculator.CalculateNextVersion(IBranchbranch,IGitVersionConfigurationconfiguration)in/_/src/GitVersion.Core/VersionCalculation/VersionCalculators/NextVersionCalculator.cs:line 158
at GitVersion.VersionCalculation.NextVersionCalculator.FindVersion()in/_/src/GitVersion.Core/VersionCalculation/VersionCalculators/NextVersionCalculator.cs:line 53
at GitVersion.GitVersionCalculateTool.CalculateVersionVariables()in/_/src/GitVersion.Core/Core/GitVersionCalculateTool.cs:line 45
at GitVersion.GitVersionExecutor.RunGitVersionTool(GitVersionOptionsgitVersionOptions)in/_/src/GitVersion.App/GitVersionExecutor.cs:line 66
What is expected?
should not throw exception and should work as expected ^^
ulluoink
changed the title
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
Azure Devops build: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
Oct 16, 2024
Which indicates that there's a commit with an author name so large it can't be unmarshalled from its native pointer into a C# System.String. I would consider this a bug in LibGit2Sharp, as it shouldn't crash on anything that doesn't crash libgit2 itself, but I can see why such a large author name isn't expected and therefore not handled more gracefully.
@ulluoink, I would recommend that you go through the commits and inspect what author name may be the culprit here. Perhaps you can ignore the bad commits so GitVersion doesn't try to instantiate them through LibGit2Sharp, or amend them with Git itself so they become instantiable. Either way, this is a problem outside the scope of GitVersion and either has to be fixed in the repository itself or in LibGit2Sharp.
Prerequisites
GitVersion package
GitVersion.Tool
GitVersion version
6.0.3
Operating system
Windows
What are you seeing?
following exception is thrown every time Gitversion is executed.
the Exceptions began with version 6.0.3
What is expected?
should not throw exception and should work as expected ^^
Steps to Reproduce
dotnet tool install GitVersion.Tool --version 6.* --create-manifest-if-needed
dotnet tool restore
dotnet dotnet-gitversion /config $ConfigFilePath /output buildserver
RepositoryFixture Test
No response
Output log or link to your CI build (if appropriate).
No response
The text was updated successfully, but these errors were encountered: