Skip to content

Conversation

@janvorli
Copy link
Member

@janvorli janvorli commented Nov 5, 2025

The test was accepting only 0xc0000005 as an exit code for NullReferenceException. But in the interpreter case, the exception is thrown using COMPlusThrow(kNullReferenceException) and gets the error code of regular managed exception, the 0xE0434352.

This change updates the test to accept that one too and adds verification that the exception message contains the System.NullReferenceException to make sure the tested app didn't exit due to some other exception.

The test was accepting only 0xc0000005 as an exit code for
NullReferenceException. But in the interpreter case, the exception is
thrown using COMPlusThrow(kNullReferenceException) and gets the error
code of regular managed exception, the 0xE0434352.

This change updates the test to accept that one too and adds
verification that the exception message contains the
System.NullReferenceException to make sure the tested app didn't exit
due to some other exception.
@janvorli janvorli added this to the 11.0.0 milestone Nov 5, 2025
@janvorli janvorli requested review from davidwrighton and kg November 5, 2025 22:00
@janvorli janvorli self-assigned this Nov 5, 2025
Copilot AI review requested due to automatic review settings November 5, 2025 22:00
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @BrzVlad, @janvorli, @kg
See info in area-owners.md if you want to be subscribed.

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 modifies the unhandled exception test to accept multiple valid exit codes for hardware exception tests on Windows. The key change allows the test to pass when the test process exits with either the hardware exception code (0xC0000005 for null reference) or the managed exception code (0xE0434352), accounting for variations in how hardware exceptions are reported.

  • Changed from single expected exit code to an array of expected exit codes
  • Updated hardware exception handling on Windows to accept both 0xC0000005 and 0xE0434352
  • Added validation for NullReferenceException message in Mono runtime hardware exception tests

Feedback and fix Mono error message check for NullReferenceException

Co-authored-by: Copilot <[email protected]>
@janvorli janvorli merged commit 302a563 into dotnet:main Nov 7, 2025
68 of 75 checks passed
@janvorli janvorli deleted the fix-unhandled-exception-test-for-interpreter branch November 7, 2025 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants