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: TestMachoWrite fails #7111

Closed
gpaul opened this issue Jan 13, 2014 · 2 comments

Comments

Projects
None yet
4 participants
@gpaul
Copy link
Contributor

commented Jan 13, 2014

If I run the cmd/link short tests with -cpu 1 they pass.
If I run the cmd/link short tests with -cpu 2 they pass.
If I run the cmd/link short tests with -cpu 1,2 TestMachoWrite fails with index out of
range.

I'm guessing that they stomp on each other.

Steps to reproduce:
  hg clone https://code.google.com/p/go/ 
  export GOROOT=`pwd`/go
  cd go/src
  ./make.bash 
  go test -short -cpu 1 cmd/link # pass
  go test -short -cpu 2 cmd/link # pass
  go test -short -cpu 1,2 cmd/link # fail

$ go test -v -short -cpu 1 cmd/link 
=== RUN TestLinkHello
--- PASS: TestLinkHello (0.00 seconds)
=== RUN TestMachoWrite
--- PASS: TestMachoWrite (0.00 seconds)
PASS
ok      cmd/link    0.004s

$ go test -v -short -cpu 2 cmd/link 
=== RUN TestLinkHello-2
--- PASS: TestLinkHello-2 (0.00 seconds)
=== RUN TestMachoWrite-2
--- PASS: TestMachoWrite-2 (0.00 seconds)
PASS
ok      cmd/link    0.004s

$ go test -v -short -cpu 1,2 cmd/link 
=== RUN TestLinkHello
--- PASS: TestLinkHello (0.00 seconds)
=== RUN TestMachoWrite
--- PASS: TestMachoWrite (0.00 seconds)
=== RUN TestLinkHello-2
--- PASS: TestLinkHello-2 (0.00 seconds)
=== RUN TestMachoWrite-2
--- FAIL: TestMachoWrite-2 (0.00 seconds)
panic: runtime error: slice bounds out of range [recovered]
    panic: runtime error: slice bounds out of range

goroutine 6 [running]:
runtime.panic(0x5b9ba0, 0x80fdea)
    /home/gustav/tmpgo4/go/src/pkg/runtime/panic.c:264 +0xb6
testing.func·005()
    /home/gustav/tmpgo4/go/src/pkg/testing/testing.go:385 +0xe8
runtime.panic(0x5b9ba0, 0x80fdea)
    /home/gustav/tmpgo4/go/src/pkg/runtime/panic.c:246 +0x106
cmd/link.machoRead(0x301000007, 0xc2100ad200, 0x200d, 0x21b8, 0xc21004e640, ...)
    /home/gustav/tmpgo4/go/src/cmd/link/macho_test.go:339 +0x2fbf
cmd/link.TestMachoWrite(0xc210070510)
    /home/gustav/tmpgo4/go/src/cmd/link/macho_test.go:184 +0x2d2
testing.tRunner(0xc210070510, 0x80aab8)
    /home/gustav/tmpgo4/go/src/pkg/testing/testing.go:391 +0x8b
created by testing.RunTests
    /home/gustav/tmpgo4/go/src/pkg/testing/testing.go:471 +0x958

goroutine 1 [chan receive]:
testing.RunTests(0x643dd8, 0x80aaa0, 0x2, 0x2, 0x1)
    /home/gustav/tmpgo4/go/src/pkg/testing/testing.go:472 +0x97b
testing.Main(0x643dd8, 0x80aaa0, 0x2, 0x2, 0x814120, ...)
    /home/gustav/tmpgo4/go/src/pkg/testing/testing.go:403 +0x8c
main.main()
    /dev/shm/go-build803010548/cmd/link/_test/_testmain.go:49 +0x9c
exit status 2
FAIL    cmd/link    0.006s

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g


Which operating system are you using?
Linux 3.12.5-200.fc19.x86_64 #1 SMP Tue Dec 17 22:21:14 UTC 2013 x86_64 x86_64 x86_64
GNU/Linux

Which version are you using?  (run 'go version')
running tip.
go version devel +270e6a19b4ec Mon Jan 13 11:25:48 2014 +1100 linux/amd64
@davecheney

This comment has been minimized.

Copy link
Contributor

commented Feb 3, 2014

Comment 1:

This is a test bug. The test probably doesn't leave the test fixture untouched after the
first run so fails to process the changed fixture on the second run.
go test -v -short -cpu 1,1 cmd/link
Also fails, showing this is not related to concurrency.

Labels changed: added release-none, repo-main, suggested.

Status changed to Accepted.

@bradfitz

This comment has been minimized.

Copy link
Member

commented Feb 19, 2014

Comment 2:

This issue was closed by revision 86ac618.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 25, 2016

This issue was closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.