-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Mono: handle structs larger than 256 bytes correctly #58190
Comments
Tagging subscribers to this area: @directhex Issue DetailsWe hardcode the size of structs to 256 bytes here: runtime/src/mono/mono/mini/mini-runtime.c Line 3400 in 3f61d42
and here: runtime/src/mono/mono/mini/mini-runtime.c Line 3160 in 3f61d42
This causes an out of bounds check to abort the app when running the System.Text.Json tests on iOS arm64 devices. Note: we probably should also port #52501 to
|
Instead we should just malloc a buffer. PR shortly. |
…#58215) * [mini] Dynamically allocate a buffer for large runtime invoke results 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 Also take the ref-return logic from #52501 and add it to the non-LLVM runtime-invoke This makes the `System.Runtime` testsuite (particularly `InvokeRefReturnNetcoreTests`) pass on M1 MacCatalyst FullAOT. Related to #58190 * Throw nullbyrefreturn exception for non-LLVM dyn invoke Fixes various tests in InvokeRefReturnNetcoreTests
@lambdageek - we can close this right ? Fixed in main and backport also merged |
Yes, that's right. |
Fixes dotnet#58957 Related to dotnet#58215 which was attempting to fix dotnet#58190
) * [mini] Use alloca for runtime_invoke retval buffer Fixes #58957 Related to #58215 which was attempting to fix #58190 * Set initial return buffer size to TARGET_SIZEOF_VOID_P In the common case we use the return buffer just to hold a pointer to the return value Co-authored-by: Aleksey Kliger <alklig@microsoft.com> Co-authored-by: Aleksey Kliger <aleksey@lambdageek.org>
We hardcode the size of structs to 256 bytes here:
runtime/src/mono/mono/mini/mini-runtime.c
Line 3400 in 3f61d42
and here:
runtime/src/mono/mono/mini/mini-runtime.c
Line 3160 in 3f61d42
This causes an out of bounds check to abort the app when running the System.Text.Json tests on iOS arm64 devices because of this large struct: https://github.com/dotnet/runtime/blob/7b19ccefccb4d116a64bf09c9bb1db3dd1df35e8/src/libraries/System.Text.Json/tests/Common/TestClasses/TestClasses.SimpleTestStruct.cs
Note: we probably should also port #52501 to
mono_jit_runtime_invoke
.The text was updated successfully, but these errors were encountered: