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

tailcalls_do / tailcalls_d fail on Windows ARM64 #31729

Closed
trylek opened this issue Feb 4, 2020 · 4 comments · Fixed by #37192
Closed

tailcalls_do / tailcalls_d fail on Windows ARM64 #31729

trylek opened this issue Feb 4, 2020 · 4 comments · Fixed by #37192
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone

Comments

@trylek
Copy link
Member

trylek commented Feb 4, 2020

Example repro:

https://dev.azure.com/dnceng/public/_build/results?buildId=494779&view=ms.vss-test-web.build-test-results-tab&runId=15897688&resultId=100793&paneView=debug

Diagnostic info:

Return code: 1
Raw output file: C:\dotnetbuild\work\98AC07F7\w\9293083E\e\JIT\Stress\Reports\JIT.Stress\ABI\tailcalls_do\tailcalls_do.output.txt
Raw output:
BEGIN EXECUTION
 "C:\dotnetbuild\work\98AC07F7\p\corerun.exe" tailcalls_do.dll --tailcalls --num-calls 1000 --no-ctrlc-summary 
Stressing tailcalls
OSVersion: Microsoft Windows NT 6.2.9200.0
OSArchitecture: Arm64
ProcessArchitecture: Arm64
Selecting win64 ABI
Mismatch in tailcall: expected -1792697222, got -241256253
Int32 ABIStress_TailCaller4(S2U, Double, Int16, Int32, Int16, S1P, S8P, S2U, S8P, S4U, S8P, Int32, S2U, Byte, S2U, S4U, Single, S2U, Byte, S8P, Int16, S1P, S4P, S4U)
Int32 ABIStress_TailCallee5178(Int64, S4P, S4U, S8P, Double, S2P, S4P, S2U, Single, Double, S8U, S8P)
Mismatch in tailcall: expected 329656105, got -1461745871
Int32 ABIStress_TailCaller9(S8U, Byte, S2U, Single, S1P, Int32, Int32, S2U, Int16, Int16, Double, Byte, S4P, S4U, S2U)
Int32 ABIStress_TailCallee8146(Int32, S1P, Int64, S8P, Int64, Int16, S4U, S4U, Single, S4P, S4P, S1P, S4P, Single)
Mismatch in tailcall: expected 1872306653, got -280200393
Int32 ABIStress_TailCaller10(Int32, S8U, S4U, Int64, S8U, S4P, Double, S2U, S4U, S4U, Double, S2U, Int64, S4U, S8U, S8P, S2P, S4U, Byte, S2P, Double, S8P)
Int32 ABIStress_TailCallee6312(Double, Double, S4P, S8U, S1P, S2P, Single, S4U, Byte, Int64, Byte, Double, S4U, S4P, Int64, S8U, S2P, S8P, Single)
Mismatch in tailcall: expected -958760121, got 1383693481
Int32 ABIStress_TailCaller31(Int16, S8P, Single, Int16, Int16, S4U, S2P, S4P, Byte, S8P, S8U, Single, S1P, Int32, Int16, S4U)
Int32 ABIStress_TailCallee9934(Int64, Int16, Double, S2U, Int64, Byte, S4P, S8P, S4U, S8U, Single, S1P, Int16, S2P, Byte)
50 callers done (45 successful tailcalls tested)
Mismatch in tailcall: expected -1032050283, got -1862624250
Int32 ABIStress_TailCaller50(S4U, S2P, S4P, S2P, Int32, S8P, S2P, Int64, S1P, Byte, S8U, S2U, S8U, S1P, Int16, S8P, Byte, Double)
Int32 ABIStress_TailCallee9994(Int64, Single, S8P, Int16, Int32, Int64, Int64, S8U, Int32, Int64, Single, Int16, S8U, S2P, Double)
Mismatch in tailcall: expected 1332452070, got 285299523
Int32 ABIStress_TailCaller52(Int64, Int32, Double, Int16, Single, S4P, Byte, S8U, S2U, S4U, S8U, S4U, S2P, S8P, S4U, Int32, Byte, Int32, Byte, S8P, Int64, S2U, Single, Int64)
Int32 ABIStress_TailCallee1312(S8P, S2P, Int16, Byte, Double, Int16, Int32, Int16, S2U, S4P, Byte, Int32, Byte, Double, Double, S8P, Byte, S1P, S4U, Single, Byte, S8U)
Mismatch in tailcall: expected -454712802, got 1026721613
Int32 ABIStress_TailCaller58(S8U, Byte, Int16, Single, S4U, Single, S4P, S2P, S8P, S8P, Byte, Int64, S1P, S2U, Single, Double, S8P, Double)
Int32 ABIStress_TailCallee9374(Int64, S8U, S4U, S4U, Int64, Single, S4U, S4P, S4P, Int64, S8U, Byte, S4U, S8U)
Mismatch in tailcall: expected 1977502728, got -1485647357
Int32 ABIStress_TailCaller63(S2P, Int16, Int64, Int32, Byte, Byte, Byte, S2U, S8U, Double, S2U, S8U, S4P, S8P, Double, Int16, S2P, S4U, S1P, S8U, Byte, S2U, S4U)
Int32 ABIStress_TailCallee2379(S4U, S8P, S2P, S4P, Single, S4U, Int16, Single, Byte, Int64, S2U, Int16, S8U)
Mismatch in tailcall: expected 1587307949, got 202074404
Int32 ABIStress_TailCaller64(Int32, S4U, S8U, S2P, S8P, S1P, S2U, Byte, S4U, Byte, S2P, S2P, S4P, S4P, S4U, Double, Int64, S4U, Double)
Int32 ABIStress_TailCallee2937(S2U, Int16, Int16, S4P, Single, S4P, S2U, S8P, S8U, S8P, Int64, Int32, S2P, S4U, S4P, Int64, Double)
Mismatch in tailcall: expected 1855809914, got -1738803405
Int32 ABIStress_TailCaller73(Double, S2P, Int16, Int16, S2P, S8U, Int16, S8P, Int16, Single, S4U, Int16, S4P, S1P, S8U, S4P, S8U, Byte, S2P, S8P, Byte, S2P, Single, Int16)
Int32 ABIStress_TailCallee1009(S2U, S4U, Int32, S2P, S1P, S4P, S8P, Int32, Double, Int16, Int64, S2P, Single, Int16)
Mismatch in tailcall: expected -1351429783, got -1492495110

The issues.targets already disables some JIT tests with the issue set to "Requires helper-based tailcalls"; not sure whether this is related. CC @janvorli who was involved in the tailcall design and parts of its implementation AFAIK.

category:correctness
theme:testing
skill-level:expert
cost:small

@trylek trylek added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Feb 4, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Feb 4, 2020
@BruceForstall
Copy link
Member

@jashook @erozenfeld @jakobbotsch @dotnet/jit-contrib

I think these need to be disabled for Windows/arm64.

@janvorli
Copy link
Member

janvorli commented Feb 5, 2020

CC @janvorli who was involved in the tailcall design and parts of its implementation AFAIK.

The new tailcall implementation based on my original design doc is still not in, see #341.

@jakobbotsch
Copy link
Member

The tailcall stress tests do not rely on helper-based tailcalls working. This is probably an actual bug in the implementation of fast tailcalls in Windows arm64 or a bug in the implementation of the ABI on that platform.

To get a better test case on windows arm64 I would rerun the test with smaller and smaller --max-params (args) until I found the smallest example of mismatching behavior, then proceed from there.

@BruceForstall BruceForstall added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI untriaged New issue has not been triaged by the area owner and removed area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI untriaged New issue has not been triaged by the area owner labels May 5, 2020
@AndyAyersMS
Copy link
Member

Let's look at this for .NET 5.

@AndyAyersMS AndyAyersMS removed the untriaged New issue has not been triaged by the area owner label May 6, 2020
@AndyAyersMS AndyAyersMS added this to the 5.0 milestone May 6, 2020
@erozenfeld erozenfeld self-assigned this May 11, 2020
erozenfeld added a commit to erozenfeld/runtime that referenced this issue May 30, 2020
LowerFastTailCall has code that looks for incoming stack arguments
that may be overwritten by outgoing stack arguments and copies
them to a temp. The logic was incorrect for Windows Arm64 because it was
assuming shadow space, which only exists in Windows x64 abi.

Fixes dotnet#31729.
Fixes dotnet#36911.
jkotas pushed a commit that referenced this issue May 30, 2020
LowerFastTailCall has code that looks for incoming stack arguments
that may be overwritten by outgoing stack arguments and copies
them to a temp. The logic was incorrect for Windows Arm64 because it was
assuming shadow space, which only exists in Windows x64 abi.

Fixes #31729.
Fixes #36911.
@ghost ghost locked as resolved and limited conversation to collaborators Dec 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants