Skip to content

[ci-scan] Wasm.Build.Tests ManagedToNativeGenerator task host node crash #130133

Description

@kotlarmilos

Build Information

Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1491378
Build error leg or test failing: runtime / Build / browser-wasm linux Release — Helix work item WBT-NoWebcil-MONO-ST-Wasm.Build.Tests.PInvokeTableGeneratorTests (queue Ubuntu.2604.Amd64.Open)
Failing test (symptom): Wasm.Build.Tests.PInvokeTableGeneratorTests.UnmanagedStructAndMethodIn_SameAssembly_WithoutDisableRuntimeMarshallingAttribute_NotConsideredBlittable(config: Release, aot: False)
Pull request (first observed): #125437

Error Message

{
  "ErrorMessage": "error MSB4027: The \"ManagedToNativeGenerator\" task generated invalid items from the \"FileWrites\" output parameter. This object is no longer valid because the MetadataLoadContext that created it has been disposed.",
  "ErrorPattern": "",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Failure details:

The WASM not_blittable build inside PInvokeTableGeneratorTests is expected to fail with the diagnostic
error : Parameter types of pinvoke callback method '...' needs to be blittable. Instead, the
ManagedToNativeGenerator MSBuild task host crashed and the build failed early with:

WasmApp.Common.targets(787,5): error MSB4217: Task host node exited prematurely. Diagnostic information may be found in files in the temporary files directory named MSBuild_*.failure.txt.
WasmApp.Common.targets(796,7): error MSB4027: The "ManagedToNativeGenerator" task generated invalid items from the "FileWrites" output parameter. This object is no longer valid because the MetadataLoadContext that created it has been disposed.

Because the expected pinvoke-blittable diagnostic never printed, the test's Assert.Matches failed downstream:

Wasm.Build.Tests.PInvokeTableGeneratorTests.UnmanagedStructAndMethodIn_SameAssembly_WithoutDisableRuntimeMarshallingAttribute_NotConsideredBlittable(config: Release, aot: False) [FAIL]
  Assert.Matches() Failure: Pattern not found in value
  Regex: "error.*Parameter.*types.*pinvoke.*.*blittable"
  Value: "[]   Determining projects to restore...\n[]   Rest"...
  /_/src/mono/wasm/Wasm.Build.Tests/PInvokeTableGeneratorTests.cs(32,0)

The Assert.Matches Pattern not found message and the WorkItemExecution ... BadExit entry that Build
Analysis lists separately are both symptoms of the same root cause: the ManagedToNativeGenerator
task-host crash (MSB4217 + MSB4027 MetadataLoadContext ... has been disposed). Tracking the root
cause is more reusable than the downstream assertion text.

This is an infrastructure/flaky MSBuild task-host crash (Build Analysis reports a ~0.24% failure rate) and
is unrelated to the change in PR #125437 (Apple-mobile NativeAOT library tests).

Affected legs:

  • runtime / Build / browser-wasm linux Release → Helix WBT-NoWebcil-MONO-ST-Wasm.Build.Tests.PInvokeTableGeneratorTests

Console Log:

  • console.352ebce7.log (runId 41125472), work item WBT-NoWebcil-MONO-ST-Wasm.Build.Tests.PInvokeTableGeneratorTests

First build in window:

Recommended action:
File as a Known Build Error so Build Analysis correlates future occurrences of the ManagedToNativeGenerator
task-host crash. Consider setting BuildRetry: true if this flake recurs frequently, since the crash is
transient and a rebuild typically produces the expected diagnostic.

Note

This issue was drafted with GitHub Copilot assistance and reviewed by the submitting developer.

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1491378
Error message validated: [error MSB4027: The "ManagedToNativeGenerator" task generated invalid items from the "FileWrites" output parameter. This object is no longer valid because the MetadataLoadContext that created it has been disposed.]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 7/2/2026 4:17:46 PM UTC

Report

Build Repository Test Pull Request
1588168 dotnet/runtime Wasm.Build.Tests.PInvokeTableGeneratorTests.UnmanagedStructAndMethodIn_SameAssembly_WithoutDisableRuntimeMarshallingAttribute_NotConsideredBlittable(config: Release, aot: False) #133461
1586814 dotnet/runtime Wasm.Build.Tests.PInvokeTableGeneratorTests.UnmanagedStructAndMethodIn_SameAssembly_WithoutDisableRuntimeMarshallingAttribute_NotConsideredBlittable(config: Release, aot: False)
1553903 dotnet/runtime WBT-NoWorkload-CLR-ST-Wasm.Build.Tests.PInvokeTableGeneratorTests.WorkItemExecution #132315

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
2 2 3

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions