Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Races in GPS #479

Closed
krisnova opened this issue Apr 28, 2017 · 2 comments
Closed

Races in GPS #479

krisnova opened this issue Apr 28, 2017 · 2 comments

Comments

@krisnova
Copy link
Contributor

krisnova commented Apr 28, 2017

@sdboyer place holder issue to remind us to fix the races in gps. I think we can close this once the fixes are merged in to dep with #453.

I'll add some logs and notes when I get back to my desk!

In gps:

go test -race ./...
@krisnova
Copy link
Contributor Author

Output from races

[kris@polly gps]$ lscpu | grep "CPU(s):"
CPU(s):                16
[kris@polly gps]$ git rev-parse HEAD
da7569e414959d639654919aaf67259c3add73f4
[kris@polly gps]$ go test -race ./...
==================
WARNING: DATA RACE
Read at 0x00c4202ee0a0 by goroutine 15:
  github.com/sdboyer/gps.(*monitoredCmd).run()
      /home/kris/go/src/github.com/sdboyer/gps/cmd.go:65 +0x44f
  github.com/sdboyer/gps.TestMonitoredCmd.func1()
      /home/kris/go/src/github.com/sdboyer/gps/cmd_test.go:63 +0x5e

Previous write at 0x00c4202ee0a0 by goroutine 16:
  os/exec.(*Cmd).Start()
      /usr/local/go/src/os/exec/exec.go:354 +0x78c
  os/exec.(*Cmd).Run()
      /usr/local/go/src/os/exec/exec.go:277 +0x3c
  github.com/sdboyer/gps.(*monitoredCmd).run.func1()
      /home/kris/go/src/github.com/sdboyer/gps/cmd.go:47 +0x50

Goroutine 15 (running) created at:
  github.com/sdboyer/gps.TestMonitoredCmd()
      /home/kris/go/src/github.com/sdboyer/gps/cmd_test.go:64 +0x915
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:657 +0x107

Goroutine 16 (running) created at:
  github.com/sdboyer/gps.(*monitoredCmd).run()
      /home/kris/go/src/github.com/sdboyer/gps/cmd.go:47 +0x13a
  github.com/sdboyer/gps.TestMonitoredCmd.func1()
      /home/kris/go/src/github.com/sdboyer/gps/cmd_test.go:63 +0x5e
==================
==================
WARNING: DATA RACE
Read at 0x00c4202b8270 by goroutine 15:
  os.(*Process).signal()
      /usr/local/go/src/os/exec_unix.go:56 +0x51
  os.(*Process).Signal()
      /usr/local/go/src/os/exec.go:121 +0x4c
  os.(*Process).kill()
      /usr/local/go/src/os/exec_posix.go:53 +0x64
  os.(*Process).Kill()
      /usr/local/go/src/os/exec.go:106 +0x38
  github.com/sdboyer/gps.(*monitoredCmd).run()
      /home/kris/go/src/github.com/sdboyer/gps/cmd.go:66 +0x4f7
  github.com/sdboyer/gps.TestMonitoredCmd.func1()
      /home/kris/go/src/github.com/sdboyer/gps/cmd_test.go:63 +0x5e

Previous write at 0x00c4202b8270 by goroutine 16:
  os.newProcess()
      /usr/local/go/src/os/exec.go:24 +0x5d
  os.startProcess()
      /usr/local/go/src/os/exec_posix.go:49 +0x52c
  os.StartProcess()
      /usr/local/go/src/os/exec.go:94 +0x7a
  os/exec.(*Cmd).Start()
      /usr/local/go/src/os/exec/exec.go:359 +0x751
  os/exec.(*Cmd).Run()
      /usr/local/go/src/os/exec/exec.go:277 +0x3c
  github.com/sdboyer/gps.(*monitoredCmd).run.func1()
      /home/kris/go/src/github.com/sdboyer/gps/cmd.go:47 +0x50

Goroutine 15 (running) created at:
  github.com/sdboyer/gps.TestMonitoredCmd()
      /home/kris/go/src/github.com/sdboyer/gps/cmd_test.go:64 +0x915
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:657 +0x107

Goroutine 16 (running) created at:
  github.com/sdboyer/gps.(*monitoredCmd).run()
      /home/kris/go/src/github.com/sdboyer/gps/cmd.go:47 +0x13a
  github.com/sdboyer/gps.TestMonitoredCmd.func1()
      /home/kris/go/src/github.com/sdboyer/gps/cmd_test.go:63 +0x5e
==================
==================
WARNING: DATA RACE
Read at 0x00c4202b8280 by goroutine 15:
  sync/atomic.LoadInt32()
      /usr/local/go/src/runtime/race_amd64.s:206 +0xb
  os.(*Process).done()
      /usr/local/go/src/os/exec.go:34 +0x3e
  os.(*Process).signal()
      /usr/local/go/src/os/exec_unix.go:64 +0x1dc
  os.(*Process).Signal()
      /usr/local/go/src/os/exec.go:121 +0x4c
  os.(*Process).kill()
      /usr/local/go/src/os/exec_posix.go:53 +0x64
  os.(*Process).Kill()
      /usr/local/go/src/os/exec.go:106 +0x38
  github.com/sdboyer/gps.(*monitoredCmd).run()
      /home/kris/go/src/github.com/sdboyer/gps/cmd.go:66 +0x4f7
  github.com/sdboyer/gps.TestMonitoredCmd.func1()
      /home/kris/go/src/github.com/sdboyer/gps/cmd_test.go:63 +0x5e

Previous write at 0x00c4202b8280 by goroutine 16:
  os.newProcess()
      /usr/local/go/src/os/exec.go:24 +0x5d
  os.startProcess()
      /usr/local/go/src/os/exec_posix.go:49 +0x52c
  os.StartProcess()
      /usr/local/go/src/os/exec.go:94 +0x7a
  os/exec.(*Cmd).Start()
      /usr/local/go/src/os/exec/exec.go:359 +0x751
  os/exec.(*Cmd).Run()
      /usr/local/go/src/os/exec/exec.go:277 +0x3c
  github.com/sdboyer/gps.(*monitoredCmd).run.func1()
      /home/kris/go/src/github.com/sdboyer/gps/cmd.go:47 +0x50

Goroutine 15 (running) created at:
  github.com/sdboyer/gps.TestMonitoredCmd()
      /home/kris/go/src/github.com/sdboyer/gps/cmd_test.go:64 +0x915
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:657 +0x107

Goroutine 16 (running) created at:
  github.com/sdboyer/gps.(*monitoredCmd).run()
      /home/kris/go/src/github.com/sdboyer/gps/cmd.go:47 +0x13a
  github.com/sdboyer/gps.TestMonitoredCmd.func1()
      /home/kris/go/src/github.com/sdboyer/gps/cmd_test.go:63 +0x5e
==================
--- FAIL: TestMonitoredCmd (1.98s)
	testing.go:610: race detected during execution of test
--- FAIL: TestGetSources (0.00s)
	vcs_source_test.go:513: hg is not installed
--- FAIL: TestSlowVcs (0.00s)
    --- FAIL: TestSlowVcs/write-deptree (0.00s)
    	vcs_source_test.go:513: hg is not installed
    --- FAIL: TestSlowVcs/svn-repo (0.01s)
    	vcs_repo_test.go:66: svn is not installed
    --- FAIL: TestSlowVcs/hg-repo (0.00s)
    	vcs_repo_test.go:160: hg is not installed
    --- FAIL: TestSlowVcs/bzr-source (0.02s)
    	vcs_source_test.go:513: bzr is not installed
    --- FAIL: TestSlowVcs/bzr-repo (0.01s)
    	vcs_repo_test.go:297: bzr is not installed
    --- FAIL: TestSlowVcs/hg-source (0.01s)
    	vcs_source_test.go:513: hg is not installed
FAIL
FAIL	github.com/sdboyer/gps	13.300s
ok  	github.com/sdboyer/gps/internal	1.008s
ok  	github.com/sdboyer/gps/internal/fs	1.007s
ok  	github.com/sdboyer/gps/pkgtree	1.032s
ok  	github.com/sdboyer/gps/vendor/github.com/Masterminds/semver	1.035s
--- FAIL: TestBzr (0.00s)
	bzr_test.go:34: bzr is not installed
--- FAIL: TestBzrCheckLocal (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x797d54]

goroutine 3 [running]:
testing.tRunner.func1(0xc420164000)
	/usr/local/go/src/testing/testing.go:622 +0x55f
panic(0x81d740, 0xa36ea0)
	/usr/local/go/src/runtime/panic.go:489 +0x2f0
github.com/sdboyer/gps/vendor/github.com/Masterminds/vcs.(*BzrRepo).CheckLocal(0x0, 0x0)
	/home/kris/go/src/github.com/sdboyer/gps/vendor/github.com/Masterminds/vcs/bzr.go:199 +0x34
github.com/sdboyer/gps/vendor/github.com/Masterminds/vcs.TestBzrCheckLocal(0xc420164000)
	/home/kris/go/src/github.com/sdboyer/gps/vendor/github.com/Masterminds/vcs/bzr_test.go:253 +0x1a9
testing.tRunner(0xc420164000, 0x885ea8)
	/usr/local/go/src/testing/testing.go:657 +0x108
created by testing.(*T).Run
	/usr/local/go/src/testing/testing.go:697 +0x544
FAIL	github.com/sdboyer/gps/vendor/github.com/Masterminds/vcs	0.013s
ok  	github.com/sdboyer/gps/vendor/github.com/armon/go-radix	1.034s
ok  	github.com/sdboyer/gps/vendor/github.com/sdboyer/constext	2.015s
[kris@polly gps]$ 

@sdboyer
Copy link
Member

sdboyer commented Apr 29, 2017

OK, latest gps should be fixed for the race conditions now. (everything else was failures due to vcs binaries not being installed). PR should be able to go ahead.

@sdboyer sdboyer closed this as completed Apr 29, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants