aboutsummaryrefslogtreecommitdiff
path: root/src/os/exec/exec.go
diff options
context:
space:
mode:
authorJunyang Shao <shaojunyang@google.com>2026-01-07 20:06:48 +0000
committerJunyang Shao <shaojunyang@google.com>2026-01-07 20:06:49 +0000
commitb8191a2f9893220bdbe52ecebb37e293847d98f5 (patch)
treeffaec06811834d36737d182a65831d65cd8ce798 /src/os/exec/exec.go
parentc599a8f2385849a225d02843b3c6389dbfc5aa69 (diff)
parentf6ebd91129e13ef7f495550a4fc8fa74769f6a2d (diff)
downloadgo-b8191a2f9893220bdbe52ecebb37e293847d98f5.tar.xz
[release-branch.go1.26] all: merge master (f6ebd91) into release-branch.go1.26
Merge List: + 2026-01-07 f6ebd91129 all: update vendored x/tools + 2026-01-06 d1d0fc7a97 os/exec: avoid atomic.Bool for Cmd.startCalled + 2026-01-05 9b2e3b9a02 simd/archsimd: use V(P)MOVMSK for mask ToBits if possible + 2026-01-02 f8ee0f8475 cmd/go/testdata/vcstest/git: use git commands that work on older git versions + 2026-01-02 b094749bad test/codegen: codify bit related code generation for arm64 + 2026-01-02 e84983fa40 cmd/compile: optimize SIMD IsNaN.Or(IsNaN) + 2026-01-02 8244b85677 simd/archsimd: add tests for IsNaN + 2026-01-02 13440fb518 simd/archsimd: make IsNaN unary + 2026-01-02 c3550b3352 simd/archsimd: correct documentation of Mask types + 2026-01-02 34ad26341d net/rpc: correct comment for isExportedOrBuiltinType function + 2025-12-30 b28808d838 cmd/go/internal/modindex: fix obvious bug using failed type assertion + 2025-12-30 d64add4d60 simd/archsimd: adjust documentations slightly + 2025-12-30 1843cfbcd6 runtime/secret: make tests more sturdy + 2025-12-30 fd45d70799 all: fix some minor grammatical issues in the comments + 2025-12-30 df4e08ac65 test/codegen: fix a tab in comparisons.go to ensure pattern works + 2025-12-30 cd668d744f cmd/compile: disable inlining for functions using runtime.deferrangefunc + 2025-12-29 06eff0f7c3 simd/archsimd: add tests for Saturate-Concat operations + 2025-12-29 110aaf7137 simd/archsimd: add tests for Saturate operations + 2025-12-29 22e7b94e7f simd/archsimd: add tests for ExtendLo operations + 2025-12-29 76dddce293 simd/archsimd: remove redundant suffix of ExtendLo operations + 2025-12-29 6ecdd2fc6e simd/archsimd: add more tests for Convert operations + 2025-12-29 e0c99fe285 simd/archsimd: add more tests for Truncate operations + 2025-12-29 08369369e5 reflect: document Call/CallSlice panic when v is unexported field + 2025-12-29 ca8effbde1 internal/coverage/decodemeta: correct wording in unknown version error + 2025-12-29 0b06b68e21 encoding/gob: clarify docs about pointers to zero values not being sent + 2025-12-29 9cb3edbfe9 regexp: standardize error message format in find_test.go + 2025-12-29 b3ed0627ce tests: improve consistency and clarity of test diagnostics + 2025-12-29 3dcb48d298 test: follow got/want convention in uintptrescapes test + 2025-12-29 f7b7e94b0a test: clarify log message for surrogate UTF-8 check + 2025-12-29 e790d59674 simd/archsimd: add tests for Truncate operations + 2025-12-27 f4cec7917c cmd: fix unused errors reported by ineffassign + 2025-12-27 ca13fe02c4 simd/archsimd: add more tests for Convert operations + 2025-12-27 037c047f2c simd/archsimd: add more tests for Extend operations + 2025-12-26 7971fcdf53 test/codegen: tidy tests for bits + 2025-12-24 0f620776d7 simd/archsimd: fix "go generate" command + 2025-12-24 a5fe8c07ae simd/archsimd: guard test helpers with amd64 tag + 2025-12-23 a23d1a4ebe bytes: improve consistency in split test messages + 2025-12-23 866e461b96 cmd/go: update pkgsite doc command to v0.0.0-20251223195805-1a3bd3c788fe + 2025-12-23 08dc8393d7 time: skip test that will fail with GO111MODULE=off + 2025-12-23 43ebed88cc runtime: improve a log message in TestCleanupLost + 2025-12-23 81283ad339 runtime: fix nGsyscallNoP accounting + 2025-12-23 3e0e1667f6 test/codegen: codify bit related code generation for riscv64 + 2025-12-23 3faf988f21 errors: add a test verifying join does not flatten errors + 2025-12-23 2485a0bc2c cmd/asm/internal/asm: run riscv64 end-to-end tests for each profile + 2025-12-23 8254d66eab cmd/asm/internal/asm: abort end to end test if assembly failed + 2025-12-23 1b3db48db7 Revert "errors: optimize errors.Join for single unwrappable errors" + 2025-12-23 b6b8b2fe6e cmd/compile: handle propagating an out-of-range jump table index + 2025-12-22 2cd0371a0a debug/pe: avoid panic in File.ImportedSymbols + 2025-12-22 91435be153 runtime: revert entry point on freebsd/arm64 + 2025-12-22 c1efada1d2 simd/archsimd: correct documentation for pairwise operations + 2025-12-22 3d77a0b15e os/exec: second call to Cmd.Start is always an error + 2025-12-20 7ecb1f36ac simd/archsimd: add HasAVX2() guards to tests that need them + 2025-12-19 70c22e0ad7 simd/archsimd: delete DotProductQuadruple methods for now + 2025-12-19 42cda7c1df simd/archsimd: add Grouped for 256- and 512-bit SaturateTo(U)Int16Concat, and fix type + 2025-12-19 baa0ae3aaa simd/archsimd: correct type and instruction for SaturateToUint8 + 2025-12-19 d46c58debb go/doc: link to struct fields in the same package + 2025-12-19 25ed6c7f9b cmd/go/internal/doc: update pkgsite version + 2025-12-19 4411edf972 simd/archsimd: reword documentation for some operations + 2025-12-19 7d9418a19c simd/archsimd: reword documentation of comparison operations + 2025-12-18 d00e96d3ae internal/cpu: repair VNNI feature check + 2025-12-18 cfc024daeb simd/archsimd: reword documentation for conversion ops + 2025-12-17 ad91f5d241 simd/archsimd: reword documentation of shfit operations + 2025-12-17 b8c4cc63e7 runtime: keep track of secret allocation size + 2025-12-17 8564fede89 cmd/go: remove reference to no longer existing -i flag + 2025-12-17 eecdb61eeb crypto: rename fips140v2.0 to fips140v1.26 + 2025-12-17 05e41225f6 simd/archsimd: reword documentation of As methods + 2025-12-17 516699848b runtime/secret: warn users about allocations, loosen guarantees + 2025-12-16 8c28ab936a cmd/cgo: don't emit C local if it is not used + 2025-12-16 65b71c11d4 crypto/internal/fips140only: test fips140=only mode + 2025-12-16 ea1aa76554 go/doc: exclude examples with results + 2025-12-16 5046bdf8a6 crypto/tls: reject trailing messages after client/server hello + 2025-12-16 3f6eabdf09 cmd/compile: use unsigned constant when folding loads for SIMD ops with constants + 2025-12-16 a4b5b92055 cmd/dist: preserve existing GOEXPERIMENTs when running tests with additional experiments Change-Id: I84ad4ceba344761142b98587c07d186cf2d638ff
Diffstat (limited to 'src/os/exec/exec.go')
-rw-r--r--src/os/exec/exec.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/os/exec/exec.go b/src/os/exec/exec.go
index e84ebfc453..aa7a6be7f0 100644
--- a/src/os/exec/exec.go
+++ b/src/os/exec/exec.go
@@ -102,6 +102,7 @@ import (
"runtime"
"strconv"
"strings"
+ "sync/atomic"
"syscall"
"time"
)
@@ -354,6 +355,11 @@ type Cmd struct {
// the work of resolving the extension, so Start doesn't need to do it again.
// This is only used on Windows.
cachedLookExtensions struct{ in, out string }
+
+ // startCalled records that Start was attempted, regardless of outcome.
+ // (Until go.dev/issue/77075 is resolved, we use atomic.SwapInt32,
+ // not atomic.Bool.Swap, to avoid triggering the copylocks vet check.)
+ startCalled int32
}
// A ctxResult reports the result of watching the Context associated with a
@@ -635,7 +641,8 @@ func (c *Cmd) Run() error {
func (c *Cmd) Start() error {
// Check for doubled Start calls before we defer failure cleanup. If the prior
// call to Start succeeded, we don't want to spuriously close its pipes.
- if c.Process != nil {
+ // It is an error to call Start twice even if the first call did not create a process.
+ if atomic.SwapInt32(&c.startCalled, 1) != 0 {
return errors.New("exec: already started")
}
@@ -647,6 +654,7 @@ func (c *Cmd) Start() error {
if !started {
closeDescriptors(c.parentIOPipes)
c.parentIOPipes = nil
+ c.goroutine = nil // aid GC, finalization of pipe fds
}
}()