Skip to content

[CoreCLR] Complete in-process crash reporter support for community platforms #131535

Description

@mdh1418

Summary

#131410 enabled CoreCLR's in-process crash reporter on Android, Apple, and Linux targets. Other native Unix ports remain excluded because the reporter currently assumes Linux or Darwin signal-context headers and layouts.

Community Linux architectures

The reporter currently recognizes and extracts signal context for x64, x86, ARM64, and ARM.

The remaining community Linux architectures include:

  • linux-riscv64
  • linux-loongarch64
  • linux-ppc64le
  • linux-s390x

Proposed work

  • Add the correct architecture name.
  • Extract IP, SP, and BP from the Linux ucontext_t layout.
  • Validate register mappings against the platform ABI and existing PAL context handling.
  • Build using the repository's cross-build infrastructure.
  • Where a runnable CoreCLR port exists, trigger a fatal crash and validate the console and JSON reports end to end.

Community Unix operating systems

The reporter is not currently compiled or enabled for community Unix targets such as:

  • FreeBSD
  • OpenBSD
  • Haiku
  • NetBSD
  • illumos

src/coreclr/debug/crashreport/inproccrashreporter.cpp currently assumes Linux or Darwin signal-context headers and layouts. These operating systems expose ucontext_t and saved registers through different headers and fields.

For example, OpenBSD and Haiku require <signal.h> rather than <ucontext.h> for the relevant context definitions. FreeBSD, OpenBSD, NetBSD, and Haiku also use different fields for IP, SP, and BP.

Proposed work

  • Select the appropriate signal-context header for each operating system.
  • Add OS- and architecture-specific IP, SP, and BP extraction.
  • Extend the FEATURE_INPROC_CRASHREPORT platform gate after the reporter compiles successfully.
  • Cross-build CoreCLR using the repository's community-platform infrastructure.
  • Where possible, trigger a fatal crash and validate the console and JSON reports end to end.

Exploratory validation

An experimental port established the following:

  • FreeBSD x64 completed a full clr.runtime cross-build after adding its context layout.
  • OpenBSD x64 completed a full clr.runtime cross-build after selecting <signal.h> and adding its context layout.
  • The Haiku reporter target compiled after selecting <signal.h> and adding its context layout. The broader runtime build encountered unrelated existing corehost failures.
  • NetBSD and illumos were not validated because suitable current cross-build environments were unavailable.

These experimental changes were not included in #131410.

Out of scope

  • Windows, which requires a different native crash-context implementation.
  • Browser and WASI, which do not provide the required native fatal-signal process model.

Activity

  1. added this to the Future milestone on Jul 29, 2026
  2. dotnet-policy-service commented on Jul 29, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
    See info in area-owners.md if you want to be subscribed.

  3. jkotas commented on Jul 29, 2026

    @jkotas
    Member

    cc @am11 @dotnet/samsung @dotnet/loongarch64-contrib

  4. am11 commented on Jul 30, 2026

    @am11
    Member

    main...am11:runtime:feature/inproc-crashreporter does the job.

    @jkotas, while at it, I think we could dedup them in coreclr partition with copilot:

    • cherry-pick main...am11:runtime:feature/inproc-crashreporter on main
    • deduplicate macro definitions from src/coreclr/pal/src/include/pal/context.h, src/coreclr/nativeaot/Runtime/unix/NativeContext.cpp and src/coreclr/debug/crashreport/inproccrashreporter.cpp and place the shared header in src/coreclr/runtime dir.
    • reuse shared header in those three places
  5. jkotas commented on Jul 30, 2026

    @jkotas
    Member

    @am11 Could you please submit a PR?

    we could dedup them in coreclr partition with copilot

    I agree that it would be nice to deduplicate the context handling between JIT and NAOT. I do not think we want to do that as part of this issue.

  6. added a commit that references this issue on Aug 4, 2026
    e72b7de
  7. added a commit that references this issue on Aug 5, 2026
    7ddca6e
  8. locked and limited conversation to collaborators on Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions