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

Ensure context is not cached before logging info #6437

Merged
merged 3 commits into from May 11, 2021

Conversation

rainersigwald
Copy link
Member

@rainersigwald rainersigwald commented May 10, 2021

Work item (Internal use): AB#1325685

Summary

Fixes #6436 which causes this crash in cases where MSBuild's result
caching is turned on (generally this is for large builds in 32-bit
MSBuild).

Customer Impact

Customers with large builds see MSBuild crashes.

Regression?

Yes. Worked in 16.8, regressed in 16.9.0 because of #5997

Testing

Validated minimal repro (using forced caching) passes where it failed on released bits.

Risk

Low. Additional guarding falling into existing case so log output shouldn't suffer.

@KirillOsenkov
Copy link
Member

This is obscure enough that I don’t feel too guilty for breaking this! Longer term we should be thinking about how to safeguard against this in the future.

Also indicates that we should add a test with that env var to force this.

Thanks for the fix!

@rainersigwald rainersigwald changed the base branch from vs16.10 to vs16.9 May 10, 2021 20:07
Fixes dotnet#6436 which causes this crash in cases where MSBuild's result
caching is turned on (generally this is for large builds in 32-bit
MSBuild).

```
MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
Microsoft.Build.Shared.InternalErrorException: MSB0001: Internal MSBuild Error: We shouldn't be accessing the ProjectInstance when the configuration is cached.
   at Microsoft.Build.Shared.ErrorUtilities.ThrowInternalError(String message, Exception innerException, Object[] args)
   at Microsoft.Build.BackEnd.BuildRequestConfiguration.get_Project()
   at Microsoft.Build.BackEnd.Logging.NodeLoggingContext.LogProjectStarted(BuildRequest request, BuildRequestConfiguration configuration)
   at Microsoft.Build.BackEnd.Logging.NodeLoggingContext.LogRequestHandledFromCache(BuildRequest request, BuildRequestConfiguration configuration, BuildResult result)
   at Microsoft.Build.BackEnd.Scheduler.LogRequestHandledFromCache(BuildRequest request, BuildResult result)
   at Microsoft.Build.BackEnd.Scheduler.HandleRequestBlockedByNewRequests(SchedulableRequest parentRequest, BuildRequestBlocker blocker, List`1 responses)
   at Microsoft.Build.BackEnd.Scheduler.ReportRequestBlocked(Int32 nodeId, BuildRequestBlocker blocker)
   at Microsoft.Build.Execution.BuildManager.HandleNewRequest(Int32 node, BuildRequestBlocker blocker)
   at Microsoft.Build.Execution.BuildManager.ProcessPacket(Int32 node, INodePacket packet)
   at Microsoft.Build.Execution.BuildManager.<>c__DisplayClass76_0.<Microsoft.Build.BackEnd.INodePacketHandler.PacketReceived>b__0()
   at Microsoft.Build.Execution.BuildManager.ProcessWorkQueue(Action action)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.Build.Execution.BuildManager.EndBuild()
```
@rainersigwald
Copy link
Member Author

This is obscure enough that I don’t feel too guilty for breaking this!

💯

Also indicates that we should add a test with that env var to force this.

Also 💯. Trying to find a good spot for it.

.2 because we actually shipped a .1 but branded it .0.
@rainersigwald rainersigwald merged commit d661b1d into dotnet:vs16.9 May 11, 2021
@rainersigwald rainersigwald deleted the fix-#6436 branch May 11, 2021 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants