Skip to content

[ProcessLauncher] Fix Child Proc Arg Validation #5504

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 2 commits into from
Jun 17, 2025

Conversation

mdh1418
Copy link
Member

@mdh1418 mdh1418 commented Jun 16, 2025

It's stated that none of the process-id, name, or diagnostic-port options should be configured when launching a child process with dotnet-trace collect ... -- <child process to launch>, yet the check only errors when all are configured.

Additionally makes the exclusive check on process-id, name, diagnosic-port, and dsrouter more readable.

Before

SUCCESS
PS C:\Users\mihw\source\repos\mdh1418\diagnostics\latest> .\artifacts\bin\dotnet-trace\Debug\net8.0\dotnet-trace.exe collect -p 1418 --show-child-io  -- dotnet package search json
The runtime has been configured to pause during startup and is awaiting a Diagnostics IPC ResumeStartup command from a Diagnostic Port.
DOTNET_DiagnosticPorts="dotnet-trace-26020-20250616_135956.socket,suspend,connect"
DOTNET_DefaultDiagnosticPortSuspend=0

FAIL
PS C:\Users\mihw\source\repos\mdh1418\diagnostics\latest> .\artifacts\bin\dotnet-trace\Debug\net8.0\dotnet-trace.exe collect -p 1418 --show-child-io -n mihw --dport whim  -- dotnet package search json
None of the --name, --process-id, or --diagnostic-port options may be specified when launching a child process.

SUCCESS
PS C:\Users\mihw\source\repos\mdh1418\diagnostics\latest> .\artifacts\bin\dotnet-trace\Debug\net8.0\dotnet-trace.exe collect -p 1418 --show-child-io -n mihw  -- dotnet package search json             
The runtime has been configured to pause during startup and is awaiting a Diagnostics IPC ResumeStartup command from a Diagnostic Port.
DOTNET_DiagnosticPorts="dotnet-trace-27244-20250616_140018.socket,suspend,connect"
DOTNET_DefaultDiagnosticPortSuspend=0

After

FAIL
PS C:\Users\mihw\source\repos\mdh1418\diagnostics\latest> .\artifacts\bin\dotnet-trace\Debug\net8.0\dotnet-trace.exe collect -p 1418 --show-child-io  -- dotnet package search json                 
None of the --name, --process-id, or --diagnostic-port options may be specified when launching a child process.

FAIL
PS C:\Users\mihw\source\repos\mdh1418\diagnostics\latest> .\artifacts\bin\dotnet-trace\Debug\net8.0\dotnet-trace.exe collect -p 1418 --show-child-io -n mihw --dport whim  -- dotnet package search json
None of the --name, --process-id, or --diagnostic-port options may be specified when launching a child process.

FAIL
PS C:\Users\mihw\source\repos\mdh1418\diagnostics\latest> .\artifacts\bin\dotnet-trace\Debug\net8.0\dotnet-trace.exe collect -p 1418 --show-child-io -n mihw  -- dotnet package search json         
None of the --name, --process-id, or --diagnostic-port options may be specified when launching a child process.

@mdh1418 mdh1418 requested a review from a team as a code owner June 16, 2025 18:39
@hoyosjs hoyosjs merged commit f391d8d into dotnet:main Jun 17, 2025
19 checks passed
@mdh1418 mdh1418 deleted the fix_arg_validation_for_child_process branch June 17, 2025 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants