Skip to content

10.x: Native AOT published with the .NET 11 SDK traps (SIGTRAP) on the first value set ToString (dotnet/runtime#136073) #299

Closed

Description

@CaffeinatedCoder

Problem

A Native AOT publish of a consumer with the .NET 11 SDK (RC2 11.0.100-rc.2.26504.105, ILCompiler 11.0.0-rc.2, osx-arm64) dies with SIGTRAP (exit 133, nothing on stderr) on the first ToString() of any value set. ILCompiler compiles the instantiating stub for the default IFormattable.ToString of IValueSetFactory<TSet, T> to a trap (dotnet/runtime#136073), and every set type's ToString() runs through that default.

#291 measured this on the 11 line and against the unchanged 10.0.0 package: a net11.0 program referencing CodoMetis.ValueRanges 10.0.0 traps the same way. So the released 10.x line meets it through every consumer who publishes Native AOT with the .NET 11 SDK. That is a realistic LTS configuration: 10.x is supported to 2028-11, and 11.x carries a breaking surface change (#275), so applications that move to .NET 11 and keep the 10.x packages are expected.

Not reproduced in this repository's CI, which has no .NET 11 SDK; the 10.0.0 package passes test/consumer-smoke-test.sh's NativeAOT leg under the .NET 10 SDK. Loud, not silent.

Change

Port the #291 workaround from PR #292 to release/10.x: every set type (the twelve core families, their wrapper arities, the five NodaTime families) implements IFormattable.ToString explicitly and its ToString() calls SetFormat.Format directly, so the interface's default is never the implementation a compiled consumer runs. The interface keeps its default. Public surface unchanged (explicit interface implementations), so the ApiCompat baseline against 10.0.0 holds.

PR #292 is a single commit holding the whole retarget, so this is a hand-extracted commit that names the PR, not a cherry-pick -x.

Done when

A net11.0 NativeAOT consumer of the 10.1.0 packages prints every set type, measured with the .NET 11 RC2 (or newer) SDK, and test/consumer-smoke-test.sh says how to run its AOT leg with a .NET 11 SDK (a global.json beside the consumer), so the check can be repeated by hand until #297 decides whether 10.x CI gets a .NET 11 SDK leg.

Activity

  1. added this to the 10.0.1 milestone on Oct 19, 2026
  2. added
    area/value-setsValue set families and wrapper arities
    package/nodatimeAffects CodoMetis.ValueRanges.NodaTime
    area/aotNative AOT and trimming
    package/coreAffects CodoMetis.ValueRanges
    severity/highWrong results, crash or failed writes in a realistic scenario
    on Oct 19, 2026
  3. CaffeinatedCoder commented on Oct 19, 2026

    @CaffeinatedCoder
    OwnerAuthor

    Port is in #309 (against release/10.x). Measured with SDK 11.0.100-rc.2.26504.105 on osx-arm64 through SMOKE_AOT_SDK=… test/consumer-smoke-test.sh: the base without the change (48b9651) traps with exit 133 after aot-float64set; with the change the native binary runs to the end and the new aot-set-tostring-every-family case prints all seventeen families. The smoke test's header now says how to run its AOT leg with a .NET 11 SDK. Close by hand once #309 merges, since Closes acts only on main.

  4. CaffeinatedCoder commented on Oct 19, 2026

    @CaffeinatedCoder
    OwnerAuthor

    Fixed on release/10.x by PR #309 (merge commit 4233dea, 2026-10-19). Closed by hand: Closes acts only on main, where the workaround arrived with PR #292 (#291).

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

    area/aotNative AOT and trimmingarea/value-setsValue set families and wrapper aritiesbugSomething isn't workingpackage/coreAffects CodoMetis.ValueRangespackage/nodatimeAffects CodoMetis.ValueRanges.NodaTimeseverity/highWrong results, crash or failed writes in a realistic scenario

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions