Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack overflow exception in 3.6.5 #1328

Closed
PreetSangha opened this issue Nov 23, 2017 · 15 comments
Closed

Stack overflow exception in 3.6.5 #1328

PreetSangha opened this issue Nov 23, 2017 · 15 comments
Labels

Comments

@PreetSangha
Copy link

This happens on our TFS Build system.

I've attached the log.

4_GitVersion.zip

I think what's happening is the fallback search for the master branch is returning feature/ExProSlowness_MergeForMaster before master

2017-11-23_17-49-40

What would you suggest as the best workaround please?

@asbjornu
Copy link
Member

Please upgrade to v4 beta. It has changed a lot in this area and might have fixed the issue.

@sumo300
Copy link

sumo300 commented Jul 13, 2018

FYI, we are now receiving stack overflow errors via the GitVersion TFS/VSTS build task. But, if I use it locally from the Chocolatey package (which still has 3.6.4), it works fine and quickly. When it fails on TFS (2018 Update 2), it is generating a large log file and ends with a stack overflow error. If you need the full log, I can attach, but I'll have to scrub it first. Here's the snippet from the actual exception:

2018-07-13T20:34:15.2628862Z ##[error]Process is terminated due to StackOverflowException.
2018-07-13T20:34:18.2374218Z ##[error]System.Exception: Unexpected exit code -1073741571 returned from tool GitVersion.exe
2018-07-13T20:34:18.2374953Z    at Microsoft.TeamFoundation.DistributedTask.Task.Internal.InvokeToolCmdlet.ProcessRecord()
2018-07-13T20:34:18.2375163Z    at System.Management.Automation.CommandProcessor.ProcessRecord()
2018-07-13T20:34:18.3198535Z ##[error]PowerShell script completed with 1 errors.
2018-07-13T20:34:18.3210976Z ##[section]Finishing: GitVersion

I verified the version that TFS is using through the task and it's 3.6.5. This obviously is not something we can update to v4 beta.

@sumo300
Copy link

sumo300 commented Jul 16, 2018

@asbjornu given that this is now breaking some of our critical builds, is there a workaround when used with TFS? I checked the log and there's no way I'm scrubbing it. It's 84 MB. It seems now when it is trying to get a version from a feature branch, its process of trying to figure out what the actual version is keeps falling back so many times that it just runs out of memory, I'm guessing.

@asbjornu
Copy link
Member

@sumo300, I don't have a solution to this other than somehow upgrading to v4. I will work to get a stable v4 out the door if that's of any help. From which source do you consume/install GitVersion as upgrading to v4 is not an option?

@sumo300
Copy link

sumo300 commented Jul 16, 2018

@asbjornu It's whatever is included in the GitVersion TFS/VSTS extension. We don't install GitVersion on its own and I don't think it would be used if we did on the build servers, specifically this one:

https://marketplace.visualstudio.com/items?itemName=gittools.gitversion#overview

@sumo300
Copy link

sumo300 commented Jul 16, 2018

@asbjornu Interesting detail. We abandoned the pull request where the build was failing due to GitVersion. Created a new PR and it worked fine. So, we're not blocked any more. We will be looking for the 4.0 version. :)

@sumo300
Copy link

sumo300 commented Jul 19, 2018

@asbjornu Just note that abandoning the PR and re-submitting only works every once in a while. This issue is occurring pretty frequently. If there was a way to get the GitVersion TFS extension that used the beta version, we'd certainly try it.

@ilyalukinykh
Copy link

Looks like this issue #1518 is related to this problem as well.

  1. Is it related only to TFS?
  2. Since the issue is not really reproducible, is there any understanding of what actually causes this infinite loop?
  3. Is there any workaround to mitigate the issue?

@sumo300
Copy link

sumo300 commented Mar 26, 2019

@ilyalukinykh

  1. It may be related to how TFS/Azure DevOps clones/fetches the Git repo, but it's just Git and you can see what commands are run in the log file I've attached on Stack overflow due to infinite loop falling back to branch config #1518.

  2. It seems to be related to how it digs into what is the parent branch/tag to the commit being built. It gets stuck looping constantly. Again, you can see these details in the log attached to Stack overflow due to infinite loop falling back to branch config #1518. All of the commands run for Git as well as what is run for GitVersion is present in the log.

  3. There have been inconsistent workarounds. Three different workarounds have been attempted. We've changed settings for GitVersion itself, we've cleaned up old branches, and we've messed with settings that tell TFS/Azure DevOps how to clean the source folder on the build server to force it to do a fresh clone every time rather than just a fetch. All work for a while or for one repository, but not for all consistently.

@KotreshAvinalli
Copy link

I Still see the same issue in GitVersion 4.0.3 (when it is merging from MAster to Develop). I feel, the issue is related to PR commits.

Any update on this? I have created a separate bug for the same without know here it is;(.
Duplicate of #1696

@asbjornu
Copy link
Member

asbjornu commented Jun 3, 2019

Are any of the repositories this problem is occurring in available publicly?

@KotreshAvinalli
Copy link

I don't have a public repository. But I can share you complete logs if you need. Please let me know the location where you want to copy.

@KotreshAvinalli
Copy link

Hi asbjornu,

We have completely blocked with this issue. We have tried with back merging Develop to a feature branch and merging Master to the same feature branch. Again, it is failing with same issue.

Any help would be greatly appreciated.

Thanks,
Kotresh

@asbjornu
Copy link
Member

asbjornu commented Jun 4, 2019

I don't suppose logs will help much in debugging this issue. We would need to set a breakpoint, run the code and see where it breaks and what state the application is in at that moment. If you can do that with the source code of GitVersion on your private failing repository, it would be very valuable to us.

@stale
Copy link

stale bot commented Sep 2, 2019

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 2, 2019
@stale stale bot closed this as completed Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants