Skip to content

P/Invoke transient IL regression fixes#127400

Merged
jkotas merged 8 commits intodotnet:mainfrom
jkoritzinsky:pinvoke-nostub-fixes
Apr 28, 2026
Merged

P/Invoke transient IL regression fixes#127400
jkotas merged 8 commits intodotnet:mainfrom
jkoritzinsky:pinvoke-nostub-fixes

Conversation

@jkoritzinsky
Copy link
Copy Markdown
Member

Fixes #127231
Fixes #127209

@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/interop-contrib
See info in area-owners.md if you want to be subscribed.

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

Fixes CoreCLR P/Invoke regressions related to transient IL by correcting x86 stack-argument sizing behavior during stub generation and adjusting PInvokeImportWorker to handle additional runtime call paths / GC modes without contract violations.

Changes:

  • Ensure x86 stack argument size computation initializes per-argument native sizes via MarshalInfo::SetupArgumentSizes().
  • Update PInvokeImportWorker to allow cooperative-mode callers for SuppressGCTransition scenarios and avoid resolving targets when already resolved.
  • Limit managed exception dispatcher / unwind handler installation to the resolution path.

Comment thread src/coreclr/vm/dllimport.cpp Outdated
Comment thread src/coreclr/vm/dllimport.cpp Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 24, 2026 20:09
Comment thread src/coreclr/vm/dllimport.cpp Outdated
Comment thread src/coreclr/vm/dllimport.cpp Outdated
Comment thread src/coreclr/vm/dllimport.cpp Outdated
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Copy link
Copy Markdown
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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Comment thread src/coreclr/vm/dllimport.cpp
Comment thread src/coreclr/vm/dllimport.cpp Outdated
Comment thread src/coreclr/vm/dllimport.cpp Outdated
…ions get thrown first) but before jitting (so we don't cache the code pointer before resolving the target for SuppressGCTransition P/Invokes.
Copilot AI review requested due to automatic review settings April 27, 2026 20:23
Copy link
Copy Markdown
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

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

Comment thread src/coreclr/vm/dllimport.cpp Outdated
@jkotas jkotas merged commit 2ac6372 into dotnet:main Apr 28, 2026
109 checks passed
@github-project-automation github-project-automation Bot moved this to Done in AppModel Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

CONTRACT VIOLATION by PInvokeImportWorker Test failure: global::GenericsTest.TestVector128C()

3 participants