Skip to content

[release/10.0] [CoreCLR] Protect exception object across funclet callbacks - #136708

Merged
akoeplinger merged 3 commits into
release/10.0from
backport/pr-132482-to-release/10.0
Nov 16, 2026
Merged

akoeplinger merged 3 commits into
release/10.0from
backport/pr-132482-to-release/10.0

Conversation

@github-actions

@github-actions github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Backport of #132482 to release/10.0

/cc @janvorli @steveisok

Customer Impact

  • Customer reported
  • Found internally

Application can crash due to a GC hole e.g. with access violation when profiler or debugger is attached to it. The exception object is not correctly protected in the CallCatchFunclet and CallFilterFunclet across a call to notify debugger or profiler on the exception.

Regression

Testing

Targeted regression test, coreclr tests

Risk

Low, the change just moves the exception object extraction to local variable after the problematic callback to debugger / profiler.

Fixes #132462

## Summary

- Protect the exception `OBJECTREF` in `CallFilterFunclet` and
`CallCatchFunclet` while profiler, debugger, and ETW callbacks may
permit GC, through the subsequent funclet invocation.
- Extend the existing exception profiler test to exercise both filter
and catch funclet paths while exception monitoring is enabled.

## Testing

- Confirmed the regression test fail-fasts against the unfixed checked
runtime.
- Built CoreCLR checked successfully with no warnings or errors.
- Ran the targeted `ExceptionTest` against the fixed checked runtime; it
returned 100 and reported `PROFILER TEST PASSES`.

> [!NOTE]
> This description was generated with GitHub Copilot.

---------

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: d1145d75-6c1d-4d53-8793-ea41900a04ca
Copilot-Session: 6a0f5fb2-4a96-4a7e-8f6a-37bb262a1401
@azure-pipelines

Copy link
Copy Markdown
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.

@github-actions github-actions Bot added the area-ExceptionHandling-coreclr only use for closed issues label Oct 30, 2026
@dominikszydlowski

Copy link
Copy Markdown

We are hitting what appears to be this exact issue in production on .NET 10 in Azure App Service. The app crashes intermittently with an access violation when Dynatrace OneAgent is attached. OneAgent registers COR_PRF_MONITOR_EXCEPTIONS when deep monitoring is enabled.

Crashes occur only with the profiler attached. Disabling other OneAgent features (CosmosDB sensor) and DATAS (Dynamic Adaptation To Application Sizes) made no difference.
Crash dumps show exception-handling objects with invalid references that were later hit during GC marking, which is consistent with the unprotected exception object described in this PR.
Runtime: .NET 10.0.9.0, Linux, x64.

Since this is a regression from the .NET 8 EH rewrite that causes heap corruption in production for profiler-monitored apps, could this backport be merged and included in the next 10.0.x servicing release? Could you also share the target version/ETA?

@ViveliDuCh

Copy link
Copy Markdown
Member

Hi,

the code complete date for 10.0.16 (the December 2026 release) is Monday 16 November. Make sure to merge this PR on that date at the latest, or it won't make it into that release.

As a reminder, if this is a product change, you also need Tactics approval before merging this PR (test-only or infra-only changes don't require Tactics approval).

Happy to help with the merge if needed!

@eiriktsarpalis
eiriktsarpalis enabled auto-merge (squash) November 16, 2026 17:09
@akoeplinger

Copy link
Copy Markdown
Member

/ba-g unrelated Mutex test failures

@akoeplinger
akoeplinger merged commit 397cdaa into release/10.0 Nov 16, 2026
105 of 107 checks passed
@akoeplinger
akoeplinger deleted the backport/pr-132482-to-release/10.0 branch November 16, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-ExceptionHandling-coreclr only use for closed issues Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants