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: data race in TestDWARFiOS #38265

Closed
josharian opened this issue Apr 5, 2020 · 5 comments
Closed

cmd/link: data race in TestDWARFiOS #38265

josharian opened this issue Apr 5, 2020 · 5 comments

Comments

@josharian
Copy link
Contributor

$ go test -race -run=TestDWARFiOS cmd/link
==================
WARNING: DATA RACE
Read at 0x00c00000e340 by goroutine 15:
  cmd/link.testDWARF.func1()
      /Users/josh/go/hack/src/cmd/link/dwarf_test.go:73 +0x48c
  testing.tRunner()
      /Users/josh/go/hack/src/testing/testing.go:1022 +0x1eb

Previous write at 0x00c00000e340 by goroutine 16:
  cmd/link.testDWARF.func1()
      /Users/josh/go/hack/src/cmd/link/dwarf_test.go:74 +0x1be7
  testing.tRunner()
      /Users/josh/go/hack/src/testing/testing.go:1022 +0x1eb

Goroutine 15 (running) created at:
  testing.(*T).Run()
      /Users/josh/go/hack/src/testing/testing.go:1073 +0x664
  cmd/link.testDWARF()
      /Users/josh/go/hack/src/cmd/link/dwarf_test.go:57 +0x50a
  cmd/link.TestDWARFiOS()
      /Users/josh/go/hack/src/cmd/link/dwarf_test.go:199 +0x635
  testing.tRunner()
      /Users/josh/go/hack/src/testing/testing.go:1022 +0x1eb

Goroutine 16 (running) created at:
  testing.(*T).Run()
      /Users/josh/go/hack/src/testing/testing.go:1073 +0x664
  cmd/link.testDWARF()
      /Users/josh/go/hack/src/cmd/link/dwarf_test.go:57 +0x50a
  cmd/link.TestDWARFiOS()
      /Users/josh/go/hack/src/cmd/link/dwarf_test.go:199 +0x635
  testing.tRunner()
      /Users/josh/go/hack/src/testing/testing.go:1022 +0x1eb
==================
==================
WARNING: DATA RACE
Read at 0x00c0003aa050 by goroutine 15:
  runtime.slicecopy()
      /Users/josh/go/hack/src/runtime/slice.go:197 +0x0
  cmd/link.testDWARF.func1()
      /Users/josh/go/hack/src/cmd/link/dwarf_test.go:75 +0x1cf0
  testing.tRunner()
      /Users/josh/go/hack/src/testing/testing.go:1022 +0x1eb

Previous write at 0x00c0003aa050 by goroutine 16:
  cmd/link.testDWARF.func1()
      /Users/josh/go/hack/src/cmd/link/dwarf_test.go:74 +0x1ba5
  testing.tRunner()
      /Users/josh/go/hack/src/testing/testing.go:1022 +0x1eb

Goroutine 15 (running) created at:
  testing.(*T).Run()
      /Users/josh/go/hack/src/testing/testing.go:1073 +0x664
  cmd/link.testDWARF()
      /Users/josh/go/hack/src/cmd/link/dwarf_test.go:57 +0x50a
  cmd/link.TestDWARFiOS()
      /Users/josh/go/hack/src/cmd/link/dwarf_test.go:199 +0x635
  testing.tRunner()
      /Users/josh/go/hack/src/testing/testing.go:1022 +0x1eb

Goroutine 16 (running) created at:
  testing.(*T).Run()
      /Users/josh/go/hack/src/testing/testing.go:1073 +0x664
  cmd/link.testDWARF()
      /Users/josh/go/hack/src/cmd/link/dwarf_test.go:57 +0x50a
  cmd/link.TestDWARFiOS()
      /Users/josh/go/hack/src/cmd/link/dwarf_test.go:199 +0x635
  testing.tRunner()
      /Users/josh/go/hack/src/testing/testing.go:1022 +0x1eb
==================
--- FAIL: TestDWARFiOS (0.94s)
    --- FAIL: TestDWARFiOS/testprogcgo (0.04s)
        dwarf_test.go:79: go build -o /var/folders/1t/n61cbvls5bl293bbb0zyypqw0000gn/T/go-link-TestDWARF589065255/testprogcgo.exe ../../runtime/testdata/testprogcgo: exit status 2
            cmd/go: unsupported GOOS/GOARCH pair darwin/arm
        testing.go:937: race detected during execution of test
    --- FAIL: TestDWARFiOS/testprogcgo#02 (0.04s)
        dwarf_test.go:79: go build -o /var/folders/1t/n61cbvls5bl293bbb0zyypqw0000gn/T/go-link-TestDWARF944584680/testprogcgo.exe ../../runtime/testdata/testprogcgo: exit status 2
            cmd/go: unsupported GOOS/GOARCH pair darwin/arm
        testing.go:937: race detected during execution of test
    --- FAIL: TestDWARFiOS/testprog (0.04s)
        dwarf_test.go:79: go build -o /var/folders/1t/n61cbvls5bl293bbb0zyypqw0000gn/T/go-link-TestDWARF585930605/testprog.exe ../../runtime/testdata/testprog: exit status 2
            cmd/go: unsupported GOOS/GOARCH pair darwin/arm
        testing.go:937: race detected during execution of test
    --- FAIL: TestDWARFiOS/testprog#02 (0.05s)
        dwarf_test.go:79: go build -o /var/folders/1t/n61cbvls5bl293bbb0zyypqw0000gn/T/go-link-TestDWARF001878830/testprog.exe ../../runtime/testdata/testprog: exit status 2
            cmd/go: unsupported GOOS/GOARCH pair darwin/arm
        testing.go:937: race detected during execution of test
    --- FAIL: TestDWARFiOS/testprogcgo#01 (2.97s)
        testing.go:937: race detected during execution of test
    --- FAIL: TestDWARFiOS/testprog#01 (3.04s)
        testing.go:937: race detected during execution of test
    --- FAIL: TestDWARFiOS/testprog#03 (3.45s)
        testing.go:937: race detected during execution of test
    --- FAIL: TestDWARFiOS/testprogcgo#03 (5.01s)
        testing.go:937: race detected during execution of test
