Enable in-proc crash reporting on MacOS + Linux - #131410
Conversation
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: 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. |
There was a problem hiding this comment.
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_CRASHREPORTfor Linux and macOS in CoreCLR CMake feature selection. - Add PAL startup selection state (
CrashReportMode) and expose it to the VM viaPAL_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)
{
d4a9ccf to
3e3b1d6
Compare
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
3e3b1d6 to
f67f487
Compare
|
cc: @rolfbjarne |
This is great! While not a direct fix for #119945, it would serve the same purpose (allowing crash reports for sandboxed apps). |
Using "desktop" in this PR title is confusing. "Desktop" is typically WinForms + WPF combo (look for |
|
/ba-g "The failure is #131517" |
@mdh1418 GCC failure was related to this PR: |
Enable the in-proc crash reporter on Linux and macOS using the existing crash-report settings.
Reporter selection
DOTNET_DbgEnableMiniDump=1continues to select createdump.DOTNET_EnableCrashReport=1adds createdump’s JSON report.DOTNET_EnableCrashReportOnly=1generates only createdump’s JSON report.DOTNET_DbgEnableMiniDumpis disabled, either crash-report setting enables the in-proc reporter.This preserves existing desktop and CI configurations while avoiding an additional reporter-selection environment variable.
Fixes: #119945