-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Conversation
These tests pass address of local stack frame to tail. prefixed calls.
* Tail calls to functions with small return values * Tail calls to functions with retbuf * Tail calls to functions with multi-reg returned structs * Tail calls to functions with void returns * Tail calls to abstract methods * Tail calls to interface methods * tail. calli sequences * Tail calls to struct instance methods * Tail calls involving refs * Tail calls involving byrefs * Tail calls involving generics
* Force this test to use helper on AMD64 too * Instead of 3 tailcallers and 1 collector, just use 1 collector and 1 tailcaller. Additionally, run it for only 30 iterations of 1 second sleeps. This should allow it to run for AMD64 and ARM32 in CI too.
It looks like the new test is running into #26311 on x64 Windows. I will have to disable it on all platforms except x86 Windows. |
It was strange to me that the issue in my previous comment was not more widespread since F# users should be running into it for many interface calls in tailcall position. I found out that this failure is a regression -- my new test works fine in .NET core 3.0 preview 8. After some bisecting I have tracked it down to #20643. I will leave it up to someone else whether we should try a targeted fix for it or wait for it to be fixed with #26418 considering that it is a regression. cc @jashook |
Here is a smaller F# example that access violates with master on x64 Windows: open System
open System.Runtime.CompilerServices
type IFoo =
abstract member TailCallee : int -> Guid -> int
[<MethodImpl(MethodImplOptions.NoInlining)>]
let TailCaller (foo : IFoo) =
foo.TailCallee 0 (new Guid())
type Bar() =
interface IFoo with
member this.TailCallee _ _ = 0
[<EntryPoint>]
let main argv = TailCaller (new Bar())
|
@jakobbotsch this regression happens because we used to fast tail call, but we make the decision to not after #20643? |
@jashook Both are slow tail calls. If I had to take a wild guess it would be related to the resetting of the arg info here: Lines 8309 to 8316 in f8f0c55
But I have not at all tried to diagnose it, so it is a wild guess. |
This should be good to go @jkotas. |
Remove commented tests and tests that do not run from this file
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm minus two nits
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using InlineIL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind also adding a small readme into this folder explaining that this file is not used by testing, it is here to help regenerate the IL test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment to the top of the file
Also, feel free to merge after the changes. This has passed CI. No reason to run them again. |
I don't have access to. 😄 |
Add tests that test
Remove some illegal tests that pass the address of variables on the local stack frame to a
tail.
call.I have also made some changes to the tailcall return address hijacking test:
ForceHelper
is passed by value. I have added another arg to one of the tailcall helper functions that fixes this.My new tests should fail on platforms without helper-based tailcalls and the hijacking one might also fail on ARM32/x64 Linux now. I will disable them once I see the CI results.