diff options
Diffstat (limited to 'libgo/go/runtime/crash_unix_test.go')
-rw-r--r-- | libgo/go/runtime/crash_unix_test.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/libgo/go/runtime/crash_unix_test.go b/libgo/go/runtime/crash_unix_test.go index 7a29c1eba79..09c25471d10 100644 --- a/libgo/go/runtime/crash_unix_test.go +++ b/libgo/go/runtime/crash_unix_test.go @@ -24,6 +24,15 @@ import ( // Send SIGQUIT to get a stack trace. var sigquit = syscall.SIGQUIT +func init() { + if runtime.Sigisblocked(int(syscall.SIGQUIT)) { + // We can't use SIGQUIT to kill subprocesses because + // it's blocked. Use SIGKILL instead. See issue + // #19196 for an example of when this happens. + sigquit = syscall.SIGKILL + } +} + func TestCrashDumpsAllThreads(t *testing.T) { switch runtime.GOOS { case "darwin", "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris": @@ -31,6 +40,10 @@ func TestCrashDumpsAllThreads(t *testing.T) { t.Skipf("skipping; not supported on %v", runtime.GOOS) } + if runtime.Sigisblocked(int(syscall.SIGQUIT)) { + t.Skip("skipping; SIGQUIT is blocked, see golang.org/issue/19196") + } + // We don't use executeTest because we need to kill the // program while it is running. @@ -165,6 +178,10 @@ func TestPanicSystemstack(t *testing.T) { t.Skip("Skipping in short mode (GOTRACEBACK=crash is slow)") } + if runtime.Sigisblocked(int(syscall.SIGQUIT)) { + t.Skip("skipping; SIGQUIT is blocked, see golang.org/issue/19196") + } + t.Parallel() cmd := exec.Command(os.Args[0], "testPanicSystemstackInternal") cmd = testEnv(cmd) @@ -251,3 +268,16 @@ func TestSignalIgnoreSIGTRAP(t *testing.T) { t.Fatalf("want %s, got %s\n", want, output) } } + +func TestSignalDuringExec(t *testing.T) { + switch runtime.GOOS { + case "darwin", "dragonfly", "freebsd", "linux", "netbsd", "openbsd": + default: + t.Skipf("skipping test on %s", runtime.GOOS) + } + output := runTestProg(t, "testprognet", "SignalDuringExec") + want := "OK\n" + if output != want { + t.Fatalf("want %s, got %s\n", want, output) + } +} |