Skip to content
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

[cdac] GetMethodDescData for jitted methods #109187

Merged
merged 295 commits into from
Nov 1, 2024

Conversation

lambdageek
Copy link
Member

@lambdageek lambdageek commented Oct 24, 2024

This is enough for !PrintException without R2R methods on the stack

There's also a ReJIT contract here which just checks whether rejit is enabled.

Most of the complexity is in validating MethodDescs

Contributes to #99302
Contributes to #108553

lambdageek and others added 30 commits August 19, 2024 10:14
PrecodeMachineDescriptor::Init() will initialize g_PrecodeMachineDescriptor
This reverts commit bc45c00.
also move method flags out of the RuntimeTypeSystem_1 contract

for the cases where the method validation needs to call back to type validation, go via the contract
Copy link
Member

@davidwrighton davidwrighton left a comment

Choose a reason for hiding this comment

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

I've read through this and it seems like you've made good progress towards our goal here. I've a few comments about formatting + a few more general comments.

  1. I see a lot of code dedicated to MethodDesc validation. Is that really necessary, and does the behavior match our existing DAC? We may run this in an environment where the full heap isn't available, and we might want code to do a best effort job of producing results. Also, are there changes to the MethodDesc validation logic here, or just refactoring to a new location? Is the validation logic documented in the data contract markdown?
  2. I don't see documentation updates in the markdown yet. I see that some existing contracts look to have their implementation modified, but I don't see the corresponding documentation updates.
  3. Would it be possible to build a bulleted list of the TODO items that are not assertions that are needed to make this contract work completely?

@lambdageek
Copy link
Member Author

I see a lot of code dedicated to MethodDesc validation.

yes

Is that really necessary, and does the behavior match our existing DAC?

I tried to make it match the existing DAC.

Is it necessary? I'm not sure. We do need some validation - I have discovered that the !U command in SOS doesn't differentiate between a MethodDesc and an IP address and expects to be able to call GetMethodDescData with an IP address as the "method desc" argument and get E_INVALIDARG to tell it "this was not a method desc, it was an IP address"

We may run this in an environment where the full heap isn't available, and we might want code to do a best effort job of producing results.

Understood

Also, are there changes to the MethodDesc validation logic here, or just refactoring to a new location?

There is additional validation here. The version checked in previously was an incomplete snapshot (basically just establishing the internal API for validation).

Is the validation logic documented in the data contract markdown?

No. Is it part of the contract? I've been thinking of it as an artifact of the reader

@davidwrighton
Copy link
Member

Is the validation logic documented in the data contract markdown?

No. Is it part of the contract? I've been thinking of it as an artifact of the reader

I don't know. It's certainly something that the implementation of the contract depends on to some extent, so all of the dependencies of it (such as the fields it accesses, etc) should probably be in the contract, but the actual validation logic is a more interesting question. I would leave it out of the contract spec for now, so I wouldn't worry about it this week, but given that SOS actually depends on this logic doing something useful for correct functioning, its implied that something is required to make our diagnostic stack work. I would file a bug that you didn't write contract docs for this and leave it at that.

@lambdageek
Copy link
Member Author

lambdageek commented Oct 31, 2024

I updated the RuntimeTypeSystem contract markdown with the new code and fixed up other contracts to match the implementations as necessary

Created issues:

the "additional pointers" logic in RuntimeTypeSystem_1 depends on the sizes
@lambdageek lambdageek merged commit 65d6ef6 into dotnet:main Nov 1, 2024
151 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants