Skip to content

Populate runtime-async DiagnosticIP for Wasm R2R - #133768

Merged
davidwrighton merged 1 commit into
dotnet:mainfrom
davidwrighton:wasm-runtime-async-diagnostic-ip
Sep 14, 2026
Merged

davidwrighton merged 1 commit into
dotnet:mainfrom
davidwrighton:wasm-runtime-async-diagnostic-ip

Conversation

@davidwrighton

Copy link
Copy Markdown
Member

Fixes #133626

Summary

  • populate Wasm ReadyToRun CORINFO_AsyncResumeInfo.DiagnosticIP with the virtual IP of the containing method's start
  • add a compact ReadyToRun fixup section that records DiagnosticIP slots as delta/count/stride ULEB128 chunks
  • validate the section and apply the module virtual-IP base after ExecutionManager::AddVirtualIPRange
  • advance the ReadyToRun format to 29.0 so older runtimes reject images containing method-relative diagnostic IPs
  • preserve retry correctness by publishing fixup locations only after successful JIT code/data publication

Testing

  • dotnet test src\coreclr\tools\aot\ILCompiler.ReadyToRun.Tests\ILCompiler.ReadyToRun.Tests.csproj -c Release --filter RuntimeAsyncWasmDiagnosticIPFixups -p:TargetOS=browser -p:TargetArchitecture=wasm -p:CoreCLRConfiguration=Debug (1 passed, with --determinism-stress=2)
  • src\tests\build.cmd -Test async\async.csproj browser Debug (build succeeded; exactly one child test project selected)
  • rebuilt Wasm native runtime and Core_Root, then ran the generated async.cmd wrapper with ReadyToRun enabled (1 passed)
  • python src\coreclr\scripts\jitformat.py -r . -o windows -a x64
  • git diff --check

The exception regression test uses a synchronous test entry point to resume a runtime-async chain, prints Exception.StackTrace, and verifies these frames in order:

ThrowAfterResume
Level4
Level3
Level2
Level1
TestEntryPoint

With the old null DiagnosticIP behavior, the same test only reported ThrowAfterResume and TestEntryPoint and failed the frame assertions.

Note

This pull request description was generated by GitHub Copilot.

Loading
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[browser][CoreCLR][R2R] AsyncProfiler callstack identities are missing: Wasm ResumeInfo.DiagnosticIP is null

4 participants