Skip to content

Remove asserts that were firing during rejit tests #33492

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

Merged
merged 2 commits into from
Mar 13, 2020

Conversation

davmason
Copy link
Contributor

#32250 had some asserts that would fire under certain situations with our rejit tests. The rejit path no longer suspends the runtime so that assert was removed, and call counting can happen for a non default code version with rejit since the IL is updated, so that assert was updated.

@davmason davmason added this to the 5.0 milestone Mar 11, 2020
@davmason davmason requested review from noahfalk and kouvel March 11, 2020 20:30
@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't add an area label to this PR.

Checkout this page to find out which area owner to ping, or please add exactly one area label to help train me in the future.

@@ -448,7 +448,7 @@ bool CallCountingManager::IsCallCountingEnabled(NativeCodeVersion codeVersion)
CONTRACTL_END;

_ASSERTE(!codeVersion.IsNull());
_ASSERTE(codeVersion.IsDefaultVersion());
_ASSERTE(codeVersion.IsDefaultVersion() || codeVersion.GetILCodeVersionId() != 0);
Copy link
Contributor

@kouvel kouvel Mar 11, 2020

Choose a reason for hiding this comment

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

This function shouldn't be called for non-default native code versions. It effectively is a storage location just for the default code version that affects the tier for the default code version. Non-default code versions have a storage location for the tier. It looks like this caller would be the issue (there are only two callers):

_ASSERTE(
pConfig
->GetMethodDesc()
->GetLoaderAllocator()
->GetCallCountingManager()
->IsCallCountingEnabled(pConfig->GetCodeVersion()));

That assert is actually unnecessary since the assert above it checks for tier 0, which implies what is intended to be verified. Could remove that assert instead (including the call to this function) and the only other call to this function should be fine. Do you have the stack trace of the failure to confirm? If you can take care of it then great, otherwise I'm working on a fix and I can include this fix in that, let me know.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue I saw is that non-default IL versions will have a tier 0 that returns false for NativeCodeVersion::IsDefaultVersion. I haven't seen any evidence that it's called for tier 1 methods

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't have the stack trace any more, I can get it but it would have to be later today

Copy link
Contributor

Choose a reason for hiding this comment

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

Yea makes sense. It would be great if you could confirm that as the cause, I'll go ahead and remove the assert in my change anyway. Also can you point me to the test that is failing?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm removing the other assertion I mentioned above in #33512. I have confirmed that it is the cause of the failure and verified the fix. @davmason, you can go ahead and revert this part of the change. Thanks!

@davmason davmason merged commit 308f151 into dotnet:master Mar 13, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 10, 2020
@davmason davmason deleted the rejit_assert branch January 20, 2021 08:59
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.

4 participants