diff options
| author | Paul E. Murphy <murp@ibm.com> | 2021-12-09 16:09:24 -0600 |
|---|---|---|
| committer | Paul Murphy <murp@ibm.com> | 2022-03-29 22:06:31 +0000 |
| commit | dac0220841a44815584c83d26e9f9a45f5560f6d (patch) | |
| tree | 8511dc4a098695fa490beda07c1c0f08a7f019b9 /src/runtime/runtime-gdb_test.go | |
| parent | a4a0f9b1481e9be4361eb9c4998eca08e2eedb0a (diff) | |
| download | go-dac0220841a44815584c83d26e9f9a45f5560f6d.tar.xz | |
runtime: avoid potential hang in TestGdbAutotmpTypes
If a GC related task preempts between hitting the main.main breakpoint
and stepping, the test program may halt forever waiting on a GC
operation. This happens if gdb is configured to halt other threads
while executing a step.
Configure gdb to continue running all threads during a step by
setting the scheduler-locking option to off.
Fixes #49852
Change-Id: Iacc9732cbd23526bde0a295e6fa8a0d90f733f59
Reviewed-on: https://go-review.googlesource.com/c/go/+/370775
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Paul Murphy <murp@ibm.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Trust: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/runtime/runtime-gdb_test.go')
| -rw-r--r-- | src/runtime/runtime-gdb_test.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/runtime/runtime-gdb_test.go b/src/runtime/runtime-gdb_test.go index bb76116ee9..063b9a7d45 100644 --- a/src/runtime/runtime-gdb_test.go +++ b/src/runtime/runtime-gdb_test.go @@ -500,6 +500,10 @@ func TestGdbAutotmpTypes(t *testing.T) { args := []string{"-nx", "-batch", "-iex", "add-auto-load-safe-path " + filepath.Join(testenv.GOROOT(t), "src", "runtime"), "-ex", "set startup-with-shell off", + // Some gdb may set scheduling-locking as "step" by default. This prevents background tasks + // (e.g GC) from completing which may result in a hang when executing the step command. + // See #49852. + "-ex", "set scheduler-locking off", "-ex", "break main.main", "-ex", "run", "-ex", "step", |
