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

os: TestLstat failure on Linux Aarch64 #57210

Closed
davidecarlson opened this issue Dec 9, 2022 · 9 comments
Closed

os: TestLstat failure on Linux Aarch64 #57210

davidecarlson opened this issue Dec 9, 2022 · 9 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@davidecarlson
Copy link

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

go version go1.16.12 linux/arm64

Does this issue reproduce with the latest release?

Yes. I am attempting to build the latest release.

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

go env Output
GO111MODULE="off"
GOARCH="arm64"
GOBIN=""
GOCACHE="/lustre/home/decarlson/.cache/go-build"
GOENV="/lustre/home/decarlson/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/lustre/home/decarlson/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/lustre/home/decarlson/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_arm64"
GOVCS=""
GOVERSION="go1.16.12"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3765504996=/tmp/go-build -gno-record-gcc-switches"

What did you do?

git clone https://go.googlesource.com/go goroot
cd goroot/
git checkout go1.19.4
cd src/
./all.bash -v

What did you expect to see?

I expected a successful build.

What did you see instead?

The build fails with the following error:

ok      cmd/trace       0.578s
ok      cmd/vet 16.126s
FAIL
go tool dist: Failed: exit status 1

I have attached a log file with the full output of the ./all.bash -v
gobuild.log

Any suggestions would be most welcome!
Thanks,
Dave

@ianlancetaylor
Copy link
Contributor

The failure is

--- FAIL: TestLstat (0.00s)
    os_test.go:280: size should be 7786 ; is 16
FAIL
FAIL	os	2.892s

This test is calling os.Lstat on the file /etc/group. Is that file a symlink on your system?

@ianlancetaylor ianlancetaylor changed the title Go 1.19.4 build failure on Linux Aarch64 os: TestLstat failure on Linux Aarch64 Dec 9, 2022
@davidecarlson
Copy link
Author

Thanks for your response. Yes, /etc/group is a symlink:

lrwxrwxrwx 1 root root 16 Jul 22 18:29 /etc/group -> /cm/shared/group

@ianlancetaylor
Copy link
Contributor

Thanks. This is not a problem with your Go build. It's a problem with the test. For your purposes, you can ignore the test failure. I'll fix the test to handle this case correctly.

@ianlancetaylor
Copy link
Contributor

@gopherbot Please open backport issues.

This is a bug in the test that will show up on systems for which /etc/group is a symlink. Since apparently such systems exist, we should fix the bug in supported releases.

@gopherbot
Copy link

Change https://go.dev/cl/456557 mentions this issue: os: skip size test in TestLstat if the file is a symlink

@gopherbot
Copy link

Backport issue(s) opened: #57213 (for 1.18), #57214 (for 1.19).

Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases.

@davidecarlson
Copy link
Author

Thanks a lot for your help with this, Ian.
Best,
Dave

@gopherbot
Copy link

Change https://go.dev/cl/456560 mentions this issue: [release-branch.go1.19] os: skip size test in TestLstat if the file is a symlink

@gopherbot
Copy link

Change https://go.dev/cl/456561 mentions this issue: [release-branch.go1.18] os: skip size test in TestLstat if the file is a symlink

@dmitshur dmitshur added Testing An issue that has been verified to require only test changes, not just a test failure. NeedsFix The path to resolution is known, but the work has not been done. labels Dec 10, 2022
@dmitshur dmitshur added this to the Go1.20 milestone Dec 10, 2022
gopherbot pushed a commit that referenced this issue Dec 14, 2022
…s a symlink

Tested by temporarily changing sysdir to use a directory where
the expected files were all symlinks. We should consider using
a different approach that doesn't rely on sysdir, but for now
do a minimal fix.

For #57210
Fixes #57213

Change-Id: Ifb1becef03e014ceb48290ce13527b3e103c0e07
Reviewed-on: https://go-review.googlesource.com/c/go/+/456557
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
(cherry picked from commit 9b8750f)
Reviewed-on: https://go-review.googlesource.com/c/go/+/456561
Reviewed-by: Austin Clements <austin@google.com>
gopherbot pushed a commit that referenced this issue Dec 14, 2022
…s a symlink

Tested by temporarily changing sysdir to use a directory where
the expected files were all symlinks. We should consider using
a different approach that doesn't rely on sysdir, but for now
do a minimal fix.

For #57210
Fixes #57214

Change-Id: Ifb1becef03e014ceb48290ce13527b3e103c0e07
Reviewed-on: https://go-review.googlesource.com/c/go/+/456557
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
(cherry picked from commit 9b8750f)
Reviewed-on: https://go-review.googlesource.com/c/go/+/456560
Reviewed-by: Austin Clements <austin@google.com>
@golang golang locked and limited conversation to collaborators Dec 10, 2023
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. Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
None yet
Development

No branches or pull requests

4 participants