Add diagnostic data to crash/hang telemetry and move null-Project check after RetrieveFromCache#13332
Merged
YuliiaKovalova merged 7 commits intomainfrom Mar 6, 2026
Conversation
…ck after RetrieveFromCache
Fix for StackHash 2B72B3348620C2E9CF25384A59F497EE4B2D821600C3868D04BD9080EDBB714C
Root cause: In VS scenarios with project cache plugins, HandleBuildResultAsync
in ProjectCacheService crashes with InternalErrorException('Project unexpectedly
null') when a build result arrives from an out-of-proc node for a configuration
whose ProjectInstance was never loaded locally.
The VerifyThrowInternalNull assertion fires before RetrieveFromCache is called,
so configurations that were cached to disk never get a chance to restore their
ProjectInstance. This causes false build failures and can lead to EndBuild hangs
when _scheduler.ReportResult is skipped due to the crash.
Changes:
- ProjectCacheService: Move VerifyThrowInternalNull after RetrieveFromCache
- CrashTelemetry: Add IsStandaloneExecution, MaxNodeCount, ActiveNodeCount,
SubmissionCount properties for crash/hang diagnostics
- CrashTelemetryRecorder: Pass new diagnostic properties through all paths
- BuildManager: Report build state (node count, submission count, standalone
flag) in crash telemetry; include submission:config ID mapping in hang
diagnostic dump file
- XMake: Pass isStandaloneExecution=true for CLI crash telemetry
Telemetry: 4 customers hit this crash in VS 18.5-18.6 building the VS repo.
All internal Microsoft developers. Same StackHash across VS versions.
8437060 to
9f8d2a7
Compare
YuliiaKovalova
commented
Mar 5, 2026
rainersigwald
approved these changes
Mar 5, 2026
…//github.com/dotnet/msbuild into dev/crash-telemetry-diagnostics-project-null
This was referenced Mar 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause:
In VS scenarios with project cache plugins, HandleBuildResultAsync in ProjectCacheService crashes with InternalErrorException('Project unexpectedly null') when a build result arrives from an out-of-proc node for a configuration whose ProjectInstance was never loaded locally.
The VerifyThrowInternalNull assertion fires before RetrieveFromCache is called, so configurations that were cached to disk never get a chance to restore their ProjectInstance. This causes false build failures and can lead to EndBuild hangs when _scheduler.ReportResult is skipped due to the crash.
Changes: