dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.42k stars 4.76k forks source link

Test failure: JIT/Directed/tailcall/mutual_recursion/mutual_recursion.cmd #106601

Closed v-wenyuxu closed 2 months ago

v-wenyuxu commented 3 months ago

Failed in: runtime-coreclr ilasm 20240817.1

Failed tests:

coreclr linux arm Checked ilasmroundtrip @ (Debian.12.Arm32.Open)Ubuntu.2004.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-helix-arm32v7
    - JIT/Directed/tailcall/mutual_recursion/mutual_recursion.cmd
coreclr osx x64 Checked ilasmroundtrip @ OSX.1200.Amd64.Open
    - JIT/Directed/tailcall/mutual_recursion/mutual_recursion.cmd
coreclr linux arm64 Checked ilasmroundtrip @ (Ubuntu.2004.Arm64.Open)Ubuntu.2004.Armarch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-20.04-helix-arm64v8
    - JIT/Directed/tailcall/mutual_recursion/mutual_recursion.cmd
coreclr osx arm64 Checked ilasmroundtrip @ OSX.1200.ARM64.Open
    - JIT/Directed/tailcall/mutual_recursion/mutual_recursion.cmd
coreclr windows x86 Checked ilasmroundtrip @ Windows.10.Amd64.Open
    - JIT/Directed/tailcall/mutual_recursion/mutual_recursion.cmd
coreclr windows x64 Checked ilasmroundtrip @ Windows.10.Amd64.Open
    - JIT/Directed/tailcall/mutual_recursion/mutual_recursion.cmd
coreclr linux x64 Checked ilasmroundtrip @ Ubuntu.2204.Amd64.Open
    - JIT/Directed/tailcall/mutual_recursion/mutual_recursion.cmd
coreclr windows arm64 Checked ilasmroundtrip @ Windows.11.Arm64.Open
    - JIT/Directed/tailcall/mutual_recursion/mutual_recursion.cmd

Error message:

 IL-RT/mutual_recursion.il(2418) : warning : Duplicate param name 'self@' in method '.ctor'
IL-RT/mutual_recursion.il(2935) : warning : Duplicate param name 'self@' in method '.ctor'
IL-RT/mutual_recursion.il(3399) : warning : Duplicate param name 'self@' in method '.ctor'
IL-RT/mutual_recursion.il(3863) : warning : Duplicate param name 'self@' in method '.ctor'
IL-RT/mutual_recursion.il(4327) : warning : Duplicate param name 'self@' in method '.ctor'
Unhandled exception. System.Exception: Incorrect method passed
   at Mutual_recursion.Driver.runMethodWithTiming@511.Invoke(String methodName, Boolean worksOnlyOnNetCore5, Int32 iterationCount, FSharpFunc`2 cb)
   at Mutual_recursion.Driver.Start()
   at Mutual_recursion.main(String[] argv)
waitpid() returned successfully (wstatus 00000000) WEXITSTATUS 0 WTERMSIG 0
/root/helix/work/workitem/e/JIT/Directed/Directed_3/../tailcall/mutual_recursion/mutual_recursion.sh: line 453:  5935 Aborted                 (core dumped) $LAUNCHER $ExePath "${CLRTestExecutionArguments[@]}"

Return code:      1
Raw output file:      /root/helix/work/workitem/uploads/tailcall/mutual_recursion/output.txt
Raw output:
BEGIN EXECUTION

.NET IL Assembler.  Version 9.0.0-ci
Copyright (c) Microsoft Corporation.  All rights reserved.
Assembling 'IL-RT/mutual_recursion.il'  to EXE --> 'mutual_recursion.dll'
Source file is UNICODE

Assembled method Mutual_recursion�Point2D::CompareTo
Assembled method Mutual_recursion�Point2D::CompareTo
Assembled method Mutual_recursion�Point2D::CompareTo
Assembled method Mutual_recursion�Point2D::GetHashCode
Assembled method Mutual_recursion�Point2D::GetHashCode
Assembled method Mutual_recursion�Point2D::Equals
Assembled method Mutual_recursion�Point2D::Equals
Assembled method Mutual_recursion�Point2D::.ctor
Assembled method Mutual_recursion�Point2D::get_X
Assembled method Mutual_recursion�Point2D::get_Y
Assembled method Mutual_recursion�Point2D::Equals
Assembled method Mutual_recursion�Point2D::Equals
Assembled method Mutual_recursion�callee@30::.ctor
Assembled method Mutual_recursion�callee@30::Invoke
Assembled method Mutual_recursion�callee@30::.cctor
Assembled method Mutual_recursion�secondCallee@44::.ctor
Assembled method Mutual_recursion�secondCallee@44::Invoke
Assembled method Mutual_recursion�secondCallee@44::.cctor
Assembled method Mutual_recursion�thirdCallee@66::.ctor
Assembled method Mutual_recursion�thirdCallee@66::Invoke
Assembled method Mutual_recursion�thirdCallee@66::.cctor
Assembled method Mutual_recursion�thirdCallee@66D::.ctor
Assembled method Mutual_recursion�thirdCallee@66D::Invoke
Assembled method Mutual_recursion�fourthMethodFirstCallee@101::.ctor
Assembled method Mutual_recursion�fourthMethodFirstCallee@101::Invoke
Assembled method Mutual_recursion�fourthMethodSecondCallee@117::.ctor
Assembled method Mutual_recursion�fourthMethodSecondCallee@117::Invoke
Assembled method Mutual_recursion�fifthMethodFirstCallee@147::.ctor
Assembled method Mutual_recursion�fifthMethodFirstCallee@147::Invoke
Assembled method Mutual_recursion�fifthMethodFirstCallee@147D::.ctor
Assembled method Mutual_recursion�fifthMethodFirstCallee@147D::Invoke
Assembled method Mutual_recursion�fifthMethodSecondCallee@165::.ctor
Assembled method Mutual_recursion�fifthMethodSecondCallee@165::Invoke
Assembled method Mutual_recursion�fifthMethodSecondCallee@165D::.ctor
Assembled method Mutual_recursion�fifthMethodSecondCallee@165D::Invoke
Assembled method Mutual_recursion�sixthMethodFirstCallee@198::.ctor
Assembled method Mutual_recursion�sixthMethodFirstCallee@198::Invoke
Assembled method Mutual_recursion�sixthMethodFirstCallee@198D::.ctor
Assembled method Mutual_recursion�sixthMethodFirstCallee@198D::Invoke
Assembled method Mutual_recursion�sixthMethodSecondCallee@216::.ctor
Assembled method Mutual_recursion�sixthMethodSecondCallee@216::Invoke
Assembled method Mutual_recursion�seventhMethodFirstCallee@247::.ctor
Assembled method Mutual_recursion�seventhMethodFirstCallee@247::Invoke
Assembled 

Stack trace:

   at Xunit.Assert.True(Nullable`1 condition, String userMessage) in /_/src/Microsoft.DotNet.XUnitAssert/src/BooleanAsserts.cs:line 146
   at TestLibrary.OutOfProcessTest.RunOutOfProcessTest(String assemblyPath, String testPathPrefix)
   at Program.<<Main>$>g__TestExecutor241|0_242(StreamWriter tempLogSw, StreamWriter statsCsvSw, <>c__DisplayClass0_0& A_2)
dotnet-policy-service[bot] commented 3 months ago

Tagging subscribers to this area: @JulieLeeMSFT See info in area-owners.md if you want to be subscribed.

jkotas commented 3 months ago

This test started to have issues on arm32 without IL ilasm roundtripping as well: #106603 .

v-wenyuxu commented 3 months ago

Failed in: runtime-coreclr ilasm 20240824.1

Failed tests:

coreclr linux arm Checked ilasmroundtrip @ (Debian.12.Arm32.Open)Ubuntu.2004.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-helix-arm32v7
    - JIT/Directed/tailcall/mutual_recursion/mutual_recursion.cmd
coreclr linux arm64 Checked ilasmroundtrip @ (Ubuntu.2004.Arm64.Open)Ubuntu.2004.Armarch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-20.04-helix-arm64v8
    - JIT/Directed/tailcall/mutual_recursion/mutual_recursion.cmd
coreclr osx x64 Checked ilasmroundtrip @ OSX.1200.Amd64.Open
    - JIT/Directed/tailcall/mutual_recursion/mutual_recursion.cmd
coreclr windows x64 Checked ilasmroundtrip @ Windows.10.Amd64.Open
    - JIT/Directed/tailcall/mutual_recursion/mutual_recursion.cmd
coreclr windows x86 Checked ilasmroundtrip @ Windows.10.Amd64.Open
    - JIT/Directed/tailcall/mutual_recursion/mutual_recursion.cmd
coreclr linux x64 Checked ilasmroundtrip @ Ubuntu.2204.Amd64.Open
    - JIT/Directed/tailcall/mutual_recursion/mutual_recursion.cmd
coreclr windows arm64 Checked ilasmroundtrip @ Windows.11.Arm64.Open
    - JIT/Directed/tailcall/mutual_recursion/mutual_recursion.cmd
coreclr osx arm64 Checked ilasmroundtrip @ OSX.1200.ARM64.Open
    - JIT/Directed/tailcall/mutual_recursion/mutual_recursion.cmd

Error message:

 IL-RT/mutual_recursion.il(2418) : warning : Duplicate param name 'self@' in method '.ctor'
IL-RT/mutual_recursion.il(2935) : warning : Duplicate param name 'self@' in method '.ctor'
IL-RT/mutual_recursion.il(3399) : warning : Duplicate param name 'self@' in method '.ctor'
IL-RT/mutual_recursion.il(3863) : warning : Duplicate param name 'self@' in method '.ctor'
IL-RT/mutual_recursion.il(4327) : warning : Duplicate param name 'self@' in method '.ctor'
Unhandled exception. System.Exception: Incorrect method passed
   at Mutual_recursion.Driver.runMethodWithTiming@511.Invoke(String methodName, Boolean worksOnlyOnNetCore5, Int32 iterationCount, FSharpFunc`2 cb)
   at Mutual_recursion.Driver.Start()
   at Mutual_recursion.main(String[] argv)
waitpid() returned successfully (wstatus 00000000) WEXITSTATUS 0 WTERMSIG 0
/root/helix/work/workitem/e/JIT/Directed/Directed_3/../tailcall/mutual_recursion/mutual_recursion.sh: line 454:  5935 Aborted                 (core dumped) $LAUNCHER $ExePath "${CLRTestExecutionArguments[@]}"

Return code:      1
Raw output file:      /root/helix/work/workitem/uploads/tailcall/mutual_recursion/output.txt
Raw output:
BEGIN EXECUTION

.NET IL Assembler.  Version 10.0.0-ci
Copyright (c) Microsoft Corporation.  All rights reserved.
Assembling 'IL-RT/mutual_recursion.il'  to EXE --> 'mutual_recursion.dll'
Source file is UNICODE

Assembled method Mutual_recursion�Point2D::CompareTo
Assembled method Mutual_recursion�Point2D::CompareTo
Assembled method Mutual_recursion�Point2D::CompareTo
Assembled method Mutual_recursion�Point2D::GetHashCode
Assembled method Mutual_recursion�Point2D::GetHashCode
Assembled method Mutual_recursion�Point2D::Equals
Assembled method Mutual_recursion�Point2D::Equals
Assembled method Mutual_recursion�Point2D::.ctor
Assembled method Mutual_recursion�Point2D::get_X
Assembled method Mutual_recursion�Point2D::get_Y
Assembled method Mutual_recursion�Point2D::Equals
Assembled method Mutual_recursion�Point2D::Equals
Assembled method Mutual_recursion�callee@30::.ctor
Assembled method Mutual_recursion�callee@30::Invoke
Assembled method Mutual_recursion�callee@30::.cctor
Assembled method Mutual_recursion�secondCallee@44::.ctor
Assembled method Mutual_recursion�secondCallee@44::Invoke
Assembled method Mutual_recursion�secondCallee@44::.cctor
Assembled method Mutual_recursion�thirdCallee@66::.ctor
Assembled method Mutual_recursion�thirdCallee@66::Invoke
Assembled method Mutual_recursion�thirdCallee@66::.cctor
Assembled method Mutual_recursion�thirdCallee@66D::.ctor
Assembled method Mutual_recursion�thirdCallee@66D::Invoke
Assembled method Mutual_recursion�fourthMethodFirstCallee@101::.ctor
Assembled method Mutual_recursion�fourthMethodFirstCallee@101::Invoke
Assembled method Mutual_recursion�fourthMethodSecondCallee@117::.ctor
Assembled method Mutual_recursion�fourthMethodSecondCallee@117::Invoke
Assembled method Mutual_recursion�fifthMethodFirstCallee@147::.ctor
Assembled method Mutual_recursion�fifthMethodFirstCallee@147::Invoke
Assembled method Mutual_recursion�fifthMethodFirstCallee@147D::.ctor
Assembled method Mutual_recursion�fifthMethodFirstCallee@147D::Invoke
Assembled method Mutual_recursion�fifthMethodSecondCallee@165::.ctor
Assembled method Mutual_recursion�fifthMethodSecondCallee@165::Invoke
Assembled method Mutual_recursion�fifthMethodSecondCallee@165D::.ctor
Assembled method Mutual_recursion�fifthMethodSecondCallee@165D::Invoke
Assembled method Mutual_recursion�sixthMethodFirstCallee@198::.ctor
Assembled method Mutual_recursion�sixthMethodFirstCallee@198::Invoke
Assembled method Mutual_recursion�sixthMethodFirstCallee@198D::.ctor
Assembled method Mutual_recursion�sixthMethodFirstCallee@198D::Invoke
Assembled method Mutual_recursion�sixthMethodSecondCallee@216::.ctor
Assembled method Mutual_recursion�sixthMethodSecondCallee@216::Invoke
Assembled method Mutual_recursion�seventhMethodFirstCallee@247::.ctor
Assembled method Mutual_recursion�seventhMethodFirstCallee@247::Invoke
Assembled

Stack trace:

   at Xunit.Assert.True(Nullable`1 condition, String userMessage) in /_/src/Microsoft.DotNet.XUnitAssert/src/BooleanAsserts.cs:line 146
   at TestLibrary.OutOfProcessTest.RunOutOfProcessTest(String assemblyPath, String testPathPrefix)
   at Program.<<Main>$>g__TestExecutor241|0_242(StreamWriter tempLogSw, StreamWriter statsCsvSw, <>c__DisplayClass0_0& A_2)
jakobbotsch commented 3 months ago

This is an F# test and the IL codegen for it changed significantly with preview 7 fsc, so that explains why we suddenly saw both test failures.

v-wenyuxu commented 2 months ago

Failed in: runtime-coreclr ilasm 20240831.1

Failed tests:

coreclr linux arm Checked ilasmroundtrip @ (Debian.12.Arm32.Open)Ubuntu.2004.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-helix-arm32v7
    - JIT/Directed/tailcall/mutual_recursion/mutual_recursion.cmd

Error message:

 IL-RT/mutual_recursion.il(2418) : warning : Duplicate param name 'self@' in method '.ctor'
IL-RT/mutual_recursion.il(2935) : warning : Duplicate param name 'self@' in method '.ctor'
IL-RT/mutual_recursion.il(3399) : warning : Duplicate param name 'self@' in method '.ctor'
IL-RT/mutual_recursion.il(3863) : warning : Duplicate param name 'self@' in method '.ctor'
IL-RT/mutual_recursion.il(4327) : warning : Duplicate param name 'self@' in method '.ctor'
Unhandled exception. System.Exception: Incorrect method passed
   at Mutual_recursion.Driver.runMethodWithTiming@511.Invoke(String methodName, Boolean worksOnlyOnNetCore5, Int32 iterationCount, FSharpFunc`2 cb)
   at Mutual_recursion.Driver.Start()
   at Mutual_recursion.main(String[] argv)
waitpid() returned successfully (wstatus 00000000) WEXITSTATUS 0 WTERMSIG 0
/root/helix/work/workitem/e/JIT/Directed/Directed_3/../tailcall/mutual_recursion/mutual_recursion.sh: line 460:  5936 Aborted                 (core dumped) $LAUNCHER $ExePath "${CLRTestExecutionArguments[@]}"

Return code:      1
Raw output file:      /root/helix/work/workitem/uploads/tailcall/mutual_recursion/output.txt
Raw output:
BEGIN EXECUTION

.NET IL Assembler.  Version 10.0.0-ci
Copyright (c) Microsoft Corporation.  All rights reserved.
Assembling 'IL-RT/mutual_recursion.il'  to EXE --> 'mutual_recursion.dll'
Source file is UNICODE

Assembled method Mutual_recursion�Point2D::CompareTo
Assembled method Mutual_recursion�Point2D::CompareTo
Assembled method Mutual_recursion�Point2D::CompareTo
Assembled method Mutual_recursion�Point2D::GetHashCode
Assembled method Mutual_recursion�Point2D::GetHashCode
Assembled method Mutual_recursion�Point2D::Equals
Assembled method Mutual_recursion�Point2D::Equals
Assembled method Mutual_recursion�Point2D::.ctor
Assembled method Mutual_recursion�Point2D::get_X
Assembled method Mutual_recursion�Point2D::get_Y
Assembled method Mutual_recursion�Point2D::Equals
Assembled method Mutual_recursion�Point2D::Equals
Assembled method Mutual_recursion�callee@30::.ctor
Assembled method Mutual_recursion�callee@30::Invoke
Assembled method Mutual_recursion�callee@30::.cctor
Assembled method Mutual_recursion�secondCallee@44::.ctor
Assembled method Mutual_recursion�secondCallee@44::Invoke
Assembled method Mutual_recursion�secondCallee@44::.cctor
Assembled method Mutual_recursion�thirdCallee@66::.ctor
Assembled method Mutual_recursion�thirdCallee@66::Invoke
Assembled method Mutual_recursion�thirdCallee@66::.cctor
Assembled method Mutual_recursion�thirdCallee@66D::.ctor
Assembled method Mutual_recursion�thirdCallee@66D::Invoke
Assembled method Mutual_recursion�fourthMethodFirstCallee@101::.ctor
Assembled method Mutual_recursion�fourthMethodFirstCallee@101::Invoke
Assembled method Mutual_recursion�fourthMethodSecondCallee@117::.ctor
Assembled method Mutual_recursion�fourthMethodSecondCallee@117::Invoke
Assembled method Mutual_recursion�fifthMethodFirstCallee@147::.ctor
Assembled method Mutual_recursion�fifthMethodFirstCallee@147::Invoke
Assembled method Mutual_recursion�fifthMethodFirstCallee@147D::.ctor
Assembled method Mutual_recursion�fifthMethodFirstCallee@147D::Invoke
Assembled method Mutual_recursion�fifthMethodSecondCallee@165::.ctor
Assembled method Mutual_recursion�fifthMethodSecondCallee@165::Invoke
Assembled method Mutual_recursion�fifthMethodSecondCallee@165D::.ctor
Assembled method Mutual_recursion�fifthMethodSecondCallee@165D::Invoke
Assembled method Mutual_recursion�sixthMethodFirstCallee@198::.ctor
Assembled method Mutual_recursion�sixthMethodFirstCallee@198::Invoke
Assembled method Mutual_recursion�sixthMethodFirstCallee@198D::.ctor
Assembled method Mutual_recursion�sixthMethodFirstCallee@198D::Invoke
Assembled method Mutual_recursion�sixthMethodSecondCallee@216::.ctor
Assembled method Mutual_recursion�sixthMethodSecondCallee@216::Invoke
Assembled method Mutual_recursion�seventhMethodFirstCallee@247::.ctor
Assembled method Mutual_recursion�seventhMethodFirstCallee@247::Invoke
Assembled

Stack trace:

   at Xunit.Assert.True(Nullable`1 condition, String userMessage) in /_/src/Microsoft.DotNet.XUnitAssert/src/BooleanAsserts.cs:line 146
   at TestLibrary.OutOfProcessTest.RunOutOfProcessTest(String assemblyPath, String testPathPrefix)
   at Program.<<Main>$>g__TestExecutor241|0_242(StreamWriter tempLogSw, StreamWriter statsCsvSw, <>c__DisplayClass0_0& A_2)
v-wenyuxu commented 2 months ago

Failed in: runtime-coreclr ilasm 20240907.1

Failed tests:

coreclr linux arm Checked ilasmroundtrip @ (Debian.12.Arm32.Open)Ubuntu.2004.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-helix-arm32v7
    - JIT/Directed/tailcall/mutual_recursion/mutual_recursion.cmd
coreclr linux arm64 Checked ilasmroundtrip @ (Ubuntu.2004.Arm64.Open)Ubuntu.2004.Armarch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-20.04-helix-arm64v8
    - JIT/Directed/tailcall/mutual_recursion/mutual_recursion.cmd
coreclr osx x64 Checked ilasmroundtrip @ OSX.1200.Amd64.Open
    - JIT/Directed/tailcall/mutual_recursion/mutual_recursion.cmd
coreclr windows x86 Checked ilasmroundtrip @ Windows.10.Amd64.Open
    - JIT/Directed/tailcall/mutual_recursion/mutual_recursion.cmd
coreclr windows x64 Checked ilasmroundtrip @ Windows.10.Amd64.Open
    - JIT/Directed/tailcall/mutual_recursion/mutual_recursion.cmd
coreclr linux x64 Checked ilasmroundtrip @ Ubuntu.2204.Amd64.Open
    - JIT/Directed/tailcall/mutual_recursion/mutual_recursion.cmd
coreclr windows arm64 Checked ilasmroundtrip @ Windows.11.Arm64.Open
    - JIT/Directed/tailcall/mutual_recursion/mutual_recursion.cmd
coreclr osx arm64 Checked ilasmroundtrip @ OSX.1200.ARM64.Open
    - JIT/Directed/tailcall/mutual_recursion/mutual_recursion.cmd

Error message:

 IL-RT/mutual_recursion.il(2418) : warning : Duplicate param name 'self@' in method '.ctor'
IL-RT/mutual_recursion.il(2935) : warning : Duplicate param name 'self@' in method '.ctor'
IL-RT/mutual_recursion.il(3399) : warning : Duplicate param name 'self@' in method '.ctor'
IL-RT/mutual_recursion.il(3863) : warning : Duplicate param name 'self@' in method '.ctor'
IL-RT/mutual_recursion.il(4327) : warning : Duplicate param name 'self@' in method '.ctor'
Unhandled exception. System.Exception: Incorrect method passed
   at Mutual_recursion.Driver.runMethodWithTiming@511.Invoke(String methodName, Boolean worksOnlyOnNetCore5, Int32 iterationCount, FSharpFunc`2 cb)
   at Mutual_recursion.Driver.Start()
   at Mutual_recursion.main(String[] argv)
waitpid() returned successfully (wstatus 00000000) WEXITSTATUS 0 WTERMSIG 0
/root/helix/work/workitem/e/JIT/Directed/Directed_3/../tailcall/mutual_recursion/mutual_recursion.sh: line 461:  5933 Aborted                 (core dumped) $LAUNCHER $ExePath "${CLRTestExecutionArguments[@]}"

Return code:      1
Raw output file:      /root/helix/work/workitem/uploads/tailcall/mutual_recursion/output.txt
Raw output:
BEGIN EXECUTION

.NET IL Assembler.  Version 10.0.0-ci
Copyright (c) Microsoft Corporation.  All rights reserved.
Assembling 'IL-RT/mutual_recursion.il'  to EXE --> 'mutual_recursion.dll'
Source file is UNICODE

Assembled method Mutual_recursion�Point2D::CompareTo
Assembled method Mutual_recursion�Point2D::CompareTo
Assembled method Mutual_recursion�Point2D::CompareTo
Assembled method Mutual_recursion�Point2D::GetHashCode
Assembled method Mutual_recursion�Point2D::GetHashCode
Assembled method Mutual_recursion�Point2D::Equals
Assembled method Mutual_recursion�Point2D::Equals
Assembled method Mutual_recursion�Point2D::.ctor
Assembled method Mutual_recursion�Point2D::get_X
Assembled method Mutual_recursion�Point2D::get_Y
Assembled method Mutual_recursion�Point2D::Equals
Assembled method Mutual_recursion�Point2D::Equals
Assembled method Mutual_recursion�callee@30::.ctor
Assembled method Mutual_recursion�callee@30::Invoke
Assembled method Mutual_recursion�callee@30::.cctor
Assembled method Mutual_recursion�secondCallee@44::.ctor
Assembled method Mutual_recursion�secondCallee@44::Invoke
Assembled method Mutual_recursion�secondCallee@44::.cctor
Assembled method Mutual_recursion�thirdCallee@66::.ctor
Assembled method Mutual_recursion�thirdCallee@66::Invoke
Assembled method Mutual_recursion�thirdCallee@66::.cctor
Assembled method Mutual_recursion�thirdCallee@66D::.ctor
Assembled method Mutual_recursion�thirdCallee@66D::Invoke
Assembled method Mutual_recursion�fourthMethodFirstCallee@101::.ctor
Assembled method Mutual_recursion�fourthMethodFirstCallee@101::Invoke
Assembled method Mutual_recursion�fourthMethodSecondCallee@117::.ctor
Assembled method Mutual_recursion�fourthMethodSecondCallee@117::Invoke
Assembled method Mutual_recursion�fifthMethodFirstCallee@147::.ctor
Assembled method Mutual_recursion�fifthMethodFirstCallee@147::Invoke
Assembled method Mutual_recursion�fifthMethodFirstCallee@147D::.ctor
Assembled method Mutual_recursion�fifthMethodFirstCallee@147D::Invoke
Assembled method Mutual_recursion�fifthMethodSecondCallee@165::.ctor
Assembled method Mutual_recursion�fifthMethodSecondCallee@165::Invoke
Assembled method Mutual_recursion�fifthMethodSecondCallee@165D::.ctor
Assembled method Mutual_recursion�fifthMethodSecondCallee@165D::Invoke
Assembled method Mutual_recursion�sixthMethodFirstCallee@198::.ctor
Assembled method Mutual_recursion�sixthMethodFirstCallee@198::Invoke
Assembled method Mutual_recursion�sixthMethodFirstCallee@198D::.ctor
Assembled method Mutual_recursion�sixthMethodFirstCallee@198D::Invoke
Assembled method Mutual_recursion�sixthMethodSecondCallee@216::.ctor
Assembled method Mutual_recursion�sixthMethodSecondCallee@216::Invoke
Assembled method Mutual_recursion�seventhMethodFirstCallee@247::.ctor
Assembled method Mutual_recursion�seventhMethodFirstCallee@247::Invoke
Assembled

Stack trace:

   at Xunit.Assert.True(Nullable`1 condition, String userMessage) in /_/src/Microsoft.DotNet.XUnitAssert/src/BooleanAsserts.cs:line 146
   at TestLibrary.OutOfProcessTest.RunOutOfProcessTest(String assemblyPath, String testPathPrefix)
   at Program.<<Main>$>g__TestExecutor241|0_242(StreamWriter tempLogSw, StreamWriter statsCsvSw, <>c__DisplayClass0_0& A_2)
BruceForstall commented 2 months ago

F# issue: https://github.com/dotnet/fsharp/issues/17607

BruceForstall commented 2 months ago

@KevinRansom This is the mutual_recursion test issue for our ildasm/ilasm round-trip test. The test fails with an exception:

Unhandled exception. System.Exception: Incorrect method passed
   at Mutual_recursion.Driver.runMethodWithTiming@511.Invoke(String methodName, Boolean worksOnlyOnNetCore5, Int32 iterationCount, FSharpFunc`2 cb)
   at Mutual_recursion.Driver.Start()
   at Mutual_recursion.main(String[] argv)

The test emits warnings now; I don't know if those are new, or related to the failure:

IL-RT/mutual_recursion.il(2418) : warning : Duplicate param name 'self@' in method '.ctor'
IL-RT/mutual_recursion.il(2935) : warning : Duplicate param name 'self@' in method '.ctor'
IL-RT/mutual_recursion.il(3399) : warning : Duplicate param name 'self@' in method '.ctor'
IL-RT/mutual_recursion.il(3863) : warning : Duplicate param name 'self@' in method '.ctor'
IL-RT/mutual_recursion.il(4327) : warning : Duplicate param name 'self@' in method '.ctor'

These are generated by ilasm when trying to assemble the IL created by ildasm. For example, here's a signature:

.method assembly specialname rtspecialname
            instance void  .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,int32> seventhMethodSecondCallee,
                                 class Mutual_recursion/seventhMethodFirstCallee@247 self@,
                                 int32 iterationCount,
                                 int32 firstArg,
                                 int32 secondArg,
                                 int32 thirdArg,
                                 int32 fourthArg,
                                 class Mutual_recursion/seventhMethodFirstCallee@247D self@,
                                 int32 fifthArg,
                                 int32 sixthArg,
                                 int32 seventhArg,
                                 int32 eighthArg,
                                 int32 ninthArg) cil managed

To repro this:

cd c:\gh\runtime\artifacts\tests\coreclr\windows.x64.Checked\JIT\Directed\tailcall\mutual_recursion
del /f mutual_recursion.il
c:\gh\runtime\artifacts\tests\coreclr\windows.x64.Checked\Tests\Core_Root\ildasm.exe -unicode -out=mutual_recursion.il mutual_recursion.dll
c:\gh\runtime\artifacts\tests\coreclr\windows.x64.Checked\Tests\Core_Root\ilasm.exe  -output=mutual_recursion_rt.dll  mutual_recursion.il
c:\gh\runtime\artifacts\tests\coreclr\windows.x64.Checked\Tests\Core_Root\corerun.exe mutual_recursion_rt.dll

Do you expect https://github.com/dotnet/fsharp/pull/17613 (or whatever PR results from that investigation) will fix this issue?

vzarytovskii commented 2 months ago

We have reverted codegen (switched to previous one) for the release.

BruceForstall commented 2 months ago

We have reverted codegen (switched to previous one) for the release.

@vzarytovskii I'm not sure how we pick up the F# compiler that is used to build the dotnet/runtime tests (or how to plug in a new/different/fixed F# compiler). Could you verify that the reverted F# codegen fixes this test? (which requires building the F# compiler then doing ildasm/ilasm/corerun.exe)

vzarytovskii commented 2 months ago

I will try to get to in this week

KevinRansom commented 2 months ago

@BruceForstall

I believe the issue is the same as issue 17613 it is my current work item

You should be able to switch back to the old codegen by adding <RealSig>false</RealSig> to the project file.

Let me know if this works for you.

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <!-- Needed for JitOptimizationSensitive -->
    <RequiresProcessIsolation>true</RequiresProcessIsolation>

    <!-- Not even printf is AOT compatible in F# -->
    <NativeAotIncompatible>true</NativeAotIncompatible>

    <!-- Test is slow enough to time out under GC stress -->
    <GCStressIncompatible>true</GCStressIncompatible>
    <RealSig>false</RealSig>
  </PropertyGroup>
  <PropertyGroup>
    <Optimize>True</Optimize>
    <JitOptimizationSensitive>True</JitOptimizationSensitive>
    <TargetFramework>$(NetCoreAppToolCurrent)</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <Compile Include="mutual_recursion.fs" />
  </ItemGroup>
</Project>
BruceForstall commented 2 months ago

@KevinRansom Adding <RealSig>false</RealSig> to the project file fixes the ildasm/ilasm round-trip test case failure.

fyi, the ildasm generated .il file is 1,120,634 bytes beforehand, but only 369,314 with <RealSig>false</RealSig>.

BruceForstall commented 2 months ago

Fixed (worked around) by https://github.com/dotnet/runtime/pull/107692