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

runtime: pipe syscall requires COMPAT_FREEBSD10 on FreeBSD 11 and 12 #42659

Closed
dmgk opened this issue Nov 17, 2020 · 2 comments
Closed

runtime: pipe syscall requires COMPAT_FREEBSD10 on FreeBSD 11 and 12 #42659

dmgk opened this issue Nov 17, 2020 · 2 comments

Comments

@dmgk
Copy link
Contributor

@dmgk dmgk commented Nov 17, 2020

What version of Go are you using (go version)?

$ go version
go version devel +0ae3b7cb74 Tue Nov 17 13:20:20 2020 +0000 freebsd/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/dmgk/.cache/go-build"
GOENV="/home/dmgk/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="freebsd"
GOINSECURE=""
GOMODCACHE="/home/dmgk/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="freebsd"
GOPATH="/home/dmgk/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/dmgk/opt/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/dmgk/opt/go/pkg/tool/freebsd_amd64"
GOVCS=""
GOVERSION="devel +0ae3b7cb74 Tue Nov 17 13:20:20 2020 +0000"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build433466628=/tmp/go-build -gno-record-gcc-switches"

What did you do?

$ ./all.bash

What did you expect to see?

All tests passing.

What did you see instead?

On FreeBSD 12-STABLE with kernel built only with COMPAT_FREEBSD11 as required by wiki [1]:

...
ok      regexp/syntax   1.706s
--- FAIL: TestSignalM (0.00s)
    crash_unix_test.go:325: function not implemented
--- FAIL: TestSetNonblock (0.00s)
    nbpipe_test.go:75: function not implemented
FAIL
FAIL    runtime 103.442s

pipe() became a wrapper around pipe2() in FreeBSD 11.0, and on FreeBSD 11 and 12 it requires a kernel built with COMPAT_FREEBSD10 [2]. It seems that either:

  • wiki page [1] needs to be updated to mention that COMPAT_FREEBSD10 is required in addition to COMPAT_FREEBSD11, or
  • given that FreeBSD 10 is EOL, runtime·pipe needs to be rewritten to be a wrapper around runtime·pipe2, similar to [3]

[1] https://github.com/golang/go/wiki/FreeBSD
[2] freebsd/freebsd-src@e4ef214
[3] https://github.com/golang/go/blob/master/src/runtime/sys_freebsd_arm64.s#L131

@tklauser
Copy link
Member

@tklauser tklauser commented Nov 17, 2020

Given that the final supported version for FreeBSD 10 is Go 1.12.4, FreeBSD 10 is EOL and the pipe2 syscall is available since FreeBSD 10.0 (according to https://www.freebsd.org/cgi/man.cgi?pipe(2)#IMPLEMENTATION_NOTES) let's implement runtime.pipe using the pipe2 syscall. This is already done for various other ports.

/cc @ianlancetaylor

Loading

@gopherbot
Copy link

@gopherbot gopherbot commented Nov 17, 2020

Change https://golang.org/cl/270917 mentions this issue: runtime: use pipe2 syscall for pipe on freebsd

Loading

@tklauser tklauser added this to the Go1.16 milestone Nov 17, 2020
@gopherbot gopherbot closed this in ee1b512 Nov 18, 2020
@golang golang locked and limited conversation to collaborators Nov 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants