Skip to content

StackoverflowException when using msbuild in VS2017 in 4.0.0-beta11 #1195

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

Closed
kpanwar opened this issue Mar 26, 2017 · 3 comments
Closed

StackoverflowException when using msbuild in VS2017 in 4.0.0-beta11 #1195

kpanwar opened this issue Mar 26, 2017 · 3 comments

Comments

@kpanwar
Copy link

kpanwar commented Mar 26, 2017

I am seeing a stackoverflow crash when I try to build a branch that has just been merged with changes from dev (parent) branch.

Some portion of the log is


     3>MSBUILD : warning :
                                   WARN [03/26/17 3:30:04:52] Failed to inherit Increment branch configuration, no bran
       ches found.\r [C:\git\msal-dotnet\src\Microsoft.Identity.Client\Microsoft.Identity.Client.csproj]
MSBUILD : warning : \r [C:\git\msal-dotnet\src\Microsoft.Identity.Client\Microsoft.Identity.Client.csproj]
       MSBUILD : warning : Falling back to origin/master branch config [C:\git\msal-dotnet\src\Microsoft.Identity.Clien
       t\Microsoft.Identity.Client.csproj]

                   INFO [03/26/17 3:30:04:52] No branch configuration found for branch origin/master, falling back to d
         efault configuration

                   INFO [03/26/17 3:30:04:52] Begin: Attempting to inherit branch configuration from parent branch

                     INFO [03/26/17 3:30:04:52] HEAD is merge commit, this is likely a pull request using dev as base

                     INFO [03/26/17 3:30:04:52] Begin: Finding branch source of 'dev'

                     INFO [03/26/17 3:30:04:52] End: Finding branch source of 'dev' (Took: 0.00ms)

                     INFO [03/26/17 3:30:04:52] Begin: Getting branches containing the commit '923177e62783491c8d9fc47e
         a476b5226d70a5b3'.

                       INFO [03/26/17 3:30:04:52] Trying to find direct branches.

                       INFO [03/26/17 3:30:04:52] No direct branches found, searching through tracked branches.

                     INFO [03/26/17 3:30:04:53] End: Getting branches containing the commit '923177e62783491c8d9fc47ea4
         76b5226d70a5b3'. (Took: 1.00ms)

                     INFO [03/26/17 3:30:04:53] Found possible parent branches:
     3>MSBUILD : warning :
                                     WARN [03/26/17 3:30:04:53] Failed to inherit Increment branch configuration, no br
       anches found.\r [C:\git\msal-dotnet\src\Microsoft.Identity.Client\Microsoft.Identity.Client.csproj]
MSBUILD : warning : \r [C:\git\msal-dotnet\src\Microsoft.Identity.Client\Microsoft.Identity.Client.csproj]
       MSBUILD : warning : Falling back to origin/master branch config [C:\git\msal-dotnet\src\Microsoft.Identity.Clien
       t\Microsoft.Identity.Client.csproj]

                     INFO [03/26/17 3:30:04:53] No branch configuration found for branch origin/master, falling back to
          default configuration

                     INFO [03/26/17 3:30:04:53] Begin: Attempting to inherit branch configuration from parent branch

                       INFO [03/26/17 3:30:04:53] HEAD is merge commit, this is likely a pull request using dev as base

                       INFO [03/26/17 3:30:04:53] Begin: Finding branch source of 'dev'

                       INFO [03/26/17 3:30:04:53] End: Finding branch source of 'dev' (Took: 1.00ms)

                       INFO [03/26/17 3:30:04:53] Begin: Getting branches containing the commit '923177e62783491c8d9fc4
         7ea476b5226d70a5b3'.

                         INFO [03/26/17 3:30:04:53] Trying to find direct branches.

                         INFO [03/26/17 3:30:04:53] No direct branches found, searching through tracked branches.

                       INFO [03/26/17 3:30:04:53] End: Getting branches containing the commit '923177e62783491c8d9fc47e
         a476b5226d70a5b3'. (Took: 0.00ms)

                       INFO [03/26/17 3:30:04:53] Found possible parent branches:
     3>MSBUILD : warning :
                                       WARN [03/26/17 3:30:04:54] Failed to inherit Increment branch configuration, no
       branches found.\r [C:\git\msal-dotnet\src\Microsoft.Identity.Client\Microsoft.Identity.Client.csproj]
MSBUILD : warning : \r [C:\git\msal-dotnet\src\Microsoft.Identity.Client\Microsoft.Identity.Client.csproj]
       MSBUILD : warning : Falling back to origin/master branch config [C:\git\msal-dotnet\src\Microsoft.Identity.Clien
       t\Microsoft.Identity.Client.csproj]

Process is terminated due to StackOverflowException.

For repro, you can use https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/tree/kpanwar/client-info-67 branch.

@kpanwar kpanwar changed the title Stackoverflow when using msbuild StackoverflowException when using msbuild in VS2017 Mar 26, 2017
@kpanwar kpanwar changed the title StackoverflowException when using msbuild in VS2017 StackoverflowException when using msbuild in VS2017 in 4.0.0-beta11 Mar 30, 2017
@CraigN
Copy link

CraigN commented Nov 15, 2017

We are experiencing what appears to be the same issue. We are using a Gitflow workflow in ContinuousDeployment mode for our feature branches and doing pull request review/merge commits using BitBucket.

Steps to reproduce using GitVersion 4 beta 12:

  1. Create a feature branch (feature-123) off develop.
  2. Create a task branch (task-1) off the feature branch.
  3. Commit to the task branch.
  4. Push the task branch.
  5. Create a PR on BitBucket targeting the feature branch and merge using merge commit.
  6. Checkout the feature branch.
  7. Run GitVersion and see the version OK.
  8. Do a git pull to get the merged task branch.
  9. Run GitVersion and after a little while a StackOverflowException occurs.
  10. Delete the local task branch with git branch -d task-1,
  11. Run GitVersion and see the new version OK.

From a GitVersion /diag before deleting the merged local branch it appears the local task branch is confusing GitVersion. First I notice that it was unable to find possible parent branches:

  INFO [11/14/17 20:33:53:21] Found possible parent branches:
  WARN [11/14/17 20:33:53:22] Failed to inherit Increment branch configuration, no branches found.

Next it then gets stuck in a recursive loop doing the following until it crashes with :

Falling back to develop branch config
  INFO [11/14/17 20:33:53:22] Begin: Attempting to inherit branch configuration from parent branch
    INFO [11/14/17 20:33:53:22] HEAD is merge commit, this is likely a pull request using task-1 as base
    INFO [11/14/17 20:33:53:22] Begin: Finding branch source of 'task-1'
    INFO [11/14/17 20:33:53:22] End: Finding branch source of 'task-1' (Took: 1.97ms)
    INFO [11/14/17 20:33:53:22] Begin: Getting branches containing the commit 'c9233d7fa3d7d565d7fe418764641e5c50caa041'.
      INFO [11/14/17 20:33:53:22] Trying to find direct branches.
      INFO [11/14/17 20:33:53:22] No direct branches found, searching through tracked branches.
    INFO [11/14/17 20:33:53:22] End: Getting branches containing the commit 'c9233d7fa3d7d565d7fe418764641e5c50caa041'. (Took: 2.00ms)
    INFO [11/14/17 20:33:53:22] Found possible parent branches:
    WARN [11/14/17 20:33:53:22] Failed to inherit Increment branch configuration, no branches found.

@JakeGinnivan
Copy link
Contributor

I just hit this, the next part of the logs is interesting, I think this got added after your investigation @CraigN

[15:55:32][Step 2/2]                     WARN [12/04/17 7:55:32:33] Failed to inherit Increment branch configuration, no branches found.
[15:55:32][Step 2/2] 
[15:55:32][Step 2/2] Falling back to origin/master branch config
[15:55:32][Step 2/2]                     INFO [12/04/17 7:55:32:33] No branch configuration found for branch origin/master, falling back to default configuration
[15:55:32][Step 2/2]                     INFO [12/04/17 7:55:32:33] Begin: Attempting to inherit branch configuration from parent branch

The root cause is private const IncrementStrategy DefaultIncrementStrategy = IncrementStrategy.Inherit;

We fall back to that, which then starts looking again...

I actually don't know how my build server is hitting this, we really need to kill branch normalisation because it makes it impossible to debug. BUT I think there is another fix, when building the PR merge result, if we use the PR HEAD instead of the merge result we should be able to calculate the correct config. Going to put up a PR

@DzonnyDZ
Copy link

DzonnyDZ commented Aug 6, 2019

This is not fixed in 5.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants