diff options
| author | Ian Lance Taylor <iant@golang.org> | 2019-11-06 15:11:20 -0800 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2019-11-08 18:39:41 +0000 |
| commit | 0c8f6cc07c33f99b300c1337c9ccd76bf7e69910 (patch) | |
| tree | 8f778b41b71021d3d3a5ec453c2423f0fb61a879 /src/runtime/debug_test.go | |
| parent | 7714dcacbca1961543fbad0c8bc2a2afc7baaaee (diff) | |
| download | go-0c8f6cc07c33f99b300c1337c9ccd76bf7e69910.tar.xz | |
runtime: if InjectDebugCall sees "not at safe point", keep trying
Fixes #35376
Change-Id: Ib95ad336425e73cc4d412dafed0ba5e0a8130bd2
Reviewed-on: https://go-review.googlesource.com/c/go/+/205718
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/runtime/debug_test.go')
| -rw-r--r-- | src/runtime/debug_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/runtime/debug_test.go b/src/runtime/debug_test.go index f77a373d13..722e81121f 100644 --- a/src/runtime/debug_test.go +++ b/src/runtime/debug_test.go @@ -126,7 +126,7 @@ func TestDebugCall(t *testing.T) { return x + 1 } args.x = 42 - if _, err := runtime.InjectDebugCall(g, fn, &args, debugCallTKill); err != nil { + if _, err := runtime.InjectDebugCall(g, fn, &args, debugCallTKill, false); err != nil { t.Fatal(err) } if args.yRet != 43 { @@ -155,7 +155,7 @@ func TestDebugCallLarge(t *testing.T) { args.in[i] = i want[i] = i + 1 } - if _, err := runtime.InjectDebugCall(g, fn, &args, debugCallTKill); err != nil { + if _, err := runtime.InjectDebugCall(g, fn, &args, debugCallTKill, false); err != nil { t.Fatal(err) } if want != args.out { @@ -168,7 +168,7 @@ func TestDebugCallGC(t *testing.T) { defer after() // Inject a call that performs a GC. - if _, err := runtime.InjectDebugCall(g, runtime.GC, nil, debugCallTKill); err != nil { + if _, err := runtime.InjectDebugCall(g, runtime.GC, nil, debugCallTKill, false); err != nil { t.Fatal(err) } } @@ -179,7 +179,7 @@ func TestDebugCallGrowStack(t *testing.T) { // Inject a call that grows the stack. debugCallWorker checks // for stack pointer breakage. - if _, err := runtime.InjectDebugCall(g, func() { growStack(nil) }, nil, debugCallTKill); err != nil { + if _, err := runtime.InjectDebugCall(g, func() { growStack(nil) }, nil, debugCallTKill, false); err != nil { t.Fatal(err) } } @@ -215,7 +215,7 @@ func TestDebugCallUnsafePoint(t *testing.T) { runtime.Gosched() } - _, err := runtime.InjectDebugCall(g, func() {}, nil, debugCallTKill) + _, err := runtime.InjectDebugCall(g, func() {}, nil, debugCallTKill, true) if msg := "call not at safe point"; err == nil || err.Error() != msg { t.Fatalf("want %q, got %s", msg, err) } @@ -239,7 +239,7 @@ func TestDebugCallPanic(t *testing.T) { }() g := <-ready - p, err := runtime.InjectDebugCall(g, func() { panic("test") }, nil, debugCallTKill) + p, err := runtime.InjectDebugCall(g, func() { panic("test") }, nil, debugCallTKill, false) if err != nil { t.Fatal(err) } |
