Skip to content

Conversation

@kg
Copy link
Member

@kg kg commented Sep 19, 2025

Fixes Interop\GCBridge\BridgeTest, sort of (it also has an intermittent gc hole I think is fixed by #119867)

Copilot AI review requested due to automatic review settings September 19, 2025 19:50
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 fixes the InterpreterStub to handle being called on threads that don't have a managed Thread object. This is necessary for fixing the Interop\GCBridge\BridgeTest.

  • Adds null check and thread setup logic in Thread::GetInterpThreadContext()
  • Modifies InterpreterStub assembly to handle null thread pointers

Reviewed Changes

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

File Description
src/coreclr/vm/threads.cpp Adds null thread handling logic to GetInterpThreadContext() method
src/coreclr/vm/amd64/AsmHelpers.asm Adds null check for thread pointer in InterpreterStub assembly code

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

@kg
Copy link
Member Author

kg commented Sep 19, 2025

If we decide this is an OK fix I'll update the other versions of InterpreterStub.

kg added 2 commits September 19, 2025 14:40
Update helpers for other targets
@kg
Copy link
Member Author

kg commented Sep 19, 2025

Just noticed I forgot to add a contract, this new helper function should be LIMITED_METHOD_CONTRACT right?

Add contract
@kg kg merged commit 80fb00f into dotnet:main Sep 20, 2025
98 checks passed
xtqqczze pushed a commit to xtqqczze/dotnet-runtime that referenced this pull request Sep 20, 2025
…a Thread object (dotnet#119906)

Make InterpreterStub handle being called on threads without a Thread object
Fixes Interop\GCBridge\BridgeTest

---------

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
@github-actions github-actions bot locked and limited conversation to collaborators Oct 21, 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.

2 participants