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

Make DacValidateMD and DacValidateMethodTable more resilient #90794

Merged

Conversation

janvorli
Copy link
Member

Make both methods more resilient to the case of invalid MethodDesc and MethodTable with value -1.

This fixes a problem with benchmark.NET dissassembler crashing due to MethodDesc and MethodTable passed to these two validation methods being -1 (0xffffffffffff).

Close #90691

Make both methods more resilient to the case of invalid MethodDesc
and MethodTable with value -1.

Close dotnet#90691
@janvorli janvorli added this to the 8.0.0 milestone Aug 18, 2023
@janvorli janvorli self-assigned this Aug 18, 2023
@ghost
Copy link

ghost commented Aug 18, 2023

Tagging subscribers to this area: @tommcdon
See info in area-owners.md if you want to be subscribed.

Issue Details

Make both methods more resilient to the case of invalid MethodDesc and MethodTable with value -1.

This fixes a problem with benchmark.NET dissassembler crashing due to MethodDesc and MethodTable passed to these two validation methods being -1 (0xffffffffffff).

Close #90691

Author: janvorli
Assignees: janvorli
Labels:

area-Diagnostics-coreclr

Milestone: 8.0.0

@janvorli
Copy link
Member Author

cc: @EgorBo, @adamsitnik, @stephentoub

@stephentoub
Copy link
Member

Thanks.

Make both methods more resilient to the case of invalid MethodDesc and MethodTable with value -1.

Do we know what causes these situations in the first place?

@stephentoub
Copy link
Member

Close #90691

Can we get this into 8.0 as well?

@janvorli
Copy link
Member Author

Do we know what causes these situations in the first place?

Yes, the disassembler tries to translate various constants into MethodDesc or MethodTable "just in case" they were one of those so that it can output them as the related method / class name instead of just a hex value.

@janvorli
Copy link
Member Author

Can we get this into 8.0 as well?

I plan to create a porting PR once this one is approved.

@janvorli
Copy link
Member Author

/backport to release/8.0-rc1

@github-actions
Copy link
Contributor

Started backporting to release/8.0-rc1: https://github.com/dotnet/runtime/actions/runs/5903805694

@jkotas
Copy link
Member

jkotas commented Aug 18, 2023

This fixes a problem with benchmark.NET dissassembler crashing due to MethodDesc and MethodTable passed to these two validation methods being -1 (0xffffffffffff).

Are we still going to crash when somebody has -2, -3, -4, ... in their code and disassembler tries to get MethodDesc for it?

This does not look like the right approach to fix this bug.

@janvorli
Copy link
Member Author

Are we still going to crash when somebody has -2, -3, -4, ... in their code and disassembler tries to get MethodDesc for it?

This does not look like the right approach to fix this bug.

The -1 is special in the DAC code. There are two values that DAC doesn't try to translate between the debuggee and debugger address spaces. These are 0 and -1. All the other would go through a translation and get dismissed there.

@jkotas
Copy link
Member

jkotas commented Aug 18, 2023

Ah ok.

@janvorli
Copy link
Member Author

The CI failure is #76831

@janvorli janvorli merged commit 096b249 into dotnet:main Aug 22, 2023
106 of 108 checks passed
@EgorBo
Copy link
Member

EgorBo commented Aug 22, 2023

Is backporting to 8.0-RC1 branch enough or it needs a backport to general release-8.0 branch to make it to RC2 and then GA?

@tommcdon
Copy link
Member

Is backporting to 8.0-RC1 branch enough or it needs a backport to general release-8.0 branch to make it to RC2 and then GA?

Hi @EgorBo! No action is necessary as the fix was automatically merged into release/8.0.

@ghost ghost locked as resolved and limited conversation to collaborators Sep 21, 2023
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.

BDN randomly crashes on Linux?
6 participants