-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Add GetProcessEnvironment command to diagnostics server #40556
Add GetProcessEnvironment command to diagnostics server #40556
Conversation
Tagging subscribers to this area: @tommcdon |
GH issue tracking this PR: #40572 |
Win64 libraries test failure is #40625 |
Two comments:
|
Ah, @davmason, the
The event block is being sent as a length-prefixed array of strings which themselves are sent as length-prefixed arrays of wchars. It's not using characters as delimiters. |
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.
LGTM mostly.
* allow for additions to this command without having to version it later
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.
LGTM : )
} | ||
CONTRACTL_END; | ||
|
||
// Array<Array<WCHAR>> |
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.
In the overflow case this still writes lots of data even though GetEnvironmentBlockSize() specified only 4 bytes would be written. Separately I would assume in the overflow case we'd want to return an error in the header and write 0 bytes.
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.
The logic should leave _nEnvEntries
set to 0
, so the payload would end up saying the continuation has 4 bytes and those 4 bytes should be the number 0 since there won't be any entries in the array. I could modify it so that the continuation length in the message payload is 0 instead and let the user treat that as an error. Would that be preferable?
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
<CLRTestPriority>0</CLRTestPriority> | ||
<UnloadabilityIncompatible>true</UnloadabilityIncompatible> | ||
<JitOptimizationSensitive>true</JitOptimizationSensitive> |
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.
We don't really care how the JIT optimizes this right?
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.
I don't think so. This was held over from doing a copy/paste of the proj file for another event pipe test. I'll remove.
ResumeRuntime = 0x01, | ||
GetProcessInfo = 0x00, | ||
ResumeRuntime = 0x01, | ||
GetProcessEnvironment = 0x02 |
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.
Is there a companion PR to the diagnostics repo with the spec update?
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.
There will be. It hasn't been created yet.
Remaining failure is #34472. If there isn't any opposition, I'll merge this this afternoon. |
These changes send the Environment block via the GetProcessEnvironment command in the Diagnostics IPC Protocol.
The environment block is retrieved in the standard null delimited list of strings form, and is sent as an
Array<Array<WCHAR>>
in the IPC protocol. In other words, it is retrieved asand sent as (the
|
are logical separators and not part of the data)Note that the tests do not print the bytes of the payload since they include the environment where the tests are run.
closes #40572
CC @dotnet/dotnet-diag @jander-msft