Skip to content
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

x/sys/unix: Pipe does not work on Darwin #43498

Closed
ianlancetaylor opened this issue Jan 4, 2021 · 4 comments
Closed

x/sys/unix: Pipe does not work on Darwin #43498

ianlancetaylor opened this issue Jan 4, 2021 · 4 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. OS-Darwin
Milestone

Comments

@ianlancetaylor
Copy link
Contributor

The x/sys/unix Pipe implementation is incorrect on Darwin. The x/sys/unix package needs a change along the lines of the change to syscall/syscall_darwin.go in https://golang.org/cl/141639. Unfortunately, it may have to be more complicated if we want to continue supporting Go 1.12 in the x/sys/unix package, as for 1.12 we should probably use the existing version of Pipe.

CC @randall77

@ianlancetaylor ianlancetaylor added OS-Darwin NeedsFix The path to resolution is known, but the work has not been done. labels Jan 4, 2021
@ianlancetaylor ianlancetaylor added this to the Unreleased milestone Jan 4, 2021
@randall77
Copy link
Contributor

randall77 commented Jan 4, 2021

Yikes, looks like this never worked. The pipe calling convention is different between the raw syscall and the libc call.
Any idea if there are others like this?

Fortunately I don't think we use x/sys/unix.Pipe anywhere in the stdlib. So no need to vendor in any fix here.

The corresponding x/sys/unix change to https://golang.org/cl/141639 was https://golang.org/cl/154179

It should be easy to keep supporting 1.12. There are separate files for <=1.12 and >1.12 support.

@randall77 randall77 self-assigned this Jan 4, 2021
@randall77
Copy link
Contributor

1.12 is actually when we cut over to libc system calls. So only <= 1.11 support would still need support for raw system calls.
But it looks like that support is already gone in x/sys/unix: https://golang.org/cl/250437
So the fix is easy.

@gopherbot
Copy link

Change https://golang.org/cl/281432 mentions this issue: unix: fix darwin pipe implementation

@gopherbot
Copy link

Change https://golang.org/cl/280622 mentions this issue: unix: don't call testing.T.Fatalf in a background goroutine

gopherbot pushed a commit to golang/sys that referenced this issue Jan 5, 2021
> Those methods [...] must be called only from the goroutine running the
> Test function.

For golang/go#43498

Change-Id: I847067936ade613a21b059c90219bd285425f0aa
Reviewed-on: https://go-review.googlesource.com/c/sys/+/280622
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Ian Lance Taylor <iant@golang.org>
@golang golang locked and limited conversation to collaborators Jan 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. OS-Darwin
Projects
None yet
Development

No branches or pull requests

4 participants
@ianlancetaylor @randall77 @gopherbot and others