-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[mono][debugger] fix exception while decoding value that has a byref field #75774
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
Conversation
|
Tagging subscribers to this area: @thaystg Issue DetailsTo reproduce: Attach debugger and try to inspect While decoding a object / valuetype that has a byref field, it was dereferencing the pointer twice when it was trying to use it, and then the address was invalid. @lambdageek do I need to free the new memory that I allocated or it will be freed when the object is freed? On wasm we don't have the exception because we don't try to access the Also created a issue to support Format Specifiers in C# while debugging on wasm:
|
lewing
left a comment
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.
Minor feedback
| { | ||
| dispAttrStr = dispAttrStr.Replace(",nq", ""); | ||
| } | ||
| if (dispAttrStr.Contains(", raw")) |
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.
maybe turn all these into a regex (and or use ordinal)
Co-authored-by: Larry Ewing <[email protected]>
|
/backport to release/7.0 |
|
Started backporting to release/7.0: https://github.com/dotnet/runtime/actions/runs/3114596965 |
|
The current fix is kind of a stopgap because it leaks memory. The real issue is that debugger method invokes dont' handle ref fields in ref structs (which may appear as Thays is working on another approach where we precalculate the extra space needed for values that the ref fields can point at and then use |
To reproduce:
Attach debugger and try to inspect
parametersparameter, mono runtime will crash.While decoding a object / valuetype that has a byref field, it was dereferencing the pointer twice when it was trying to use it, and then the address was invalid.
@lambdageek do I need to free the new memory that I allocated or it will be freed when the object is freed?
On wasm we don't have the exception because we don't try to access the
synchronisationfield that was the one that become invalid.But while trying to create a test for wasm I found another issue related and it's fixed here.
Also created a issue to support Format Specifiers in C# while debugging on wasm:
#75773