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

misc/cgo/testshared: TestNotes fails on Fedora 31 #35993

Closed
mpx opened this issue Dec 5, 2019 · 8 comments
Closed

misc/cgo/testshared: TestNotes fails on Fedora 31 #35993

mpx opened this issue Dec 5, 2019 · 8 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@mpx
Copy link
Contributor

mpx commented Dec 5, 2019

all.bash fails on Fedora 31 with tip (+cdf3db5df6) and go1.13.5:

##### ../misc/cgo/testshared
--- FAIL: TestNotes (0.41s)
    shared_test.go:540: read desc failed: unexpected EOF
FAIL
FAIL    misc/cgo/testshared     20.149s
FAIL
2019/12/05 23:19:18 Failed: exit status 1

The readNotes func fails during test setup.

Fedora 31 (fails)

  • Linux 5.3.13-300.fc31.x86_64
  • GNU C Library (GNU libc) stable release version 2.30.
  • gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1)
  • GNU ld version 2.32-29.fc31

Fedora 30 (works correctly)

  • Linux 5.3.11-200.fc30.x86_64
  • GNU C Library (GNU libc) stable release version 2.29.
  • gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1)
  • GNU ld version 2.31.1-34.fc30

Possibly Glibc or Binutils/ld related?

go env Output
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/m/.cache/go-build"
GOENV="/home/m/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/m/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/mark/go1.13.4"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/m/go1.13.4/pkg/tool/linux_amd64"
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 -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build260572232=/tmp/go-build -gno-record-gcc-switches"

Here is a decorated error to assist with debugging:

--- FAIL: TestNotes (0.41s)
    shared_test.go:607: read desc failed: readwithpad: got 252 bytes, want 1686352 bytes: unexpected EOF
        data = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 b0 19 00 00 00 00 00 16 b0 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60 d1 23 00 00 00 00 00 68 d1 23 00 00 00 00 00 08 00 00 00 10 00 00 00 00 01 00 00 47 41 24 01 33 61 31 00 50 bb 19 00 00 00 00 00 09 bc 19 00 00 00 00 00 08 00 00 00 10 00 00 00 00 01 00 00 47 41 24 01 33 61 31 00 60 d1 23 00 00 00 00 00 60 d1 23 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60 d1 23 00 00 00 00 00 60 d1 23 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 16 b0 19 00 00 00 00 00 1b b0 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 68 d1 23 00 00 00 00 00 6d d1 23 00 00 00 00 00 

Fedora is an early adopter of new software releases, so this bug may occur on other platforms later as well.

@gopherbot
Copy link

Change https://golang.org/cl/210017 mentions this issue: misc/cgo/testshared: add error detail for readwithpad

@mpx
Copy link
Contributor Author

mpx commented Dec 5, 2019

Cc @ianlancetaylor

@toothrot toothrot added this to the Backlog milestone Dec 5, 2019
@toothrot toothrot added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Dec 5, 2019
@siebenmann
Copy link

This failure is now happening for me on Fedora 30 with the current git tip. I thought that this might be related to binutils on Fedora 30 having recently updated to 2.31.1-36.fc30, but reverting to binutils 2.31.1-34.fc30 didn't fix the problem on my machine; it still fails with shared_test.go:603: read desc failed: unexpected EOF. One difference between my Fedora 30 machine and the original reporter's is that I'm now running kernel 5.3.13-200.fc30.x86_64 instead of the original reporter's 5.3.11-200 Fedora 30 kernel. However, I have another machine that still has kernel 5.3.11-200.fc30 and it too has the same issue.

@ianlancetaylor ianlancetaylor modified the milestones: Backlog, Go1.14 Dec 6, 2019
@ianlancetaylor
Copy link
Contributor

Looks like Fedora is adding a section .gnu.build.attributes that has type SHT_NOTE but is not in the standard ELF note format. I don't know why that would be. I've asked on the binutils@sourceware.org mailing list.

@gopherbot
Copy link

Change https://golang.org/cl/210259 mentions this issue: misc/cgo/testshared: skip .gnu.build.attributes note section

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor
Copy link
Contributor

This turns out to be a bug in strip that caused a bug in the notes recorded in glibc. This has already been fixed by updating to the current Fedora 31 glibc. So there is nothing we need to do here on the Go side.

Thanks for reporting it.

@mpx
Copy link
Contributor Author

mpx commented Dec 6, 2019

Thanks for tracking it down!

@golang golang locked and limited conversation to collaborators Dec 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants