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/link: tests fail after regenerating testdata on linux_amd64 #8494

Closed
mdempsky opened this issue Aug 7, 2014 · 4 comments
Closed

cmd/link: tests fail after regenerating testdata on linux_amd64 #8494

mdempsky opened this issue Aug 7, 2014 · 4 comments

Comments

@mdempsky
Copy link
Member

mdempsky commented Aug 7, 2014

After cd'ing into cmd/link/testdata and running "make" on Ubuntu 14.04,
running "go test cmd/link" fails:

--- FAIL: TestLinkHello (0.01s)
    prog_test.go:160: testdata/link.hello.darwin.amd64: output file differs at byte 136: have 0xed, want 0xd6
--- FAIL: TestPclntab (0.00s)
    pclntab_test.go:272: pclntab(func0): at pc=+0x0, pcdata#0=-134217728, want -1
    pclntab_test.go:272: pclntab(func1): at pc=+0x0, pcdata#0=-134217728, want -1
    pclntab_test.go:272: pclntab(func2): at pc=+0x0, pcdata#0=-134217728, want -1

The first failure seems to be because hello.6 embeds the source path
"/Users/rsc/g/go/src/cmd/link/testdata/hello.s", which gets copied into the
linker output, and regenerating hello.6 will cause it to contain a new source path
depending on the user's checkout directory name.  This seems easily fixed by changing
cmd/link/testdata/Makefile to pass -trimpath=$PWD to 6a.

The second failure is a bit more surprising though.  Still investigating.
@mdempsky
Copy link
Member Author

mdempsky commented Aug 7, 2014

Comment 1:

Tangentially, http://golang.org/s/go12symtab claims that "nfuncdata" precedes "npcdata",
but cmd/ld and cmd/link put "npcdata" first.

@gopherbot
Copy link

Comment 2:

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

@mdempsky
Copy link
Member Author

mdempsky commented Aug 8, 2014

Comment 3:

FWIW, the pclntab_test.go bug was triggered by revision
96917e010ddf9fb400e9e834813a9d3930ae252e.  cmd/link/testdata/pclntab.s does not define a
PCDATA 0 table, but because of the liblink bug fixed in that CL, 6a previously still
emitted a PCDATA table for index 0 that explicitly mapped the entire PC range to -1.
With new liblink, 6a emits a "0" value in index 0, which pclntab_test.go was erroneously
treating as an offset still.  That resulted in trying to parse the symtab header (e.g.,
0xfffffffb, in LE encoding) as a varint, which seems to then coincide with the unwanted
-134217728 value from the error message.

@rsc
Copy link
Contributor

rsc commented Aug 25, 2014

Comment 4:

This issue was closed by revision 2a679f8.

Status changed to Fixed.

@mdempsky mdempsky added the fixed label Aug 25, 2014
@golang golang locked and limited conversation to collaborators Jun 25, 2016
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jun 25, 2018
Fixes golang#8494.

LGTM=rsc
R=golang-codereviews, gobot, rsc, evankroske
CC=golang-codereviews
https://golang.org/cl/123040043
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jul 9, 2018
Fixes golang#8494.

LGTM=rsc
R=golang-codereviews, gobot, rsc, evankroske
CC=golang-codereviews
https://golang.org/cl/123040043
This issue was closed.
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

3 participants