Skip to content

Fix Windows interpreter calli native exception handling - #136163

Open
BrzVlad wants to merge 3 commits into
dotnet:mainfrom
BrzVlad:fix-clrinterp-seh
Open

BrzVlad wants to merge 3 commits into
dotnet:mainfrom
BrzVlad:fix-clrinterp-seh

Conversation

@BrzVlad

@BrzVlad BrzVlad commented Oct 20, 2026

Copy link
Copy Markdown
Member

A managed calli can enter the prestub and fail during compilation. The C++ exception is converted to managed SEH, but this call path was missing the SEH wrapper needed to reach interpreter catches.

Adding the wrapper exposed missing personality routines on the interpreter call stubs: native unwinding left stale entries in the runtime frame chain (on windows, frames are popped explicitly in the SEH unwind handler, rather than relying on a destructor). Register the existing frame-chain cleanup handler on the Windows x64 and ARM64 call stubs.

@BrzVlad

BrzVlad commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

/azp-run runtime-interpreter

@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.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@BrzVlad

BrzVlad commented Oct 21, 2026

Copy link
Copy Markdown
Member Author

/azp run runtime-interpreter

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@BrzVlad

BrzVlad commented Oct 21, 2026

Copy link
Copy Markdown
Member Author

/azp run runtime-interpreter

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@janvorli

Copy link
Copy Markdown
Member

/azp run runtime-interpreter

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

BrzVlad and others added 3 commits October 30, 2026 11:22
A managed calli can enter the prestub and fail during compilation. The C++ exception is converted to managed SEH, but this call path
was missing the SEH wrapper needed to reach interpreter catches.

Adding the wrapper exposed missing personality routines on the interpreter call stubs: native unwinding left stale entries in the runtime frame chain (on windows, frames are popped explicitly in the SEH unwind handler, rather than relying on a destructor). Register the existing frame-chain cleanup handler on the Windows x64 and ARM64 call stubs.
Avoid using personality routines, pop frame explicitly in the prestub exception scenario

Fix bug where we were clobbering callee saved register RSI and RDI.
* PreStubWorker needs to pop all explicit frames upto and including the
  PrestubMethodFrame
* When propagating unhandled exception to the host, prevent it being
  caught and processed in the interpreter code.
@BrzVlad

BrzVlad commented Oct 30, 2026

Copy link
Copy Markdown
Member Author

/azp run runtime-interpreter

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@BrzVlad

BrzVlad commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

/azp run runtime-interpreter

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

This branch has not been deployed

No deployments
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