dotnet / msbuild

The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio.
https://docs.microsoft.com/visualstudio/msbuild/msbuild
MIT License
5.21k stars 1.35k forks source link

/bl and /m causes build to hang on complex project #3124

Open chsienki opened 6 years ago

chsienki commented 6 years ago

Steps to reproduce

Repro project: (MS Internal, do not share externally) \wolfgang\public\msbuild\repro

Command line

build.cmd 

Only occurs when running with both /bl and /m (enabled inside build.cmd). Removing /bl or setting /m:1 allows the build to succeed as expected.

A heap dump of the stuck build process is available here: (MS Internal) \wolfgang\public\msbuild\dotnet.dmp

Expected behavior

Build completes successfully

Actual behavior

Build hangs at random points, seems to be stuck in https://github.com/Microsoft/msbuild/blob/d83a9eda20970d2bfa3ad96d47cbecf93343256b/src/Build/BackEnd/Components/Logging/LoggingService.cs#L1073 waiting on a full queue.

Environment data

msbuild /version output: Microsoft (R) Build Engine version 15.5.90.54627 for .NET Core Copyright (C) Microsoft Corporation. All rights reserved.

15.5.90.54627

OS info: Windows 10 1709

If applicable, version of the tool that invokes MSBuild (Visual Studio, dotnet CLI, etc): Dotnet SDK 2.1.0-preview1-007063

KirillOsenkov commented 6 years ago

The hang also reproduces if you use a diag text logger:

  1. set environment variable MSBUILDTARGETOUTPUTLOGGING=1
  2. set environment variable MSBUILDLOGIMPORTS=1
  3. /m /flp:v=diag
japj commented 5 years ago

Is there any additional information on this issue? e.g. what triggers the "complex" project?