[Diagnostics] Enable .NET Runtime crash reporting before signal chaining#11291
[Diagnostics] Enable .NET Runtime crash reporting before signal chaining#11291Copilot wants to merge 3 commits into
Conversation
…ash reporting before signal chaining Agent-Logs-Url: https://github.com/dotnet/android/sessions/55e4fb9d-2935-4e5a-961c-386c256574cc Co-authored-by: mdh1418 <16830051+mdh1418@users.noreply.github.com>
| `False` if using `$(AndroidDexTool)=dx` and `True` if | ||
| using [`$(AndroidDexTool)`](#androiddextool)=`d8`. | ||
|
|
||
| ## AndroidEnableDiagnosticCrashReporting |
There was a problem hiding this comment.
Same question I had here, does this need to be public?
If it's something a customer won't understand/use, it could be $(_AndroidEnableDiagnosticCrashReporting) and undocumented. It would only exist as an optional escape hatch.
There was a problem hiding this comment.
Renamed to _AndroidEnableDiagnosticCrashReporting and removed the docs in fc677d6. It's now an undocumented internal escape hatch only.
|
@copilot switch the property to |
…entation Agent-Logs-Url: https://github.com/dotnet/android/sessions/aabc6bed-6957-4252-826a-3d338ef4592f Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the Android SDK MSBuild runtimeconfig wiring to enable .NET runtime crash reporting before Android’s signal chaining runs, so managed crash reporting can execute instead of the process being terminated first.
Changes:
- Introduces an internal
_AndroidEnableDiagnosticCrashReportingMSBuild property (defaulting totrue). - Emits
System.Runtime.CrashReportBeforeSignalChainingas aRuntimeHostConfigurationOption, driven by that property.
Android registers signal handlers before .NET's runtime, causing Android to kill the process before .NET crash reporting can run. The
System.Runtime.CrashReportBeforeSignalChainingproperty (dotnet/runtime#123735) allows flipping this order.Changes
Microsoft.Android.Sdk.RuntimeConfig.targets: Add internal_AndroidEnableDiagnosticCrashReportingMSBuild property (defaulttrue) and wire it toSystem.Runtime.CrashReportBeforeSignalChainingviaRuntimeHostConfigurationOptionWith this enabled, managed callstacks are logged and a crash report JSON is written to disk on crash (dotnet/runtime#123824, dotnet/runtime#126916).
The property is internal and undocumented, serving only as an escape hatch if the behavior needs to be disabled: