-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[wasm] Improved error handling in debug proxy #65828
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Tagging subscribers to this area: @thaystg Issue Detailsnull
|
461bbbd to
67e7d08
Compare
Member
Author
|
/azp run runtime-wasm |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Author
|
/azp run runtime-wasm |
|
Azure Pipelines successfully started running 1 pipeline(s). |
.. like for getting locals. Instead, surface the original errors which have details of the actual failure, to the point before we send a response. This helps debugging a lot, so instead of `Unable to evaluate dotnet:scope:1`, we get more detailed errors.
We are checking `HasError` property on the binary reader in very few places. Other places just try to use the reader which then fails with errors in reading, or base64 conversion etc, and we don't get any info about what command failed. Instead, throw an exception on error by default. But the existing locations that do check `HasError`, don't throw for them.
Issue: dotnet#65744 The test doesn't fail because it is expecting an error, and it gets that. But the log shows an assertion: `console.error: * Assertion at /workspaces/runtime/src/mono/mono/metadata/class-accessors.c:71, condition `<disabled>' not met` 1. This is because the debugger-agent does not check that the `klass` argument is NULL, which is fixed by adding that check. 2. But the reason why this got called with `klass==NULL`, is because `MemberReferenceResolver.Resolve` tries first to find the non-existant method on the type itself. Then it tries to find the method on `System.Linq.Enumerable`, but fails to find a typeid for that. - but continues to send a command to get the methods on that `linqTypeId==0`.
eef6e56 to
79e0833
Compare
|
Tagging subscribers to 'arch-wasm': @lewing Issue Details
|
ilonatommy
reviewed
Feb 25, 2022
ilonatommy
reviewed
Feb 25, 2022
ilonatommy
approved these changes
Feb 28, 2022
Member
Author
|
We should try to merge this. It has some useful fixes. |
lewing
approved these changes
Mar 28, 2022
radekdoulik
pushed a commit
to radekdoulik/runtime
that referenced
this pull request
Mar 30, 2022
* [wasm] Mark result as Error if it has 'exceptionDetails' field * [wasm] Don't swallow errors from methods that enumerate properties .. like for getting locals. Instead, surface the original errors which have details of the actual failure, to the point before we send a response. This helps debugging a lot, so instead of `Unable to evaluate dotnet:scope:1`, we get more detailed errors. * [wasm] Throw an exception when a debugger agent command fails We are checking `HasError` property on the binary reader in very few places. Other places just try to use the reader which then fails with errors in reading, or base64 conversion etc, and we don't get any info about what command failed. Instead, throw an exception on error by default. But the existing locations that do check `HasError`, don't throw for them. * [wasm] Fix evaluating expression calling a non-existant method Issue: dotnet#65744 The test doesn't fail because it is expecting an error, and it gets that. But the log shows an assertion: `console.error: * Assertion at /workspaces/runtime/src/mono/mono/metadata/class-accessors.c:71, condition `<disabled>' not met` 1. This is because the debugger-agent does not check that the `klass` argument is NULL, which is fixed by adding that check. 2. But the reason why this got called with `klass==NULL`, is because `MemberReferenceResolver.Resolve` tries first to find the non-existant method on the type itself. Then it tries to find the method on `System.Linq.Enumerable`, but fails to find a typeid for that. - but continues to send a command to get the methods on that `linqTypeId==0`. * [wasm] Add some missing exception logging in the proxy * cleaup * [wasm] GetMethodIdByName: throw on invalid type ids * [wasm] Improve error handling in expression evaluation * Cleanup * Disable failing test - dotnet#65881 * Add missed files * Address @ilonatommy's feedback
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SendDebuggerAgentCommandwill now throw if the result is an error. Earlier, the returned reader was rarely checked. This should help to find issues more readily.Unable to evaluateerrors.Fixes #65744