Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/6.0] [mini] Dynamically allocate a buffer for large runtime invoke results #58364

Merged
merged 2 commits into from
Sep 1, 2021

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Aug 30, 2021

Backport of #58215 to release/6.0

/cc @lambdageek

Customer Impact

  1. User programs on ios devices that use System.Text.Json to serialize large structs will crash.
  2. Incorrect unsafe methods that return null from a ref-return method will crash instead of throwing a NullReferenceException.

Testing

CI and manual testing

Risk

Low. For (1) all the logic in the runtime is the same, we just dynamically allocate a big enough buffer. For (2) we already do the right thing when using LLVM AOT - this is just fixing up the non-LLVM AOT case.

If the return type is a struct that's bigger than our buffer, malloc a
buffer for it instead of using a fixed-size stack buffer
Fixes various tests in InvokeRefReturnNetcoreTests
@akoeplinger akoeplinger merged commit 9c8962e into release/6.0 Sep 1, 2021
@akoeplinger akoeplinger deleted the backport/pr-58215-to-release/6.0 branch September 1, 2021 10:16
@ghost ghost locked as resolved and limited conversation to collaborators Oct 1, 2021
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.

3 participants