Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 8, 2026

  • Add CreateSuspended property to ProcessStartOptions
  • Add Resume() method to SafeChildProcessHandle
  • Implement Windows support (CREATE_SUSPENDED flag, store thread handle, ResumeThread)
  • Implement Unix/Linux support (resume pipe, blocking read, write byte to resume)
  • Add Interop declarations for Windows ResumeThread API
  • Add tests for CreateSuspended and Resume functionality (13 tests)
  • Address review feedback: Use DirectoryInfo.FullName for path comparison
  • Resolve merge conflicts with main branch (SendSignal API)
  • All 85 tests pass (81 original + 4 from main)
Original prompt

This section details on the original issue you should resolve

<issue_title>Implement ProcessStartOptions.CreateSuspended and SafeChildProcessHandle.Resume</issue_title>
<issue_description>On Windows:

  • Use CREATE_SUSPENDED flag in CreateProcess
  • Stores thread handle for suspended processes
  • Resume() calls ResumeThread and releases thread handle

Unix/Linux (pipe-based approach):

  • Parent creates a resume pipe before forking (with CLOEXEC)
  • Child performs blocking read() from resume pipe before execve()
  • Parent returns with resume pipe write end
  • Resume() writes a single byte to the pipe to unblock the child
  • Uses regular fork() instead of vfork() when suspended to avoid parent blocking
  • Skips wait pipe synchronization when suspended to avoid deadlock</issue_description>

<agent_instructions>Add some tests</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits January 8, 2026 10:47
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
Copilot AI changed the title [WIP] Add tests for ProcessStartOptions.CreateSuspended and SafeChildProcessHandle.Resume Implement ProcessStartOptions.CreateSuspended and SafeChildProcessHandle.Resume Jan 8, 2026
Copilot AI requested a review from adamsitnik January 8, 2026 10:53
Copy link
Owner

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

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

@copilot overall it LGTM, but we need to fix one test failure PTAL at my comments

Comment on lines 269 to 273
// Normalize paths for comparison (handle case differences on Windows)
string normalizedOutput = output?.Trim().Replace('\\', '/').ToLowerInvariant() ?? "";
string normalizedExpected = tempDir.Replace('\\', '/').ToLowerInvariant();

Assert.Equal(normalizedExpected, normalizedOutput);
Copy link
Owner

Choose a reason for hiding this comment

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

I think it's better to do the following:

  • store the DirectoryInfo returned by Directory.CreateDirectory(tempDir);
  • use it's FullName as expected output for the assert

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in c69f2fd. Now storing the DirectoryInfo returned by Directory.CreateDirectory() and using its FullName property for the expected path comparison.

Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
@adamsitnik
Copy link
Owner

@copilot solve the merge conflicts

Copy link
Contributor Author

Copilot AI commented Jan 8, 2026

@copilot solve the merge conflicts

Merge conflicts resolved in 0c7feab. Successfully merged main branch which added SendSignal API alongside the CreateSuspended/Resume implementation. All 85 tests pass.

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.

Implement ProcessStartOptions.CreateSuspended and SafeChildProcessHandle.Resume

2 participants