Skip to content

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

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

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