mirror of
https://github.com/golang/go.git
synced 2025-05-05 07:33:00 +00:00
runtime/debug: update SetCrashOutput example to not pass parent env vars
Fixes #73490 Change-Id: I500fa73f4215c7f490779f53c1c2c0d775f51a95 Reviewed-on: https://go-review.googlesource.com/c/go/+/667775 Reviewed-by: Alan Donovan <adonovan@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
This commit is contained in:
parent
3452d80da3
commit
3672a09a48
@ -84,7 +84,10 @@ func monitor() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
cmd := exec.Command(exe, "-test.run=^ExampleSetCrashOutput_monitor$")
|
||||
cmd.Env = append(os.Environ(), monitorVar+"=1")
|
||||
// Be selective in which variables we allow the child to inherit.
|
||||
// Depending on the application, some may be necessary,
|
||||
// while others (e.g. GOGC, GOMEMLIMIT) may be harmful; see #73490.
|
||||
cmd.Env = []string{monitorVar + "=1"}
|
||||
cmd.Stderr = os.Stderr
|
||||
cmd.Stdout = os.Stderr
|
||||
pipe, err := cmd.StdinPipe()
|
||||
|
Loading…
x
Reference in New Issue
Block a user