Skip to content

task instantiation occassionaly fails in -mt mode #12735

@SimaTian

Description

@SimaTian

Issue Description

While running the benchmarks for -mt mode, I've noticed an occassional crash.
It is caused by error MSB4061: The "CombineTargetFrameworkInfoProperties" task could not be instantiated
and I suspect there is some contention happening during the task initialization.

Steps to Reproduce

Run the test script to repeatedly build the framework project.
Most of the time, the build will proceed normally, however once in a while, it will crash due to MSB4061

=== FINAL SUMMARY ===
Total iterations: 200
Successful builds: 197
Failed builds: 3
Clean failures: 0
Success rate: 98.5%
Total duration: 7 minutes
Average time per iteration: 2.1 seconds

Test script:
MSBuildLoopTest.zip
Binlog:
bl147.zip
Repro project:
framework_project.zip

Expected Behavior

The build doesn't fail and task get instantiated normally.

Actual Behavior

MSB4061 causing build failure

Analysis

My current theory is that two threads attempt to instantiate the same task and run into each other, causing one of them to fail.

D:\bld\artifacts\bin\bootstrap\net472\MSBuild\Current\bin\Microsoft.Common.CurrentVersion.targets(2012,5): error MSB4061: The "CombineTargetFrameworkInfoProperties" task could not be instantiated from "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". Object reference not set to an instance of an object. [D:\picasso\framework_console_app\framework_only\MotivationalQuotes\MotivationalQuotes.csproj]

Versions & Configurations

https://github.com/AR-May/msbuild/tree/new-tasks-api-implementations-2-prototype

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions