Skip to content

Fix missing return after accept4 failure in InteropServer::Accept#40323

Open
benhillis wants to merge 1 commit intofeature/wsl-for-appsfrom
copilot/fix-c1-accept4-missing-return
Open

Fix missing return after accept4 failure in InteropServer::Accept#40323
benhillis wants to merge 1 commit intofeature/wsl-for-appsfrom
copilot/fix-c1-accept4-missing-return

Conversation

@benhillis
Copy link
Copy Markdown
Member

@benhillis benhillis commented Apr 25, 2026

When accept4 fails in InteropServer::Accept, the function logs an error but falls through to call setsockopt on the invalid file descriptor (-1) and returns it to the caller.

This return {}; exists on master (added in 040f5e4) but was lost during a merge into feature/wsl-for-apps.

Fix: Add the missing early return {}; to match master behavior.

Copilot AI review requested due to automatic review settings April 25, 2026 20:50
@benhillis benhillis requested a review from a team as a code owner April 25, 2026 20:50
When accept4 fails, the function logged an error but continued to call
setsockopt on an invalid file descriptor (-1) and returned the invalid
fd to the caller. Add the missing early return to prevent operating on
an invalid file descriptor.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@benhillis benhillis force-pushed the copilot/fix-c1-accept4-missing-return branch from 66ef8d3 to bb0c231 Compare April 25, 2026 20:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR restores the missing early return {}; in InteropServer::Accept() on accept4() failure to avoid calling setsockopt() on an invalid fd and returning it to callers (aligning behavior with master).

Changes:

  • Add an early return {}; when accept4() fails in InteropServer::Accept().
  • (Unrelated) Add CloudTest/TAEF run outputs and system logs under GeneralAttachment/.

Reviewed changes

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/linux/init/util.cpp Adds missing early return after accept4() failure in InteropServer::Accept().
GeneralAttachment/TestResults/stdout.txt Captured test stdout output (appears to be generated artifact).
GeneralAttachment/TestResults/stderr.txt Captured test stderr output (appears to be generated artifact).
GeneralAttachment/TestResults/dmesg.txt Captured kernel log output (appears to be generated artifact).
GeneralAttachment/TestResults/TestJobGroupFile/TestGroup.xml CloudTest job group definition captured from a run.
GeneralAttachment/TestResults/TaefTestConsoleLogs/wsltests_6.psinfo Process/environment snapshot from test execution.
GeneralAttachment/TestResults/ProcessDumpUrls.txt Dump URL output captured from a run.
GeneralAttachment/TestResults/Get-MpPreference.txt Defender preferences output captured from a run.
GeneralAttachment/TestResults/CloudTest-SetupLogs/CloudTest-Setup_1.psinfo Setup script process/environment snapshot from a run.
GeneralAttachment/TestResults/CloudTest-SetupLogs/CloudTest-Setup_1.out Setup script stdout from a run.
GeneralAttachment/SystemLogs/worker-service20260425.log CloudTest worker service log captured from a run.
GeneralAttachment/SystemLogs/downloadReport.csv Download report output captured from a run (includes signed URLs).
GeneralAttachment/SystemLogs/DiskPartitioning.stdout Disk partitioning script stdout captured from a run.
GeneralAttachment/SystemLogs/DiskPartitioning.psinfo Disk partitioning script process/environment snapshot from a run.
GeneralAttachment/SystemLogs/AntivirusPowershell.psinfo Antivirus exclusion script process/environment snapshot from a run.
GeneralAttachment/ProcessDumpUrls.txt Dump URL output (root copy) captured from a run.

@benhillis benhillis enabled auto-merge (squash) April 27, 2026 04:52
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.

2 participants