-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
JIT ARM64: Funclets with "frame type 5" not handled correctly #66089
Comments
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsDescriptionFunclets with large frame sizes in functions using stackalloc use an unusual kind of frame. The JIT does not generate correct prolog code for these funclets. Reproduction Stepsusing System;
using System.Runtime.CompilerServices;
public class Program
{
public static unsafe void Main()
{
int* foo = stackalloc int[30];
try
{
Console.WriteLine("try");
throw new Exception();
}
catch (Exception)
{
Console.WriteLine("catch");
foo[0] = 10;
ManyArgs(new Guid(foo[0], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
}
Console.WriteLine("after");
}
[MethodImpl(MethodImplOptions.NoInlining)]
private static void ManyArgs(
Guid g0 = default,
Guid g1 = default,
Guid g2 = default,
Guid g3 = default,
Guid g4 = default,
Guid g5 = default,
Guid g6 = default,
Guid g7 = default,
Guid g8 = default,
Guid g9 = default,
Guid g10 = default,
Guid g11 = default,
Guid g12 = default,
Guid g13 = default,
Guid g14 = default,
Guid g15 = default,
Guid g16 = default,
Guid g17 = default,
Guid g18 = default,
Guid g19 = default,
Guid g20 = default,
Guid g21 = default,
Guid g22 = default,
Guid g23 = default,
Guid g24 = default,
Guid g25 = default,
Guid g26 = default,
Guid g27 = default,
Guid g28 = default,
Guid g29 = default,
Guid g30 = default,
Guid g31 = default,
Guid g32 = default,
Guid g33 = default,
Guid g34 = default,
Guid g35 = default,
Guid g36 = default,
Guid g37 = default,
Guid g38 = default,
Guid g39 = default,
Guid g40 = default,
Guid g41 = default)
{
}
}
` `
### Expected behavior
Prints "try", "catch" and "after".
### Actual behavior
"after" is not printed.
### Regression?
_No response_
### Known Workarounds
_No response_
### Configuration
_No response_
### Other information
The JIT generates the following prolog for the funclet:
```asm
G_M27646_IG06: ;; offset=00C0H
F90007F3 str x19, [sp,#8]
A9017BFD stp fp, lr, [sp,#16]
D10983FF sub sp, sp, #608
910043A3 add x3, fp, #16
F90133E3 str x3, [sp,#608] This overrides caller stack with cc @dotnet/jit-contrib
|
Also worth noting that very large funclet frames won't do stack probing. OSR hits this in GitHub_21999 because it has to pad the funclet frame with the Tier0 frame size. |
Assigining Arm64 issues to @kunalspathak. Please redistrubte to members. |
@kunalspathak Can I take this? |
Sure |
Description
Funclets with large frame sizes in functions using stackalloc use an unusual kind of frame. The JIT does not generate correct prolog code for these funclets.
Reproduction Steps
Expected behavior
Prints "try", "catch" and "after".
Actual behavior
"after" is not printed.
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
The JIT generates the following prolog for the funclet:
This overrides caller stack with callee saves.
cc @dotnet/jit-contrib
The text was updated successfully, but these errors were encountered: