Commit 05aa4a7b authored by Ian Lance Taylor's avatar Ian Lance Taylor

runtime: set GODEBUG=asyncpreemptoff=1 in TestCrashDumpsAllThreads

Fixes #35356

Change-Id: I67b9e57b88d00ed98cbc3aa0aeb26b5f2d75a3f7
Reviewed-on: https://go-review.googlesource.com/c/go/+/205720
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
parent ee2268c6
......@@ -15,7 +15,6 @@ import (
"os/exec"
"path/filepath"
"runtime"
"strings"
"sync"
"syscall"
"testing"
......@@ -99,18 +98,17 @@ func TestCrashDumpsAllThreads(t *testing.T) {
cmd = exec.Command(filepath.Join(dir, "a.exe"))
cmd = testenv.CleanCmdEnv(cmd)
cmd.Env = append(cmd.Env, "GOTRACEBACK=crash")
// Set GOGC=off. Because of golang.org/issue/10958, the tight
// loops in the test program are not preemptible. If GC kicks
// in, it may lock up and prevent main from saying it's ready.
newEnv := []string{}
for _, s := range cmd.Env {
if !strings.HasPrefix(s, "GOGC=") {
newEnv = append(newEnv, s)
}
}
cmd.Env = append(newEnv, "GOGC=off")
cmd.Env = append(cmd.Env,
"GOTRACEBACK=crash",
// Set GOGC=off. Because of golang.org/issue/10958, the tight
// loops in the test program are not preemptible. If GC kicks
// in, it may lock up and prevent main from saying it's ready.
"GOGC=off",
// Set GODEBUG=asyncpreemptoff=1. If a thread is preempted
// when it receives SIGQUIT, it won't show the expected
// stack trace. See issue 35356.
"GODEBUG=asyncpreemptoff=1",
)
var outbuf bytes.Buffer
cmd.Stdout = &outbuf
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment