Skip to content
Snippets Groups Projects
Commit 3672a09a authored by Felix Geisendörfer's avatar Felix Geisendörfer Committed by Alan Donovan
Browse files

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: default avatarAlan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: default avatarMichael Knyszek <mknyszek@google.com>
parent 3452d80d
No related branches found
No related tags found
No related merge requests found
...@@ -84,7 +84,10 @@ func monitor() { ...@@ -84,7 +84,10 @@ func monitor() {
log.Fatal(err) log.Fatal(err)
} }
cmd := exec.Command(exe, "-test.run=^ExampleSetCrashOutput_monitor$") 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.Stderr = os.Stderr
cmd.Stdout = os.Stderr cmd.Stdout = os.Stderr
pipe, err := cmd.StdinPipe() pipe, err := cmd.StdinPipe()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment