Closed aleksandr-urakov closed 3 years ago
that was probably fixed by https://github.com/dotnet/runtime/pull/49256
@aleksandr-urakov Thanks for such a detailed and reduced repro case.
Yes, this is the same bug as the one fixed by #49256 . It will be fixed in the 5.0 servicing branch with https://github.com/dotnet/runtime/pull/49256.
Ok, thanks a lot!
Description
Running the following code snippet in release mode on macOS x64 using the master branch of .NET Core:
The output is following:
The expected output is:
Configuration
I run it on a self-built .NET core from the most actual master branch using macOS 11.1 x64. AFAIK, it isn't reproducible on Windows.
Regression?
The issue is actual for .NET Core 5.0 too, but I'm not sure about earlier versions.
Other information
It looks like the bug is in rejected tail call processing logic during Tier-1 compilation (that's why the sample starts working OK, just like a debug build, using a Tier-0). When a VSD tail call (the call to
Foo
in theBar
method) is rejected, and it has a multi-register struct return value (Struct
in our case), re-evaluation offgArgInfo
(seeCompiler::fgMorphCall(...)
) leads to duplication of the stub address in the list of arguments. I also attach here the log for sample ran withCOMPlus_JitDump="Bar"
.output.log