Repository navigation
[CoreCLR] Complete in-process crash reporter support for community platforms #131535
Description
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-riscv64linux-loongarch64linux-ppc64lelinux-s390x
Proposed work
- Add the correct architecture name.
- Extract IP, SP, and BP from the Linux
ucontext_tlayout. - 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_CRASHREPORTplatform 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.runtimecross-build after adding its context layout. - OpenBSD x64 completed a full
clr.runtimecross-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.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dotnet-policy-service commentedon Jul 29, 2026
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.
jkotas commentedon Jul 29, 2026
cc @am11 @dotnet/samsung @dotnet/loongarch64-contrib
am11 commentedon Jul 30, 2026
main...am11:runtime:feature/inproc-crashreporter does the job.
@jkotas, while at it, I think we could dedup them in coreclr partition with copilot:
src/coreclr/pal/src/include/pal/context.h,src/coreclr/nativeaot/Runtime/unix/NativeContext.cppandsrc/coreclr/debug/crashreport/inproccrashreporter.cppand place the shared header insrc/coreclr/runtimedir.jkotas commentedon Jul 30, 2026
@am11 Could you please submit a PR?
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.
Port in-process crash reporters to all Unix OSes (#131604)
Fixes dotnet#131535 for linux-s390x, dotnet#131604 introduced a crash
[s390x] add in-process crash reporter for s390x (#131796)