Skip to content

Enable in-proc crash reporting on desktop - #131410

Open
mdh1418 wants to merge 2 commits into
dotnet:mainfrom
mdh1418:extend_in_proc_crash_reporter_support
Open

Enable in-proc crash reporting on desktop#131410
mdh1418 wants to merge 2 commits into
dotnet:mainfrom
mdh1418:extend_in_proc_crash_reporter_support

Conversation

@mdh1418

@mdh1418 mdh1418 commented Jul 27, 2026

Copy link
Copy Markdown
Member

Enable the in-proc crash reporter on Linux and macOS using the existing crash-report settings.

Reporter selection

  • DOTNET_DbgEnableMiniDump=1 continues to select createdump.
    • DOTNET_EnableCrashReport=1 adds createdump’s JSON report.
    • DOTNET_EnableCrashReportOnly=1 generates only createdump’s JSON report.
  • When DOTNET_DbgEnableMiniDump is disabled, either crash-report setting enables the in-proc reporter.
  • Mobile platforms retain their existing in-proc behavior.

This preserves existing desktop and CI configurations while avoiding an additional reporter-selection environment variable.

Allow Linux and macOS to select automatic in-proc reporting while preserving createdump as the desktop default and mobile in-proc behavior.

Treat unrecognized mode values as automatic platform selection and keep on-demand reporter APIs independent of automatic startup selection.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 13d168eb-c2c9-410e-b5fb-be2637ac4e9a
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enables the in-proc crash reporter to be built and selected on Linux/macOS, shifting automatic reporter selection into PAL startup while keeping createdump as the default desktop path and preserving mobile in-proc behavior.

Changes:

  • Enable FEATURE_INPROC_CRASHREPORT for Linux and macOS in CoreCLR CMake feature selection.
  • Add PAL startup selection state (CrashReportMode) and expose it to the VM via PAL_InProcCrashReporterEnabled().
  • Broaden Apple-specific in-proc reporter codepaths from mobile-only to all Apple targets (TARGET_APPLE).

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/coreclr/vm/crashreportstackwalker.h Updates comments to reflect startup-policy-driven crash reporter configuration.
src/coreclr/vm/ceemain.cpp Gates automatic crash reporter startup (CrashReportConfigure) on PAL-selected in-proc mode.
src/coreclr/pal/src/thread/process.cpp Adds startup selection state for in-proc vs createdump and changes fatal-signal dispatch behavior.
src/coreclr/pal/src/include/pal/process.h Updates PAL header documentation for crash reporter selection/initialization timing.
src/coreclr/pal/inc/pal.h Introduces PAL_InProcCrashReporterEnabled() and updates callback registration docs.
src/coreclr/debug/crashreport/inproccrashreporter.cpp Expands Apple-specific implementations from iOS/tvOS/MacCatalyst to all Apple targets.
src/coreclr/clrfeatures.cmake Enables in-proc crash reporting feature compilation for Linux and macOS targets.
Comments suppressed due to low confidence (1)

src/coreclr/pal/src/thread/process.cpp:1868

  • When automatic in-proc reporting is selected, the fatal-signal path returns early if the callback hasn't been registered yet. This can silently suppress crash dumps/reports (e.g., if CrashReportConfigure didn't run due to missing EnableCrashReport*, or if in-proc initialization fails and never installs the callback). It should fall back to the createdump path when the callback is null, like the previous behavior did.
    if (g_inProcCrashReporterEnabled)
    {
        PINPROCCRASHREPORT_CALLBACK callback = g_inProcCrashReportCallback;
        if (callback == nullptr)
        {

Comment thread src/coreclr/pal/src/thread/process.cpp Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 27, 2026 17:34
@mdh1418
mdh1418 force-pushed the extend_in_proc_crash_reporter_support branch from d4a9ccf to 3e3b1d6 Compare July 27, 2026 17:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread docs/design/coreclr/botr/xplat-minidump-generation.md
Keep createdump selected when DOTNET_DbgEnableMiniDump is enabled, and use the in-proc reporter when only the crash-report settings are enabled. Remove the additional mode selector and document the .NET 11 behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 13d168eb-c2c9-410e-b5fb-be2637ac4e9a
@mdh1418
mdh1418 force-pushed the extend_in_proc_crash_reporter_support branch from 3e3b1d6 to f67f487 Compare July 27, 2026 17:48
@mdh1418

mdh1418 commented Jul 27, 2026

Copy link
Copy Markdown
Member Author

cc: @rolfbjarne

@rolfbjarne

Copy link
Copy Markdown
Member

cc: @rolfbjarne

This is great! While not a direct fix for #119945, it would serve the same purpose (allowing crash reports for sandboxed apps).

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

Labels

area-PAL-coreclr only for closed issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants