Skip to content

FirstChanceExceptionEventArgs passed into FirstChanceException handler can be null #123590

Closed

Description

@jkotas

(customer reported over email)

If runtime fails to allocate the instance of the FirstChanceExceptionEventArgs. it passes null to the first chance exception handler:

// Get the arguments to be passed to the delegate callback. Incase of any
// problem while allocating the event args, we will return a NULL.
ExceptionNotifications::GetEventArgsForNotification(notificationType, &gc.oEventArgs,
&gc.oCurrentThrowable);
. The typical implementation of first chance exception handler does not expect FirstChanceExceptionEventArgs to be null so this situation will lead to infinite recursion and eventual stack overflow.

We should either document this and take a breaking change to change the eventhandler argument to be nullable; or change the runtime to fail fast in this situation instead. (I think fail fasting is fine since the app is very likely going to crash anyway.)

Activity

  1. jkotas commented on Jan 25, 2026

    @jkotas
    MemberAuthor
  2. dotnet-policy-service commented on Apr 15, 2026

    @dotnet-policy-service
    Contributor

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

  3. removed
    untriagedNew issue has not been triaged by the area owner
    on Jul 10, 2026
  4. added this to the 11.0.0 milestone on Jul 10, 2026
  5. modified the milestones: 11.0.0, 12.0.0 on Aug 24, 2026
  6. locked and limited conversation to collaborators on Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

  • Status
    No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions