Skip to content

Enable in-proc crash reporting on MacOS + Linux - #131410

Merged
mdh1418 merged 2 commits into
dotnet:mainfrom
mdh1418:extend_in_proc_crash_reporter_support
Jul 29, 2026
Merged

Enable in-proc crash reporting on MacOS + Linux#131410
mdh1418 merged 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.

Fixes: #119945

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).

@lateralusX lateralusX left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

Comment thread src/coreclr/clrfeatures.cmake
@jkotas

jkotas commented Jul 28, 2026

Copy link
Copy Markdown
Member

Enable in-proc crash reporting on desktop

Using "desktop" in this PR title is confusing.

"Desktop" is typically WinForms + WPF combo (look for .NET Desktop Runtime under https://dotnet.microsoft.com/en-us/download/dotnet/8.0). Or an acronym for .NET Framework (documented in the glossary https://github.com/dotnet/runtime/blob/989dae08a9b17e8c3bd2a9ce18da656a6589a923/docs/project/glossary.md#net-framework ).

@mdh1418 mdh1418 changed the title Enable in-proc crash reporting on desktop Enable in-proc crash reporting on MacOS + Linux Jul 28, 2026
@mdh1418

mdh1418 commented Jul 29, 2026

Copy link
Copy Markdown
Member Author

/ba-g "The failure is #131517"

@mdh1418
mdh1418 merged commit 00fc09e into dotnet:main Jul 29, 2026
109 of 114 checks passed
@am11

am11 commented Jul 29, 2026

Copy link
Copy Markdown
Member

/ba-g "The failure is #131517"

@mdh1418 GCC failure was related to this PR:

  FAILED: vm/wks/CMakeFiles/cee_wks_core.dir/__/excep.cpp.o 
  /usr/bin/g++-16 -DBUILDENV_CHECKED=1 -DDEBUG -DDEBUGGING_SUPPORTED -DDISABLE_CONTRACTS -DFEATURE_CACHED_INTERFACE_DISPATCH -DFEATURE_CODE_VERSIONING -DFEATURE_COLD_R2R_CODE -DFEATURE_COLLECTIBLE_TYPES -DFEATURE_COMWRAPPERS -DFEATURE_CORECLR -DFEATURE_CORECLR_FLUSH_INSTRUCTION_CACHE_TO_PROTECT_STUB_READS -DFEATURE_DBGIPC_TRANSPORT_DI -DFEATURE_DBGIPC_TRANSPORT_VM -DFEATURE_DEFAULT_INTERFACES -DFEATURE_DYNAMIC_CODE_COMPILED -DFEATURE_EVENTSOURCE_XPLAT -DFEATURE_EVENT_TRACE -DFEATURE_HIJACK -DFEATURE_INPROC_CRASHREPORT -DFEATURE_INTERPRETER -DFEATURE_JAVAMARSHAL -DFEATURE_MANUALLY_MANAGED_CARD_BUNDLES -DFEATURE_METADATA_UPDATER -DFEATURE_MULTICOREJIT -DFEATURE_MULTITHREADING -DFEATURE_PAL_ANSI -DFEATURE_PERFMAP -DFEATURE_PERFTRACING -DFEATURE_PGO -DFEATURE_PROFAPI_ATTACH_DETACH -DFEATURE_READYTORUN -DFEATURE_REJIT -DFEATURE_REMAP_FUNCTION -DFEATURE_REMOTE_PROC_MEM -DFEATURE_STANDALONE_GC -DFEATURE_SVR_GC -DFEATURE_SYMDIFF -DFEATURE_TIERED_COMPILATION -DFEATURE_USE_ASM_GC_WRITE_BARRIERS -DFEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP -DFEATURE_VIRTUAL_STUB_DISPATCH -DGC_DESCRIPTOR -DHOST_64BIT -DHOST_AMD64 -DHOST_UNIX -DPROFILING_SUPPORTED -DTARGET_64BIT -DTARGET_AMD64 -DTARGET_LINUX -DTARGET_UNIX -DUNICODE -DUNIX_AMD64_ABI -DUNIX_AMD64_ABI_ITF -DURTBLDENV_FRIENDLY=Checked -DWRITE_BARRIER_CHECK -D_DBG -D_DEBUG -D_FILE_OFFSET_BITS=64 -D_SECURE_SCL=0 -D_TIME_BITS=64 -D_UNICODE -I/__w/1/s/artifacts/obj/coreclr/linux.x64.Checked/vm/wks -I/__w/1/s/src/coreclr/vm/wks -I/__w/1/s/src/coreclr/vm -I/__w/1/s/src/native -I/__w/1/s/src/native/inc -I/__w/1/s/src/coreclr/pal/prebuilt/inc -I/__w/1/s/artifacts/obj -I/__w/1/s/src/coreclr/pal/inc -I/__w/1/s/src/coreclr/pal/inc/rt -I/__w/1/s/src/coreclr/pal/src/safecrt -I/__w/1/s/src/coreclr/inc -I/__w/1/s/src/coreclr/debug/inc -I/__w/1/s/src/coreclr/debug/inc/amd64 -I/__w/1/s/src/coreclr/debug/inc/dump -I/__w/1/s/src/coreclr/md/inc -I/__w/1/s/artifacts/obj/coreclr/linux.x64.Checked/inc -I/__w/1/s/src/coreclr/hosts/inc -I/__w/1/s/src/coreclr/interpreter/inc -I/__w/1/s/src/coreclr/minipal -I/__w/1/s/src/coreclr/nativeresources -I/__w/1/s/src/coreclr/vm/amd64 -I/__w/1/s/src/coreclr/vm/../interop/inc -I/__w/1/s/src/coreclr/debug/crashreport -I/__w/1/s/src/coreclr/runtime -I/__w/1/s/src/native/libs/System.IO.Compression.Native -I/__w/1/s/src/native/libs/Common -I/__w/1/s/src/coreclr/vm/eventing/eventpipe -std=gnu++17 -fPIC -O2 -g -Wall -fno-omit-frame-pointer -fno-strict-overflow -fno-strict-aliasing -fstack-protector-strong -Werror -Wno-unused-variable -Wno-unused-value -Wno-unused-function -Wno-tautological-compare -Wno-unknown-pragmas -Wimplicit-fallthrough -Wvla -Wno-invalid-offsetof -Wno-unused-but-set-variable -ffp-contract=off -fno-rtti -Wno-uninitialized -Wno-strict-aliasing -Wno-array-bounds -Wno-misleading-indentation -Wno-stringop-overflow -Wno-restrict -Wno-stringop-truncation -Wno-class-memaccess -faligned-new -fsigned-char -fvisibility=hidden -ffunction-sections -fdata-sections -mcx16 -Wno-conversion-null -Wno-pointer-arith -Winvalid-pch -include /__w/1/s/artifacts/obj/coreclr/linux.x64.Checked/vm/wks/CMakeFiles/cee_wks_core.dir/cmake_pch.hxx -MD -MT vm/wks/CMakeFiles/cee_wks_core.dir/__/excep.cpp.o -MF vm/wks/CMakeFiles/cee_wks_core.dir/__/excep.cpp.o.d -o vm/wks/CMakeFiles/cee_wks_core.dir/__/excep.cpp.o -c /__w/1/s/src/coreclr/vm/excep.cpp
  /__w/1/s/src/coreclr/vm/excep.cpp: In function ‘void CrashDumpAndTerminateProcess(UINT)’:
  /__w/1/s/src/coreclr/vm/excep.cpp:3490:18: error: comparison of integer expressions of different signedness: ‘UINT’ {aka ‘unsigned int’} and ‘HRESULT’ {aka ‘int’} [-Werror=sign-compare]
   3490 |     if (exitCode == COR_E_STACKOVERFLOW)
        |                  ^

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.

Support createdump functionality in the app sandbox

6 participants