Skip to content

[wasi][R2R] unreachable trap in SocketAsyncEventArgs.DnsConnectAsync state machine #134948

Open

Description

@lewing

Description

With CoreCLR WASI ReadyToRun, System.Net.Sockets.Tests crashes with wasm trap: wasm unreachable instruction executed inside R2R code for SocketAsyncEventArgs.DnsConnectAsync:

wasm trap: wasm `unreachable` instruction executed
    0: corerun!System_Net_Sockets_System_Net_Sockets_SocketAsyncEventArgs___DnsConnectAsync_g__Core_113_0_d__MoveNext
    1: corerun!WasmDelayLoadHelper->EagerImports->SignaturePointer_ReadyToRunHelper_DelayLoad_MethodCall(Kind:DelayLoadHelper,Sig:vTp)
    2: corerun!S_P_CoreLib_System_Runtime_CompilerServices_AsyncMethodBuilderCore__Start<...DnsConnectAsync...>
    ...

The last test started was System.Net.Sockets.Tests.SocketTaskExtensionsTest.EnsureMethodsAreCallable. An unreachable in compiled code usually comes from a JIT-side not-yet-implemented path. The compilation options include JitWasmNyiToR2RUnsupported, which should reject such methods rather than emit a trap. Look at the wasm for this MoveNext to find the trapping construct.

Seen in trimmed ReadyToRun runs of the CoreCLR WASI library tests for #134813. The non-R2R CI lane also fails this suite; its signature has not been compared yet.

Note

This issue was drafted with the help of GitHub Copilot.

Activity

  1. added
    arch-wasmWebAssembly architecture
    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
    on Sep 30, 2026
  2. dotnet-policy-service commented on Sep 30, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
    See info in area-owners.md if you want to be subscribed.

  3. dotnet-policy-service commented on Sep 30, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
    See info in area-owners.md if you want to be subscribed.

  4. removed
    untriagedNew issue has not been triaged by the area owner
    on Sep 30, 2026
  5. added this to the 12.0.0 milestone on Sep 30, 2026
  6. added
    os-wasiRelated to WASI variant of arch-wasm
    on Sep 30, 2026
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

    arch-wasmWebAssembly architecturearea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIos-wasiRelated to WASI variant of arch-wasm

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions