Skip to content

Trimmed publish test can fail with ILLink AccessViolationException on macOS #2586

Description

@Widthdom

Summary

During issue #2548 validation, the full dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj run failed in IndexCommandRunnerTests.RunBackfillFold_PublishedTrimmedBinary_SerializesSuccessAndErrorJson while publishing the trimmed CLI.

Evidence

Command attempted:

dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj

Observed failure:

System.InvalidOperationException: dotnet publish failed
Fatal error. System.AccessViolationException: Attempted to read or write protected memory.
   at System.IO.UnmanagedMemoryStream.ReadByte()
   at System.IO.BinaryReader.ReadByte()
   at Mono.Cecil.Cil.CodeReader.ReadMethodBody()
   ...
/Users/widthdom/.nuget/packages/microsoft.net.illink.tasks/8.0.22/build/Microsoft.NET.ILLink.targets(134,5): error MSB6006: "dotnet" exited with code 134.
/Users/widthdom/.nuget/packages/microsoft.net.illink.tasks/8.0.22/build/Microsoft.NET.ILLink.targets(87,5): error NETSDK1144: Could not optimize assemblies for size.

Environment context: macOS arm64 local run, SDK 10.0.100, test target included net8.0/net9.0. Other concurrent dotnet test/publish work was present on the machine, so this may be intermittent or environment-sensitive.

Notes

This was discovered while validating #2548 and appears unrelated to that console-stream serialization fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions