Skip to content

Conversation

@tommcdon
Copy link
Member

Port #117832 from main to .NET 10 Preview 7 branch

  • Serialize unhandled exception for crash dump analysis when ExceptionHandler.RaiseUnhandledExceptionEvent is called
  • Block secondary calls to SerializeCrashInfo until the data has been serialized (prevents early process exit)

…andler.RaiseUnhandledExceptionEvent is called (dotnet#117832)

* Serialize unhandled exception for crash dump analysis when ExceptionHandler.RaiseUnhandledExceptionEvent is called

* Use cheaper locking mechanism for SerializeCrashInfo

* Remove superfluous assignment

* Apply suggestions from code review

Co-authored-by: Jan Kotas <[email protected]>

* Block secondary calls to SerializeCrashInfo until the data has been serialized (prevents early process exit)

* Update src/coreclr/nativeaot/System.Private.CoreLib/src/System/RuntimeExceptionHelpers.cs

* Update src/coreclr/nativeaot/System.Private.CoreLib/src/System/RuntimeExceptionHelpers.cs

---------

Co-authored-by: Jan Kotas <[email protected]>
@tommcdon tommcdon self-assigned this Jul 22, 2025
Copilot AI review requested due to automatic review settings July 22, 2025 02:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR ports crash dump analysis improvements from main to the .NET 10 Preview 7 branch. The changes serialize unhandled exception information for crash dump analysis when ExceptionHandler.RaiseUnhandledExceptionEvent is called and implement a blocking mechanism to prevent early process exit during serialization.

Key changes:

  • Adds crash info serialization for unhandled exceptions in NativeAOT scenarios
  • Refactors crash info serialization into a reusable method with thread-safe coordination
  • Implements blocking behavior to ensure crash data serialization completes before process termination

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/libraries/System.Private.CoreLib/src/System/AppContext.cs Adds call to serialize crash info when unhandled exceptions occur in NativeAOT
src/coreclr/nativeaot/System.Private.CoreLib/src/System/RuntimeExceptionHelpers.cs Refactors crash info serialization into reusable method with thread coordination and updates FailFast to use the new approach

@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @steveisok, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

@tommcdon tommcdon added the Servicing-consider Issue for next servicing release review label Jul 23, 2025
@artl93 artl93 added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Jul 23, 2025
@jeffschwMSFT
Copy link
Member

@tommcdon please take a look at the failures in ci. once ready, I can help merge

@jeffschwMSFT jeffschwMSFT merged commit 3836b79 into dotnet:release/10.0-preview7 Jul 23, 2025
139 of 144 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants