Skip to content

Conversation

@pohly
Copy link
Contributor

@pohly pohly commented Dec 5, 2025

Write at 0x00c000368528 by goroutine 25:
  os/exec.(*Cmd).Wait()
      os/exec/exec.go:926 +0x1a4
  github.com/onsi/ginkgo/v2/ginkgo/internal.runParallel.func2()
      github.com/onsi/ginkgo/v2@v2.27.2/ginkgo/internal/run.go:231 +0x37

Previous read at 0x00c000368528 by goroutine 96714:
  github.com/onsi/ginkgo/v2/ginkgo/internal.runParallel.func1()
      github.com/onsi/ginkgo/v2@v2.27.2/ginkgo/internal/run.go:228 +0x3b
  github.com/onsi/ginkgo/v2/internal/parallel_support.(*ServerHandler).procIsAlive()
      github.com/onsi/ginkgo/v2@v2.27.2/internal/parallel_support/server_handler.go:133 +0x121

The problem is that cmd.ProcessState is not thread-safe. The solution is an atomic bool which gets checked instead and which is written once when the goroutine waiting for the command has determined that the command has exited.

    Write at 0x00c000368528 by goroutine 25:
      os/exec.(*Cmd).Wait()
          os/exec/exec.go:926 +0x1a4
      github.com/onsi/ginkgo/v2/ginkgo/internal.runParallel.func2()
          github.com/onsi/ginkgo/v2@v2.27.2/ginkgo/internal/run.go:231 +0x37

    Previous read at 0x00c000368528 by goroutine 96714:
      github.com/onsi/ginkgo/v2/ginkgo/internal.runParallel.func1()
          github.com/onsi/ginkgo/v2@v2.27.2/ginkgo/internal/run.go:228 +0x3b
      github.com/onsi/ginkgo/v2/internal/parallel_support.(*ServerHandler).procIsAlive()
          github.com/onsi/ginkgo/v2@v2.27.2/internal/parallel_support/server_handler.go:133 +0x121

The problem is that cmd.ProcessState is not thread-safe. The solution is an
atomic bool which gets checked instead and which is written once when the
goroutine waiting for the command has determined that the command has exited.
@onsi
Copy link
Owner

onsi commented Dec 8, 2025

perfect, thanks!

@onsi onsi merged commit ece19c8 into onsi:master Dec 8, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants