Repository navigation
[WASI][CoreCLR] wasm trap: uninitialized element #133240
Copy link
Copy link
Closed
Labels
Known Build ErrorUse this to report build issues in the .NET Helix tabUse this to report build issues in the .NET Helix tabarch-wasmWebAssembly architectureWebAssembly architecturearea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIos-wasiRelated to WASI variant of arch-wasmRelated to WASI variant of arch-wasm
Milestone
Description
Build Information
Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1582547
Build error leg or test failing: WASI CoreCLR
Error Message
wasmtime run -W exceptions=y -S http --dir /root/helix/work/workitem/e/JIT/Generics/JIT.Generics::/ --dir /root/helix/work/correlation::/core --env CORE_ROOT=/core --env DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true --env DOTNET_WASI_PRINT_EXIT_CODE=1 /root/helix/work/correlation/corerun -p System.Reflection.Metadata.MetadataUpdater.IsSupported=false -p System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true JIT.Generics.dll ''
Error: failed to run main module `/root/helix/work/correlation/corerun`
Caused by:
0: failed to invoke `run` function
1: error while executing at wasm backtrace:
0: 0x1c918e - corerun!InvokeUnmanagedCalli(unsigned long, void (*)(unsigned long, signed char*, signed char*), signed char*, signed char*)
1: 0x16fee9 - corerun!InvokeUnmanagedCalliWithTransition(unsigned long, void (*)(unsigned long, signed char*, signed char*), signed char*, InterpMethodContextFrame*, signed char*, signed char*)
2: 0x176119 - corerun!InterpExecMethod(InterpreterFrame*, InterpMethodContextFrame*, InterpThreadContext*, ExceptionClauseArgs*)
3: 0x1c6070 - corerun!ExecuteInterpretedMethod
4: 0x1c6b05 - corerun!ExecuteInterpretedMethodFromUnmanaged
5: 0x2fc212 - corerun!Call_System_Private_CoreLib_System_Environment_CallEntryPoint_I32_I32_I32_I32_I32_RetVoid(void*, void*, void*, int, void*)
6: 0x2e201f - corerun!void UnmanagedCallersOnlyCaller::InvokeThrowing<long, PtrArray**, int*, bool>(long, PtrArray**, int*, bool)
7: 0x2e1dec - corerun!RunMain(MethodDesc*, int*, PtrArray**, bool)
8: 0x2e2396 - corerun!Assembly::ExecuteMainMethod(PtrArray**, bool)
9: 0x1ab02f - corerun!CorHost2::ExecuteAssembly(unsigned int, char16_t const*, int, char16_t const**, unsigned int*)
10: 0x2fa964 - corerun!coreclr_execute_assembly
11: 0x5487d - corerun!main
12: 0xce6a - corerun!__main_void
13: 0xcd63 - corerun!_start
note: using the `WASMTIME_BACKTRACE_DETAILS=1` environment variable may show more debugging information
2: wasm trap: uninitialized element
{
"ErrorMessage": "uninitialized element",
"BuildRetry": false,
"ExcludeConsoleLog": false
}Known issue validation
Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1582547
Error message validated: [uninitialized element]
Result validation: ❌ Known issue did not match with the provided build.
Validation performed at: 9/4/2026 3:14:17 PM UTC
Report
| Build | Repository | Test | Pull Request |
|---|---|---|---|
| 1645826 | dotnet/runtime | reflection.WorkItemExecution | #136259 |
| 1620394 | dotnet/runtime | reflection.WorkItemExecution | #134966 |
| 1618574 | dotnet/runtime | reflection.WorkItemExecution | #134966 |
| 1617446 | dotnet/runtime | jit64_5.WorkItemExecution | #134813 |
Summary
| 24-Hour Hit Count | 7-Day Hit Count | 1-Month Count |
|---|---|---|
| 0 | 1 | 4 |
Metadata
Metadata
Assignees
Labels
Known Build ErrorUse this to report build issues in the .NET Helix tabUse this to report build issues in the .NET Helix tabarch-wasmWebAssembly architectureWebAssembly architecturearea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIos-wasiRelated to WASI variant of arch-wasmRelated to WASI variant of arch-wasm
Activity
dotnet-policy-service commentedon Sep 4, 2026
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
See info in area-owners.md if you want to be subscribed.
dotnet-policy-service commentedon Sep 4, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
lewing commentedon Oct 27, 2026
Analysis
Mechanism. On WASI, an unmanaged
calli(which is how P/Invoke and QCall IL stubs make their calls) needs a thunk from the checked-insrc/coreclr/vm/wasm/wasi/callhelpers-*.cpptables. When the signature is missing,ComputeCalliSigThunkreturns NULL (src/coreclr/vm/wasm/helpers.cpp). In Release the_ASSERTis compiled out, soInvokeUnmanagedCallicalls through table slot 0 and wasmtime reportswasm trap: uninitialized element.Every hit I could trace was a PR whose thunk tables were stale at the time:
callhelpers-pinvoke.cpp, Oct 3The Helix logs for 1617446, 1618574, and 1620394 have expired, so those three rows are a timing match rather than confirmed stacks.
The latest hit (1645826) is a different failure. It traps in
NativeImage::~NativeImagein the R2R lane, where that PR broke 25 of 26 work items (crossgen2 asserts,unreachabletraps). It matched only because this issue's error text is justuninitialized element.Prevention. Since #135156 (Oct 7),
wasm-coreclr-callhelpers-check.ymlregenerates the tables in CI and fails any PR whose checked-in call helpers are stale, so this can no longer reach main. A PR can still hit the trap in its own test legs before it regenerates; the CI check will flag that PR.Better reporting for a missing thunk, instead of a null-slot trap, is tracked by #133124.
Closing, since the root cause is fixed and now guarded by CI.
Note
This comment was generated with the assistance of GitHub Copilot.