Skip to content

runtime, x/sys/unix: Connectx is broken on darwin/amd64 [1.24 backport] #73379

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

Closed
gopherbot opened this issue Apr 15, 2025 · 3 comments
Closed
Labels
CherryPickApproved Used during the release process for point releases compiler/runtime Issues related to the Go compiler and/or runtime.
Milestone

Comments

@gopherbot
Copy link
Contributor

@randall77 requested issue #71302 to be considered for backport to the next 1.24 minor release.

Ok, that's good. I'll get that CL in soon.

I think the remaining question is, should we backport?
In favor:

  1. This could cause really weird behavior and/or corruption on darwin/amd64. There is only one stdlib call affected (syscall/Getnameinfo), but several in x.sys (Connectx for freebsd, mmap for netbsd, dragonfly).
  2. darwin/amd64 is a first-class port.

In opposition:

  1. This has always been broken (since introduced in late 2022). It is not a regression from 1.24.
  2. Only the Connectx failure has been noticed.

I'm leaning towards backporting. The fix is pretty simple and the unfixed behavior is very hard to debug and/or work around.

@gopherbot please open backport issues

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Apr 15, 2025
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Apr 15, 2025
@gopherbot gopherbot modified the milestones: Unreleased, Go1.24.3 Apr 15, 2025
@database64128
Copy link
Contributor

Thanks for the backport request! I want to add that the only workaround for it is to use syscall.Syscall9 to make the underlying syscall directly, which is in itself a hack, and can break at any time, as these platforms do not provide a stable syscall interface.

@prattmic prattmic added the CherryPickApproved Used during the release process for point releases label Apr 16, 2025
@gopherbot gopherbot removed the CherryPickCandidate Used during the release process for point releases label Apr 16, 2025
@gopherbot
Copy link
Contributor Author

Change https://go.dev/cl/665995 mentions this issue: [release-branch.go1.24] runtime: fix 9-arg syscall on darwin/amd64

@dmitshur dmitshur changed the title x/sys/unix: Connectx is broken on darwin/amd64 [1.24 backport] runtime, x/sys/unix: Connectx is broken on darwin/amd64 [1.24 backport] Apr 16, 2025
gopherbot pushed a commit that referenced this issue Apr 28, 2025
The last 3 arguments need to be passed on the stack, not registers.

Fixes #73379

Change-Id: Ib1155ad1a805957fad3d9594c93981a558755591
Reviewed-on: https://go-review.googlesource.com/c/go/+/665435
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
(cherry picked from commit 9d7de04)
Reviewed-on: https://go-review.googlesource.com/c/go/+/665995
@gopherbot
Copy link
Contributor Author

Closed by merging CL 665995 (commit 43130af) to release-branch.go1.24.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CherryPickApproved Used during the release process for point releases compiler/runtime Issues related to the Go compiler and/or runtime.
Projects
None yet
Development

No branches or pull requests

3 participants