FAIL
FAIL	cmd/link	6.505s
FAIL
@josharian
Copy link
Contributor Author

cc @cherrymui @jeremyfaller @thanm

@josharian
Copy link
Contributor Author

Ooooh. Maybe this is responsible for #32218.

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/227163 mentions this issue: cmd/compile,runtime: pass only ptr and len to some runtime calls

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/227342 mentions this issue: cmd/link: fix data race in testDWARF

gopherbot pushed a commit that referenced this issue Apr 8, 2020
Some runtime calls accept a slice, but only use ptr and len.
This change modifies most such routines to accept only ptr and len.

After this change, the only runtime calls that accept an unnecessary
cap arg are concatstrings and slicerunetostring.
Neither is particularly common, and both are complicated to modify.

Negligible compiler performance impact. Shrinks binaries a little.
There are only a few regressions; the one I investigated was
due to register allocation fluctuation.

Passes 'go test -race std cmd', modulo #38265 and #38266.
Wow, does that take a long time to run.

Updates #36890

file      before    after     Δ       %       
compile   19655024  19655152  +128    +0.001% 
cover     5244840   5236648   -8192   -0.156% 
dist      3662376   3658280   -4096   -0.112% 
link      6680056   6675960   -4096   -0.061% 
pprof     14789844  14777556  -12288  -0.083% 
test2json 2824744   2820648   -4096   -0.145% 
trace     11647876  11639684  -8192   -0.070% 
vet       8260472   8256376   -4096   -0.050% 
total     115163736 115118808 -44928  -0.039% 

Change-Id: Idb29fa6a81d6a82bfd3b65740b98cf3275ca0a78
Reviewed-on: https://go-review.googlesource.com/c/go/+/227163
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/245099 mentions this issue: compiler,runtime: pass only ptr and len to some runtime calls

gopherbot pushed a commit to golang/gofrontend that referenced this issue Jul 28, 2020
This ports https://golang.org/cl/227163 to the Go frontend.
This is a step toward moving up to the go1.15rc1 release.

Original CL description:

    cmd/compile,runtime: pass only ptr and len to some runtime calls

    Some runtime calls accept a slice, but only use ptr and len.
    This change modifies most such routines to accept only ptr and len.

    After this change, the only runtime calls that accept an unnecessary
    cap arg are concatstrings and slicerunetostring.
    Neither is particularly common, and both are complicated to modify.

    Negligible compiler performance impact. Shrinks binaries a little.
    There are only a few regressions; the one I investigated was
    due to register allocation fluctuation.

    Passes 'go test -race std cmd', modulo golang/go#38265 and golang/go#38266.
    Wow, does that take a long time to run.

    file      before    after     Δ       %
    compile   19655024  19655152  +128    +0.001%
    cover     5244840   5236648   -8192   -0.156%
    dist      3662376   3658280   -4096   -0.112%
    link      6680056   6675960   -4096   -0.061%
    pprof     14789844  14777556  -12288  -0.083%
    test2json 2824744   2820648   -4096   -0.145%
    trace     11647876  11639684  -8192   -0.070%
    vet       8260472   8256376   -4096   -0.050%
    total     115163736 115118808 -44928  -0.039%

For golang/go#36890

Change-Id: I1dc1424ccb092a9ad70472e560a743c35dd27bfc
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/245099
Reviewed-by: Cherry Zhang <cherryyz@google.com>
jpf91 pushed a commit to D-Programming-GDC/gcc that referenced this issue Jul 28, 2020
This ports https://golang.org/cl/227163 to the Go frontend.
This is a step toward moving up to the go1.15rc1 release.

Original CL description:

    cmd/compile,runtime: pass only ptr and len to some runtime calls

    Some runtime calls accept a slice, but only use ptr and len.
    This change modifies most such routines to accept only ptr and len.

    After this change, the only runtime calls that accept an unnecessary
    cap arg are concatstrings and slicerunetostring.
    Neither is particularly common, and both are complicated to modify.

    Negligible compiler performance impact. Shrinks binaries a little.
    There are only a few regressions; the one I investigated was
    due to register allocation fluctuation.

    Passes 'go test -race std cmd', modulo golang/go#38265 and golang/go#38266.
    Wow, does that take a long time to run.

    file      before    after     Δ       %
    compile   19655024  19655152  +128    +0.001%
    cover     5244840   5236648   -8192   -0.156%
    dist      3662376   3658280   -4096   -0.112%
    link      6680056   6675960   -4096   -0.061%
    pprof     14789844  14777556  -12288  -0.083%
    test2json 2824744   2820648   -4096   -0.145%
    trace     11647876  11639684  -8192   -0.070%
    vet       8260472   8256376   -4096   -0.050%
    total     115163736 115118808 -44928  -0.039%

For golang/go#36890

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/245099
@golang golang locked and limited conversation to collaborators Jul 27, 2021
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

2 participants