Skip to content

[clr-ios] FuncEval does not work on iOS because executable memory allocation fails #125959

Closed

Description

@kotlarmilos

Description

FuncEval does not work on iOS because executable memory allocation fails. This has two causes: the PAL does not enable MAP_JIT on iOS, and the debugger heap crashes when VirtualAlloc returns NULL.

Impact

Property evaluation in the variables panel, Debug Console expressions, conditional breakpoints with expressions, and ToString() don't work.

Root cause

1. MAP_JIT not enabled for iOS

The PAL gates MAP_JIT support (virtual.cpp line 586) and PAL_JitWriteProtect (pal.h) on HOST_OSX. On iOS, HOST_IOS is defined but HOST_OSX is not, so VirtualAlloc with PAGE_EXECUTE_READWRITE always returns NULL and PAL_JitWriteProtect is a no-op.

2. AddNewPage crashes on NULL
DebuggerHeapExecutableMemoryAllocator::AddNewPage does not check for VirtualAlloc returning NULL. It proceeds to placement-new on the NULL pointer, causing SIGSEGV.

Proposed fix

https://github.com/kotlarmilos/runtime/tree/fix/ios-debugger-interpreter-crashes

Activity

  1. added
    untriaged
    on Mar 23, 2026
  2. dotnet-policy-service commented on Mar 23, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @agocke, @jeffschwMSFT, @elinor-fung
    See info in area-owners.md if you want to be subscribed.

  3. added
    os-ios
    and removed
    untriaged
    on Mar 23, 2026
  4. added this to the 11.0.0 milestone on Mar 23, 2026
  5. dotnet-policy-service commented on Mar 23, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to 'os-ios': @vitek-karas, @kotlarmilos, @steveisok, @akoeplinger
    See info in area-owners.md if you want to be subscribed.

  6. dotnet-policy-service commented on Mar 23, 2026

    @dotnet-policy-service
    Contributor

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

  7. jkotas commented on Mar 23, 2026

    @jkotas
    Member

    DebuggerHeapExecutableMemoryAllocator needs it for FuncEval thunks

    What are these thunks? Can we get rid of them to pave the way for wasm?

  8. changed the title [-][clr-ios] PAL does not enable MAP_JIT for iOS targets, and AddNewPage crashes when VirtualAlloc fails[/-] [+][clr-ios] FuncEval does not work on iOS because executable memory allocation fails.[/+] on Mar 24, 2026
  9. changed the title [-][clr-ios] FuncEval does not work on iOS because executable memory allocation fails.[/-] [+][clr-ios] FuncEval does not work on iOS because executable memory allocation fails[/+] on Mar 24, 2026
  10. locked and limited conversation to collaborators on May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

  • Status
    No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions