Skip to content

[wasm][R2R] Exception thrown from a finally reached by leave is reported as unhandled instead of reaching the caller's catch (b51875, b77707) #134975

Description

@lewing

Description

JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b51875 fails when the test assembly is compiled with crossgen2 for browser-wasm. AA.Main1 leaves a try with goto, and its finally throws. TestEntryPoint wraps the call in try { ... } catch (Exception). That catch is never reached: the runtime reports the exception as unhandled and aborts the process:

Running test: global::b51875.AA.TestEntryPoint()
Unhandled exception. System.Exception: Exception of type 'System.Exception' was thrown.
   at b51875.AA.Main1()
Aborted(native code called abort())
RuntimeError: unreachable

Because the process aborts, the merged runner stops and the remaining tests in it report no results.

Both copies fail:

  • Regression_8 (b51875/b51875.cs)
  • Regression_PdbOnly_r_2 (b51875/Desktop/b51875.cs)

The same work items pass in the browser-wasm interpreter leg (interpreted test code over R2R CoreLib), so the failure is specific to test code compiled with ReadyToRun.

The module-validation bug for this test (#129335, missing function-body end opcode) is fixed. Now that the module loads, this EH propagation failure is visible.

b77707 (Regression_PdbOnly_r_2) fails the same way, found once b51875 stopped crashing that runner. AA.Method1 leaves its try with return, and its finally throws:

Unhandled exception. System.Exception: Exception of type 'System.Exception' was thrown.
   at b77707.AA.Method1()
Aborted(native code called abort())

Configuration

Note

This issue was drafted with GitHub Copilot assistance.

Activity

  1. added
    arch-wasmWebAssembly architecture
    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
    os-browserBrowser variant of arch-wasm
    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. changed the title [-][wasm][R2R] Exception thrown from a finally reached by leave is reported as unhandled instead of reaching the caller's catch (b51875)[/-] [+][wasm][R2R] Exception thrown from a finally reached by leave is reported as unhandled instead of reaching the caller's catch (b51875, b77707)[/+] on Sep 30, 2026
  7. self-assigned this
    on Sep 30, 2026
  8. added a commit that references this issue on Oct 1, 2026
    9997fdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions