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

cmd/go: TestNoteReading fails on dragonfly #13364

Closed
rsc opened this issue Nov 23, 2015 · 12 comments
Closed

cmd/go: TestNoteReading fails on dragonfly #13364

rsc opened this issue Nov 23, 2015 · 12 comments

Comments

@rsc
Copy link
Contributor

rsc commented Nov 23, 2015

TestNoteReading fails on the dragonfly builder. It may actually be fine on dragonfly.
The builder started failing this test in an unrelated commit tweaking comments in the compiler source code.
Disabling the test so that maybe the builder can still be useful for finding other problems on dragonfly.

Milestone=Unplanned because dragonfly is not a first-tier system.
The dragonfly maintainers can fix this if they like.

@rsc rsc added this to the Unplanned milestone Nov 23, 2015
mk0x9 pushed a commit to mk0x9/go that referenced this issue Nov 23, 2015
It started failing on the dragonfly builder at an unrelated commit
(one that changed the wording in a few comments in the compiler).

Created golang#13364 to track this.

Change-Id: I462880bed8ff565a9950e7e185de97d43999c5e2
Reviewed-on: https://go-review.googlesource.com/17143
Reviewed-by: Russ Cox <rsc@golang.org>
@gopherbot
Copy link

CL https://golang.org/cl/17144 mentions this issue.

rsc added a commit that referenced this issue Nov 23, 2015
It started failing on the dragonfly builder at an unrelated commit
(one that changed the wording in a few comments in the compiler).

Created #13364 to track this.

Change-Id: I462880bed8ff565a9950e7e185de97d43999c5e2
Reviewed-on: https://go-review.googlesource.com/17143
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-on: https://go-review.googlesource.com/17144
@kaey
Copy link

kaey commented Nov 23, 2015

Works on my machine.
Guess it's a builder problem.

% sh
$ eval `~/go/bin/go tool dist env -p`
$ go test -v -run 'TestNoteReading' cmd/go
=== RUN   TestNoteReading
--- PASS: TestNoteReading (0.69s)
        go_test.go:257: running testgo [build -ldflags -buildid=TestNoteReading-Build-ID -o /tmp/gotest292090317/hello.exe /tmp/gotest292090317/hello.go]
        go_test.go:257: running testgo [build -ldflags -buildid=TestNoteReading-Build-ID -linkmode=external -o /tmp/gotest292090317/hello.exe /tmp/gotest292090317/hello.go]
=== RUN   TestNoteReading2K
--- PASS: TestNoteReading2K (0.71s)
        go_test.go:257: running testgo [build -ldflags -buildid=TestNoteReading-Build-ID -o /tmp/gotest559435976/hello.exe /tmp/gotest559435976/hello.go]
        go_test.go:257: running testgo [build -ldflags -buildid=TestNoteReading-Build-ID -linkmode=external -o /tmp/gotest559435976/hello.exe /tmp/gotest559435976/hello.go]
PASS
ok      cmd/go  7.773s
$ ^D

@fupjack
Copy link

fupjack commented Nov 25, 2015

When we had bug #13146 I used retrybuilds to redo several of the most recent builds. Each one failed with this build ID issue. The place where this error first starts is the oldest version where I retried the build, not the commit where it was first could happen.

The machine where this testing is done is running DragonFly-master, and was updated at the time the fix for bug #13146 was applied, which brought in gold as the default linker.

Running the same test as @kaey fails on the build machine. Setting LDVER=ld.bfd, which sets the default linker back to ld and re-running the test succeeds. So, each of those failed tests is running with gold as the default linker, and that's the cause for the failure rather than an individual commit.

The readelf output between the old linker and the gold linker on a super-basic hello.c program on DragonFly is almost exactly the same, except the gold linker also outputs this:

Displaying notes found at file offset 0x00000b04 with length 0x0000001c:
  Owner                 Data size Description
  GNU                  0x00000009 NT_GNU_GOLD_VERSION (gold version)
    Version: gold 1.11

I thought it might be similar to #12178 but the offset only puts it past the first 512 bytes, and I think anywhere in the first 16K is OK - unless the gold output is the issue. I am not familiar with this.

Running
go build -ldflags -buildid=TestNoteReading-Build-ID -o hellotest.exe hello.go
readelf -n hellotest.exe

Gives identical results with ld or gold :

Displaying notes found at file offset 0x00000fd8 with length 0x00000028:
  Owner                 Data size Description
  Go                   0x00000018 Unknown note type: (0x00000004)

@rsc
Copy link
Contributor Author

rsc commented Nov 25, 2015

Can you post a copy of the hellotest.exe you generated with gold somewhere?
Thanks.

On Tue, Nov 24, 2015 at 10:20 PM, Justin Sherrill notifications@github.com
wrote:

When we had bug #13146 #13146 I used
retrybuilds to redo several of the most recent builds. Each one failed with
this build ID issue. The place where this error first starts is the oldest
version where I retried the build, not the commit where it was first could
happen.

The machine where this testing is done is running DragonFly-master, and
was updated at the time the fix for bug #13146
#13146 was applied, which brought in
gold as the default linker
http://lists.dragonflybsd.org/pipermail/commits/2015-November/458732.html
.

Running the same test as @kaey https://github.com/kaey fails on the
build machine. Setting LDVER=ld.bfd, which sets the default linker back to
ld and re-running the test succeeds. So, each of those failed tests is
running with gold as the default linker, and that's the cause for the
failure rather than an individual commit.

The readelf output between the old linker and the gold linker on a
super-basic hello.c program on DragonFly is almost exactly the same, except
the gold linker also outputs this:

Displaying notes found at file offset 0x00000b04 with length 0x0000001c:
Owner Data size Description
GNU 0x00000009 NT_GNU_GOLD_VERSION (gold version)
Version: gold 1.11

I thought it might be similar to #12178
#12178 but the offset only puts it
past the first 512 bytes, and I think anywhere in the first 16K is OK -
unless the gold output is the issue. I am not familiar with this.

Running
go build -ldflags -buildid=TestNoteReading-Build-ID -o hellotest.exe
hello.go
readelf -n hellotest.exe

Gives identical results:

Displaying notes found at file offset 0x00000fd8 with length 0x00000028:
Owner Data size Description
Go 0x00000018 Unknown note type: (0x00000004)


Reply to this email directly or view it on GitHub
#13364 (comment).

@fupjack
Copy link

fupjack commented Nov 25, 2015

http://shiningsilence.com/go-gold/

Minimal program in hello.go, compiled with 'go build -ldflags -buildid=TestNoteReading-Build-ID -o hellotest-[gold|ld].exe hello.go', and resulting binaries are done with gold and with old ld, appropriately named.

@ianlancetaylor
Copy link
Contributor

At the link http://shiningsilence.com/go-gold/ the files hellotest-gold.exe and hellotest-ld.exe are identical.

@fupjack
Copy link

fupjack commented Nov 25, 2015

Looking at the error output when running the test:

# go test -v -run 'TestNoteReading' cmd/go
=== RUN   TestNoteReading
--- FAIL: TestNoteReading (1.51s)
        go_test.go:251: running testgo [build -ldflags -buildid=TestNoteReading-Build-ID -o /tmp/gotest104822668/hello.exe /tmp/gotest104822668/hello.go]
        go_test.go:251: running testgo [build -ldflags -buildid=TestNoteReading-Build-ID -linkmode=external -o /tmp/gotest104822668/hello.exe /tmp/gotest104822668/hello.go]
        note_test.go:46: buildID in hello binary = "", want "TestNoteReading-Build-ID" (linkmode=external)
FAIL
exit status 1
FAIL    cmd/go  15.190s

Is it perhaps the linkmode=external that's killing it? That was not in the identical test versions

@ianlancetaylor
Copy link
Contributor

@fupjack Did you see my note that on the link you provided, the two hellotest executables are identical? They are both from GNU ld. You didn't provide the one linked by gold.

@ianlancetaylor
Copy link
Contributor

@fupjack We want to the test to pass using external linking. The test builds the binary twice, once with default linking and once with external linking.

@fupjack
Copy link

fupjack commented Nov 26, 2015

Fixed - different binaries in place at http://shiningsilence.com/go-gold/ - I made sure this time.

MD5 (hellotest-gold.exe) = 92b68ba2a3c271a664568ff6c5cf6ac4
MD5 (hellotest-ld.exe) = dd39183acefeb15e95a26015df3d96e6

@ianlancetaylor
Copy link
Contributor

Thanks. The problem is that the note reading code fails to handle multiple notes in a single PT_NOTE segment. I'll send a CL.

@gopherbot
Copy link

CL https://golang.org/cl/17331 mentions this issue.

@golang golang locked and limited conversation to collaborators Dec 1, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants