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

[wasm-ep] diagnostic server IPC fixups #72859

Merged
merged 4 commits into from
Jul 29, 2022

Conversation

lambdageek
Copy link
Member

@lambdageek lambdageek commented Jul 26, 2022

  1. The protocol spec says there's a length and a nul terminator, but sending that literal UTF-16 nul to ep_enable_2 means we use an incorrect name when looking for the provider.
  2. When converting the 64-bit "keywords" mask to a string, pad both 32-bit halves with zeroes.

The protocol spec says there's a length and a nul terminator, but
sending that literal UTF-16 nul to ep_enable_2 means we use an
incorrect name when looking for the provider.
@ghost
Copy link

ghost commented Jul 26, 2022

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

The protocol spec says there's a length and a nul terminator, but sending that literal UTF-16 nul to ep_enable_2 means we use an incorrect name when looking for the provider.

Author: lambdageek
Assignees: lambdageek
Labels:

arch-wasm, area-Tracing-mono

Milestone: -

convert the 64-bit "keywords" mask into a hex string properly by
padding both halves with zeroes after calling the JS Number.toString() method
@lambdageek lambdageek changed the title [wasm-ep] Trim trailing nul when parsing IPC command strings [wasm-ep] diagnostic server IPC fixups Jul 26, 2022
const provisionalString = String.fromCharCode.apply(null, result);

if (trailingNulStart >= 0)
return provisionalString.substring(0, trailingNulStart);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why substring the string instead of slicing the array?

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed it to use Array.splice instead. Thanks!

@lambdageek
Copy link
Member Author

/azp run runtime-wasm

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@@ -14,7 +14,7 @@
</PropertyGroup>

<PropertyGroup>
<MonoDiagnosticsMock Condition="'$(MonoDiagnosticsMock)' == ''">false</MonoDiagnosticsMock>
<MonoDiagnosticsMock Condition="'$(MonoDiagnosticsMock)' == '' and '$(Configuration)' == 'Debug' ">true</MonoDiagnosticsMock>
Copy link
Member

Choose a reason for hiding this comment

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

Wrap the two comparisons in parens please


/* Trim trailing nul character(s) that are added by the protocol */
let trailingNulStart = -1;
if (result.length > 0) {
Copy link
Member

Choose a reason for hiding this comment

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

i don't think this if is necessary since the loop termination condition will bail out

@lambdageek
Copy link
Member Author

/azp run runtime-wasm

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@lambdageek lambdageek merged commit c734a8e into dotnet:main Jul 29, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Aug 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-Tracing-mono
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants