Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Comments

Fix slow tailcalls to VSD#27363

Merged
jashook merged 5 commits intodotnet:masterfrom
jakobbotsch:slow-tailcall-vsd
Oct 31, 2019
Merged

Fix slow tailcalls to VSD#27363
jashook merged 5 commits intodotnet:masterfrom
jakobbotsch:slow-tailcall-vsd

Conversation

@jakobbotsch
Copy link
Member

@jakobbotsch jakobbotsch commented Oct 22, 2019

This was broken in #20643 where fgCanFastTailCall was changed to call
fgInitArgInfo. fgInitArgInfo has side effects and will in some cases add
arguments to the arg list. Specifically for calls to VSD, the VSD arg is
added, however this case is treated specially for slow tailcalls and it
does not expect the arg to be here.

This targeted fix just removes this arg from the arg list.

In the future a better solution would be to refactor things so that fgInitArgInfo does not have side effects (rather than constructing the arg info).

cc @jashook @BruceForstall @jkotas @nguerrera

Fixes #26311
Fixes #27275

This was broken when fgCanFastTailCall was changed to call
fgInitArgInfo. fgInitArgInfo has side effects and will in some cases add
arguments to the arg list. Specifically for calls to VSD, the VSD arg is
added, however this case is treated specially for slow tailcalls and it
does not expect the arg to be here.

This targeted fix just removes this arg from the arg list.
@jakobbotsch
Copy link
Member Author

@jkotas @nguerrera Is it possible for one of you to check if this PR fixes #27275?

@jakobbotsch
Copy link
Member Author

I think this likely fixes #25960, #25961, #26181 #26671, #26673 and #26829 also, although I have not checked. There may also be others (one possible symptom is a crash with VSD_ResolveWorker in the call stack).

@jkotas jkotas requested a review from jashook October 22, 2019 15:12
@jashook jashook requested a review from a team October 22, 2019 16:03
Copy link

@jashook jashook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm with some nits

@jashook
Copy link

jashook commented Oct 22, 2019

/azp run coreclr-outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jashook
Copy link

jashook commented Oct 22, 2019

@jakobbotsch please wait for the outerloop testing to finish before pushing a change.

Also thank you for the fix!

@jashook
Copy link

jashook commented Oct 22, 2019

/azp list

@azure-pipelines
Copy link

@jashook
Copy link

jashook commented Oct 22, 2019

@jakobbotsch
Copy link
Member Author

It seems jitstress is failing in the new test with stack overflow in some cases. Probably there is some interaction in jitstress where we end up not being able to do a tailcall. I will investigate it tomorrow.
Other than that the jitstress failures seem to be failures that have been observed before.

Not sure what happened in the outerloop run that failed to build. The logs do not load.

@jakobbotsch
Copy link
Member Author

The problem seems to be STRESS_UNSAFE_BUFFER_CHECKS which makes one of the methods require a stack cookie check and we do not support tailcalls from such methods. I will disable the test in this mode for now, although I might submit a separate PR that turns this stress mode off for methods with explicit tailcalls in the future.

@jashook
Copy link

jashook commented Oct 23, 2019

@jakobbotsch
Copy link
Member Author

The jitstress failures now appear to be previous issues so this should be good to go.
@nguerrera could you check if this fixes #27275?

@dotnet/jit-contrib should I mark this PR as fixing the issues from #27363 (comment)? I have not checked, but I don't think spending time on checking each individual bug is useful. I guess @VincentBu would not mind reopening those issues if they fail again.

@nguerrera
Copy link

@nguerrera could you check if this fixes #27275?

Confirmed.

I pulled down this branch, built it, and replaced the shared framework bits in my repro sdk with the build. Problem fixed, thanks!

@jakobbotsch
Copy link
Member Author

Confirmed.

Thank you for confirming, I have marked this as fixing that issue.

@jashook
Copy link

jashook commented Oct 28, 2019

@dotnet/jit-contrib ptal

@jashook
Copy link

jashook commented Oct 29, 2019

/azp run coreclr-ci

@jashook
Copy link

jashook commented Oct 29, 2019

/azp run coreclr-outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jashook
Copy link

jashook commented Oct 29, 2019

@dotnet/jit-contrib I plan to merge this afternoon after the testing re-runs. Feel free take a look before then

@jashook
Copy link

jashook commented Oct 31, 2019

Testing passed.

@jashook jashook merged commit f4a8863 into dotnet:master Oct 31, 2019
@jakobbotsch jakobbotsch deleted the slow-tailcall-vsd branch October 31, 2019 07:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AV in F# compiler when run on .NET 5 runtime Test Failure: System.Collections.Immutable.Tests terminated

5 participants