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

data race in process.VirtualizationWithContext() #1022

Closed
1 task done
zeisss opened this issue Jan 18, 2021 · 3 comments
Closed
1 task done

data race in process.VirtualizationWithContext() #1022

zeisss opened this issue Jan 18, 2021 · 3 comments

Comments

@zeisss
Copy link

zeisss commented Jan 18, 2021

Describe the bug

Our weekly execution (via github actions) of our unit tests reports multiple data races last night. Executed via go test -mod=readonly -race ./.... I copied the report part to the end of the issue.

The relevant code mainly calls two functions to find child processes of a forked process:

       import "github.com/shirou/gopsutil/process" // v2.20.9
       // ...
	self, err := process.NewProcess(int32(os.Getpid()))
	require.NoError(t, err)

	exe, err := self.Exe()
	require.NoError(t, err)

	processList, err := process.Processes()
	require.NoError(t, err)
	
	// use processList and exe to find the first child process

Due to go test this snippet will be executed multiple times in parallel.

To Reproduce

I failed to reproduce this - running the tests again locally (Mac os) and on github actions did not fail again.
We have this snippet for some time in the code base already and so far it didn't fail.

Expected behavior
go test -race should not report a data race

Environment (please complete the following information):

  • Linux: [paste contents of /etc/os-release and the result of uname -a]

DATA RACE OUTPUT

==================
WARNING: DATA RACE
Read at 0x00000249aca8 by goroutine 60:
  github.com/shirou/gopsutil/internal/common.VirtualizationWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/internal/common/common_linux.go:117 +0x54
  github.com/shirou/gopsutil/internal/common.Virtualization()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/internal/common/common_linux.go:110 +0x71
  github.com/shirou/gopsutil/internal/common.BootTimeWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/internal/common/common_linux.go:58 +0x45
  github.com/shirou/gopsutil/process.(*Process).fillFromTIDStatWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:1194 +0x65c
  github.com/shirou/gopsutil/process.(*Process).fillFromStatWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:1245 +0x77
  github.com/shirou/gopsutil/process.(*Process).createTimeWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:134 +0x59
  github.com/shirou/gopsutil/process.(*Process).CreateTimeWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process.go:259 +0xbd
  github.com/shirou/gopsutil/process.(*Process).CreateTime()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process.go:252 +0x12e
  github.com/shirou/gopsutil/process.NewProcess()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process.go:167 +0xf8
  github.com/shirou/gopsutil/process.ProcessesWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:1267 +0x104
  github.com/shirou/gopsutil/process.Processes()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:1255 +0x26a
  github.com/stormforger/<reponame>/cmd/server/testsuite.signalWorkerProcess()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/cluster_helper.go:311 +0x23e
  github.com/stormforger/<reponame>/cmd/server/testsuite.testRunWithWorkerKill()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/worker_crash_test.go:52 +0x50e
  github.com/stormforger/<reponame>/cmd/server/testsuite.testRunBuilder.Run.func2()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/cluster_helper.go:61 +0x16e
  testing.tRunner()
      /opt/hostedtoolcache/go/1.15.6/x64/src/testing/testing.go:1123 +0x202

Previous write at 0x00000249aca8 by goroutine 146:
  github.com/shirou/gopsutil/internal/common.VirtualizationWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/internal/common/common_linux.go:243 +0x955
  github.com/shirou/gopsutil/internal/common.Virtualization()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/internal/common/common_linux.go:110 +0x71
  github.com/shirou/gopsutil/internal/common.BootTimeWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/internal/common/common_linux.go:58 +0x45
  github.com/shirou/gopsutil/process.(*Process).fillFromTIDStatWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:1194 +0x65c
  github.com/shirou/gopsutil/process.(*Process).fillFromStatWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:1245 +0x77
  github.com/shirou/gopsutil/process.(*Process).createTimeWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:134 +0x59
  github.com/shirou/gopsutil/process.(*Process).CreateTimeWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process.go:259 +0xbd
  github.com/shirou/gopsutil/process.(*Process).CreateTime()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process.go:252 +0x12e
  github.com/shirou/gopsutil/process.NewProcess()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process.go:167 +0xf8
  github.com/stormforger/<reponame>/cmd/server/testsuite.signalWorkerProcess()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/cluster_helper.go:303 +0x84
  github.com/stormforger/<reponame>/cmd/server/testsuite.testRunWithWorkerKill()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/worker_crash_test.go:52 +0x50e
  github.com/stormforger/<reponame>/cmd/server/testsuite.testRunBuilder.Run.func1()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/cluster_helper.go:51 +0x16e
  testing.tRunner()
      /opt/hostedtoolcache/go/1.15.6/x64/src/testing/testing.go:1123 +0x202

Goroutine 60 (running) created at:
  testing.(*T).Run()
      /opt/hostedtoolcache/go/1.15.6/x64/src/testing/testing.go:1168 +0x5bb
  github.com/stormforger/<reponame>/cmd/server/testsuite.testRunBuilder.Run()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/cluster_helper.go:55 +0x244
  github.com/stormforger/<reponame>/cmd/server/testsuite.TestWorkerCrashes()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/worker_crash_test.go:21 +0x64
  testing.tRunner()
      /opt/hostedtoolcache/go/1.15.6/x64/src/testing/testing.go:1123 +0x202

Goroutine 146 (running) created at:
  testing.(*T).Run()
      /opt/hostedtoolcache/go/1.15.6/x64/src/testing/testing.go:1168 +0x5bb
  github.com/stormforger/<reponame>/cmd/server/testsuite.testRunBuilder.Run()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/cluster_helper.go:45 +0x164
  github.com/stormforger/<reponame>/cmd/server/testsuite.TestWorkerCrashes()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/worker_crash_test.go:21 +0x64
  testing.tRunner()
      /opt/hostedtoolcache/go/1.15.6/x64/src/testing/testing.go:1123 +0x202
==================
==================
WARNING: DATA RACE
Read at 0x00c00030bd40 by goroutine 60:
  runtime.mapaccess1_faststr()
      /opt/hostedtoolcache/go/1.15.6/x64/src/runtime/map_faststr.go:12 +0x0
  github.com/shirou/gopsutil/internal/common.VirtualizationWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/internal/common/common_linux.go:118 +0x178f
  github.com/shirou/gopsutil/internal/common.Virtualization()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/internal/common/common_linux.go:110 +0x71
  github.com/shirou/gopsutil/internal/common.BootTimeWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/internal/common/common_linux.go:58 +0x45
  github.com/shirou/gopsutil/process.(*Process).fillFromTIDStatWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:1194 +0x65c
  github.com/shirou/gopsutil/process.(*Process).fillFromStatWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:1245 +0x77
  github.com/shirou/gopsutil/process.(*Process).createTimeWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:134 +0x59
  github.com/shirou/gopsutil/process.(*Process).CreateTimeWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process.go:259 +0xbd
  github.com/shirou/gopsutil/process.(*Process).CreateTime()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process.go:252 +0x12e
  github.com/shirou/gopsutil/process.NewProcess()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process.go:167 +0xf8
  github.com/shirou/gopsutil/process.ProcessesWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:1267 +0x104
  github.com/shirou/gopsutil/process.Processes()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:1255 +0x26a
  github.com/stormforger/<reponame>/cmd/server/testsuite.signalWorkerProcess()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/cluster_helper.go:311 +0x23e
  github.com/stormforger/<reponame>/cmd/server/testsuite.testRunWithWorkerKill()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/worker_crash_test.go:52 +0x50e
  github.com/stormforger/<reponame>/cmd/server/testsuite.testRunBuilder.Run.func2()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/cluster_helper.go:61 +0x16e
  testing.tRunner()
      /opt/hostedtoolcache/go/1.15.6/x64/src/testing/testing.go:1123 +0x202

Previous write at 0x00c00030bd40 by goroutine 146:
  runtime.mapassign_faststr()
      /opt/hostedtoolcache/go/1.15.6/x64/src/runtime/map_faststr.go:202 +0x0
  github.com/shirou/gopsutil/internal/common.VirtualizationWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/internal/common/common_linux.go:243 +0x88a
  github.com/shirou/gopsutil/internal/common.Virtualization()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/internal/common/common_linux.go:110 +0x71
  github.com/shirou/gopsutil/internal/common.BootTimeWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/internal/common/common_linux.go:58 +0x45
  github.com/shirou/gopsutil/process.(*Process).fillFromTIDStatWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:1194 +0x65c
  github.com/shirou/gopsutil/process.(*Process).fillFromStatWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:1245 +0x77
  github.com/shirou/gopsutil/process.(*Process).createTimeWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:134 +0x59
  github.com/shirou/gopsutil/process.(*Process).CreateTimeWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process.go:259 +0xbd
  github.com/shirou/gopsutil/process.(*Process).CreateTime()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process.go:252 +0x12e
  github.com/shirou/gopsutil/process.NewProcess()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process.go:167 +0xf8
  github.com/stormforger/<reponame>/cmd/server/testsuite.signalWorkerProcess()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/cluster_helper.go:303 +0x84
  github.com/stormforger/<reponame>/cmd/server/testsuite.testRunWithWorkerKill()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/worker_crash_test.go:52 +0x50e
  github.com/stormforger/<reponame>/cmd/server/testsuite.testRunBuilder.Run.func1()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/cluster_helper.go:51 +0x16e
  testing.tRunner()
      /opt/hostedtoolcache/go/1.15.6/x64/src/testing/testing.go:1123 +0x202

Goroutine 60 (running) created at:
  testing.(*T).Run()
      /opt/hostedtoolcache/go/1.15.6/x64/src/testing/testing.go:1168 +0x5bb
  github.com/stormforger/<reponame>/cmd/server/testsuite.testRunBuilder.Run()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/cluster_helper.go:55 +0x244
  github.com/stormforger/<reponame>/cmd/server/testsuite.TestWorkerCrashes()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/worker_crash_test.go:21 +0x64
  testing.tRunner()
      /opt/hostedtoolcache/go/1.15.6/x64/src/testing/testing.go:1123 +0x202

Goroutine 146 (running) created at:
  testing.(*T).Run()
      /opt/hostedtoolcache/go/1.15.6/x64/src/testing/testing.go:1168 +0x5bb
  github.com/stormforger/<reponame>/cmd/server/testsuite.testRunBuilder.Run()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/cluster_helper.go:45 +0x164
  github.com/stormforger/<reponame>/cmd/server/testsuite.TestWorkerCrashes()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/worker_crash_test.go:21 +0x64
  testing.tRunner()
      /opt/hostedtoolcache/go/1.15.6/x64/src/testing/testing.go:1123 +0x202
==================
==================
WARNING: DATA RACE
Read at 0x00c000437828 by goroutine 60:
  github.com/shirou/gopsutil/internal/common.VirtualizationWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/internal/common/common_linux.go:118 +0x17a5
  github.com/shirou/gopsutil/internal/common.Virtualization()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/internal/common/common_linux.go:110 +0x71
  github.com/shirou/gopsutil/internal/common.BootTimeWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/internal/common/common_linux.go:58 +0x45
  github.com/shirou/gopsutil/process.(*Process).fillFromTIDStatWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:1194 +0x65c
  github.com/shirou/gopsutil/process.(*Process).fillFromStatWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:1245 +0x77
  github.com/shirou/gopsutil/process.(*Process).createTimeWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:134 +0x59
  github.com/shirou/gopsutil/process.(*Process).CreateTimeWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process.go:259 +0xbd
  github.com/shirou/gopsutil/process.(*Process).CreateTime()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process.go:252 +0x12e
  github.com/shirou/gopsutil/process.NewProcess()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process.go:167 +0xf8
  github.com/shirou/gopsutil/process.ProcessesWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:1267 +0x104
  github.com/shirou/gopsutil/process.Processes()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:1255 +0x26a
  github.com/stormforger/<reponame>/cmd/server/testsuite.signalWorkerProcess()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/cluster_helper.go:311 +0x23e
  github.com/stormforger/<reponame>/cmd/server/testsuite.testRunWithWorkerKill()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/worker_crash_test.go:52 +0x50e
  github.com/stormforger/<reponame>/cmd/server/testsuite.testRunBuilder.Run.func2()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/cluster_helper.go:61 +0x16e
  testing.tRunner()
      /opt/hostedtoolcache/go/1.15.6/x64/src/testing/testing.go:1123 +0x202

Previous write at 0x00c000437828 by goroutine 146:
  github.com/shirou/gopsutil/internal/common.VirtualizationWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/internal/common/common_linux.go:243 +0x8a4
  github.com/shirou/gopsutil/internal/common.Virtualization()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/internal/common/common_linux.go:110 +0x71
  github.com/shirou/gopsutil/internal/common.BootTimeWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/internal/common/common_linux.go:58 +0x45
  github.com/shirou/gopsutil/process.(*Process).fillFromTIDStatWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:1194 +0x65c
  github.com/shirou/gopsutil/process.(*Process).fillFromStatWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:1245 +0x77
  github.com/shirou/gopsutil/process.(*Process).createTimeWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:134 +0x59
  github.com/shirou/gopsutil/process.(*Process).CreateTimeWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process.go:259 +0xbd
  github.com/shirou/gopsutil/process.(*Process).CreateTime()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process.go:252 +0x12e
  github.com/shirou/gopsutil/process.NewProcess()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process.go:167 +0xf8
  github.com/stormforger/<reponame>/cmd/server/testsuite.signalWorkerProcess()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/cluster_helper.go:303 +0x84
  github.com/stormforger/<reponame>/cmd/server/testsuite.testRunWithWorkerKill()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/worker_crash_test.go:52 +0x50e
  github.com/stormforger/<reponame>/cmd/server/testsuite.testRunBuilder.Run.func1()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/cluster_helper.go:51 +0x16e
  testing.tRunner()
      /opt/hostedtoolcache/go/1.15.6/x64/src/testing/testing.go:1123 +0x202

Goroutine 60 (running) created at:
  testing.(*T).Run()
      /opt/hostedtoolcache/go/1.15.6/x64/src/testing/testing.go:1168 +0x5bb
  github.com/stormforger/<reponame>/cmd/server/testsuite.testRunBuilder.Run()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/cluster_helper.go:55 +0x244
  github.com/stormforger/<reponame>/cmd/server/testsuite.TestWorkerCrashes()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/worker_crash_test.go:21 +0x64
  testing.tRunner()
      /opt/hostedtoolcache/go/1.15.6/x64/src/testing/testing.go:1123 +0x202

Goroutine 146 (running) created at:
  testing.(*T).Run()
      /opt/hostedtoolcache/go/1.15.6/x64/src/testing/testing.go:1168 +0x5bb
  github.com/stormforger/<reponame>/cmd/server/testsuite.testRunBuilder.Run()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/cluster_helper.go:45 +0x164
  github.com/stormforger/<reponame>/cmd/server/testsuite.TestWorkerCrashes()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/worker_crash_test.go:21 +0x64
  testing.tRunner()
      /opt/hostedtoolcache/go/1.15.6/x64/src/testing/testing.go:1123 +0x202
==================
==================
WARNING: DATA RACE
Read at 0x00c000437838 by goroutine 60:
  github.com/shirou/gopsutil/internal/common.VirtualizationWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/internal/common/common_linux.go:118 +0x181b
  github.com/shirou/gopsutil/internal/common.Virtualization()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/internal/common/common_linux.go:110 +0x71
  github.com/shirou/gopsutil/internal/common.BootTimeWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/internal/common/common_linux.go:58 +0x45
  github.com/shirou/gopsutil/process.(*Process).fillFromTIDStatWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:1194 +0x65c
  github.com/shirou/gopsutil/process.(*Process).fillFromStatWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:1245 +0x77
  github.com/shirou/gopsutil/process.(*Process).createTimeWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:134 +0x59
  github.com/shirou/gopsutil/process.(*Process).CreateTimeWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process.go:259 +0xbd
  github.com/shirou/gopsutil/process.(*Process).CreateTime()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process.go:252 +0x12e
  github.com/shirou/gopsutil/process.NewProcess()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process.go:167 +0xf8
  github.com/shirou/gopsutil/process.ProcessesWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:1267 +0x104
  github.com/shirou/gopsutil/process.Processes()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:1255 +0x26a
  github.com/stormforger/<reponame>/cmd/server/testsuite.signalWorkerProcess()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/cluster_helper.go:311 +0x23e
  github.com/stormforger/<reponame>/cmd/server/testsuite.testRunWithWorkerKill()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/worker_crash_test.go:52 +0x50e
  github.com/stormforger/<reponame>/cmd/server/testsuite.testRunBuilder.Run.func2()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/cluster_helper.go:61 +0x16e
  testing.tRunner()
      /opt/hostedtoolcache/go/1.15.6/x64/src/testing/testing.go:1123 +0x202

Previous write at 0x00c000437838 by goroutine 146:
  github.com/shirou/gopsutil/internal/common.VirtualizationWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/internal/common/common_linux.go:243 +0x91c
  github.com/shirou/gopsutil/internal/common.Virtualization()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/internal/common/common_linux.go:110 +0x71
  github.com/shirou/gopsutil/internal/common.BootTimeWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/internal/common/common_linux.go:58 +0x45
  github.com/shirou/gopsutil/process.(*Process).fillFromTIDStatWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:1194 +0x65c
  github.com/shirou/gopsutil/process.(*Process).fillFromStatWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:1245 +0x77
  github.com/shirou/gopsutil/process.(*Process).createTimeWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process_linux.go:134 +0x59
  github.com/shirou/gopsutil/process.(*Process).CreateTimeWithContext()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process.go:259 +0xbd
  github.com/shirou/gopsutil/process.(*Process).CreateTime()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process.go:252 +0x12e
  github.com/shirou/gopsutil/process.NewProcess()
      /home/runner/go/pkg/mod/github.com/shirou/[email protected]+incompatible/process/process.go:167 +0xf8
  github.com/stormforger/<reponame>/cmd/server/testsuite.signalWorkerProcess()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/cluster_helper.go:303 +0x84
  github.com/stormforger/<reponame>/cmd/server/testsuite.testRunWithWorkerKill()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/worker_crash_test.go:52 +0x50e
  github.com/stormforger/<reponame>/cmd/server/testsuite.testRunBuilder.Run.func1()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/cluster_helper.go:51 +0x16e
  testing.tRunner()
      /opt/hostedtoolcache/go/1.15.6/x64/src/testing/testing.go:1123 +0x202

Goroutine 60 (running) created at:
  testing.(*T).Run()
      /opt/hostedtoolcache/go/1.15.6/x64/src/testing/testing.go:1168 +0x5bb
  github.com/stormforger/<reponame>/cmd/server/testsuite.testRunBuilder.Run()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/cluster_helper.go:55 +0x244
  github.com/stormforger/<reponame>/cmd/server/testsuite.TestWorkerCrashes()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/worker_crash_test.go:21 +0x64
  testing.tRunner()
      /opt/hostedtoolcache/go/1.15.6/x64/src/testing/testing.go:1123 +0x202

Goroutine 146 (running) created at:
  testing.(*T).Run()
      /opt/hostedtoolcache/go/1.15.6/x64/src/testing/testing.go:1168 +0x5bb
  github.com/stormforger/<reponame>/cmd/server/testsuite.testRunBuilder.Run()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/cluster_helper.go:45 +0x164
  github.com/stormforger/<reponame>/cmd/server/testsuite.TestWorkerCrashes()
      /home/runner/work/<reponame>/<reponame>/cmd/server/testsuite/worker_crash_test.go:21 +0x64
  testing.tRunner()
      /opt/hostedtoolcache/go/1.15.6/x64/src/testing/testing.go:1123 +0x202
==================
@Lomanic
Copy link
Collaborator

Lomanic commented Jan 24, 2021

This is already fixed with #963/#951, you should update to v3.20.10+

@zeisss
Copy link
Author

zeisss commented Jan 24, 2021

Sorry for the duplicate then. no idea why dependabot hasn't picked it up yet 👍

@Lomanic
Copy link
Collaborator

Lomanic commented Jan 24, 2021

Maybe dependabot didn't suggest the upgrade because it is a major version bump in semver.

Nevertheless, we didn't break backward compatibility if you don't switch to the /v3 packages, which are now module aware (there has been some minor API changes between v2 and v3).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants