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/gofmt: race in long test #3249

Closed
mikioh opened this issue Mar 8, 2012 · 1 comment
Closed

cmd/gofmt: race in long test #3249

mikioh opened this issue Mar 8, 2012 · 1 comment

Comments

@mikioh
Copy link
Contributor

@mikioh mikioh commented Mar 8, 2012

What steps will reproduce the problem?
1. run go test cmd/gofmt (long test, GOMAXPROCS=4)
2.
3.

What is the expected output? What do you see instead?
% go test -v cmd/gofmt
=== RUN TestRewrite-4
--- PASS: TestRewrite-4 (0.04 seconds)
=== RUN TestAll-4
panic: illegal base or size

goroutine 6 [running]:
go/token.(*FileSet).AddFile(0xf840044b00, 0xf8403e7180, 0x3b, 0x111db0050f5a0, 0x0, ...)
    /home/mikioh/go/src/pkg/go/token/position.go:333 +0x217
go/parser.(*parser).init(0xf8405c96c0, 0xf840044b00, 0xf8403e7180, 0xf80000003b,
0xf84065c000, ...)
    /home/mikioh/go/src/pkg/go/parser/parser.go:66 +0x7b
go/parser.ParseFile(0xf840044b00, 0xf8403e7180, 0x1fe000000003b, 0x4ca348, 0xf840713ba0,
...)
    /home/mikioh/go/src/pkg/go/parser/interface.go:91 +0x130
cmd/gofmt.parse(0xf8403e7180, 0x3b, 0xf84065c000, 0x1fe00000111db, 0x11100, ...)
    /home/mikioh/go/src/cmd/gofmt/gofmt.go:259 +0x82
cmd/gofmt.testFile(0xf84006b1c0, 0xf84007dc60, 0xf84007dcc0, 0xf8403e7180, 0xf80000003b,
...)
    /home/mikioh/go/src/cmd/gofmt/long_test.go:61 +0x328
cmd/gofmt.testFiles(0xf84006b1c0, 0xf840115000, 0xf8400f7050, 0x0, 0x0, ...)
    /home/mikioh/go/src/cmd/gofmt/long_test.go:94 +0xb0
created by cmd/gofmt.TestAll
    /home/mikioh/go/src/cmd/gofmt/long_test.go:146 +0x18d

goroutine 1 [chan receive]:
testing.RunTests(0x400c00, 0x609b38, 0x200000002, 0x1, 0x5fe4a8, ...)
    /home/mikioh/go/src/pkg/testing/testing.go:350 +0x79f
testing.Main(0x400c00, 0x609b38, 0x200000002, 0x60d940, 0x0, ...)
    /home/mikioh/go/src/pkg/testing/testing.go:285 +0x7a
main.main()
    /tmp/go-build244483973/cmd/gofmt/_test/_testmain.go:45 +0x91

goroutine 2 [syscall]:
created by runtime.main
    /home/mikioh/go/src/pkg/runtime/proc.c:221

goroutine 4 [chan receive]:
cmd/gofmt.TestAll(0xf84006b1c0, 0x2fb8cc0)
    /home/mikioh/go/src/cmd/gofmt/long_test.go:151 +0x1c5
testing.tRunner(0xf84006b1c0, 0x609b50, 0x0, 0x0)
    /home/mikioh/go/src/pkg/testing/testing.go:273 +0x6f
created by testing.RunTests
    /home/mikioh/go/src/pkg/testing/testing.go:349 +0x77c

goroutine 5 [runnable]:
cmd/gofmt._func_006(0x80075efa8, 0x80075efb0, 0x4adf81, 0xf8402bbed0, 0xf80000002b, ...)
    /home/mikioh/go/src/cmd/gofmt/long_test.go:108 +0x123
path/filepath.walk(0xf8402bbed0, 0x20000002b, 0xf840001af0, 0xf840623370, 0xf84012a040,
...)
    /home/mikioh/go/src/pkg/path/filepath/path.go:302 +0x6f
path/filepath.walk(0xf840071210, 0x200000023, 0xf840001af0, 0xf840623050, 0xf84012a040,
...)
    /home/mikioh/go/src/pkg/path/filepath/path.go:320 +0x396
path/filepath.walk(0xf840088120, 0x20000001d, 0xf840001af0, 0xf8402dd8c0, 0xf84012a040,
...)
    /home/mikioh/go/src/pkg/path/filepath/path.go:320 +0x396
path/filepath.walk(0xf8403f6f60, 0x200000017, 0xf840001af0, 0xf84020b320, 0xf84012a040,
...)
    /home/mikioh/go/src/pkg/path/filepath/path.go:320 +0x396
path/filepath.walk(0xf840169e00, 0x200000013, 0xf840001af0, 0xf840134370, 0xf84012a040,
...)
    /home/mikioh/go/src/pkg/path/filepath/path.go:320 +0x396
path/filepath.walk(0x7fffffffef31, 0x80000000f, 0xf840001af0, 0xf8400f7e10,
0xf84012a040, ...)
    /home/mikioh/go/src/pkg/path/filepath/path.go:320 +0x396
path/filepath.Walk(0x7fffffffef31, 0xf, 0xf84012a040, 0x80075efb0, 0xf84012a040, ...)
    /home/mikioh/go/src/pkg/path/filepath/path.go:337 +0xd1
cmd/gofmt.genFilenames(0xf84006b1c0, 0xf840115000, 0x0, 0x0)
    /home/mikioh/go/src/cmd/gofmt/long_test.go:124 +0x194
created by cmd/gofmt.TestAll
    /home/mikioh/go/src/cmd/gofmt/long_test.go:141 +0x123

goroutine 7 [running]:
created by cmd/gofmt.TestAll
    /home/mikioh/go/src/cmd/gofmt/long_test.go:146 +0x18d
exit status 2
FAIL    cmd/gofmt   2.691s

Please use labels and text to provide additional information.
It's race in test code.
Also FreeBSD is very good for detecting race issues.
@mikioh
Copy link
Contributor Author

@mikioh mikioh commented Mar 8, 2012

Comment 1:

This issue was closed by revision dfb1af4.

Status changed to Fixed.

@mikioh mikioh added fixed labels Mar 8, 2012
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.