Commit e45e4902 authored by David Chase's avatar David Chase

cmd/compile: attempt to deflake debug_test.go

Excluded when -short because it still runs relatively long,
but deflaked.

Removed timeouts from normal path and ensured that they were
not needed and that reference files did not change.

Use "tbreak" instead of "break" with gdb to reduce chance
of multiple hits on main.main.  (Seems not enough, but a
move in the right direction).

By default, testing ignores repeated lines that occur when
nexting.  This appears to sometimes be timing-dependent and
is the observed source of flakiness in testing so far.
Note that these can also be signs of a bug in the generated
debugging output, but it is one of the less-confusing bugs
that can occur.

By default, testing with gdb uses compilation with
inlining disabled to prevent dependence on library code
(it's a bug that library code is seen while Nexting, but
the bug is current behavior).

Also by default exclude all source files outside /testdata
to prevent accidental dependence on library code.  Note that
this is currently only applicable to dlv because (for the
debugging information we produce) gdb does not indicate a
change in the source file for inlined code.

Added flags -i and -r to make gdb testing compile with
inlining and be sensitive to repeats in the next stream.
This is for developer-testing and so we can describe these
problems in bug reports.

Updates #22206.

Change-Id: I9a30ebbc65aa0153fe77b1858cf19743bdc985e4
Reviewed-on: https://go-review.googlesource.com/69930
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarRuss Cox <rsc@golang.org>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 245e386e
This diff is collapsed.
......@@ -107,7 +107,3 @@
61: continue
59: for i, a := range hist {
68: }
src/runtime/proc.go
201: if atomic.Load(&runningPanicDefers) != 0 {
210: if atomic.Load(&panicking) != 0 {
214: exit(0)
src/cmd/compile/internal/ssa/testdata/hist.go
35: func main() {
35: func main() {
36: hist := make([]int, 10)
37: var reader io.Reader = strings.NewReader(cannedInput) //gdb-dbg=(hist/A,cannedInput/A)
$1 = []int = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
......@@ -132,8 +131,3 @@ $24 = 26
61: continue
59: for i, a := range hist {
68: }
src/runtime/proc.go
201: if atomic.Load(&runningPanicDefers) != 0 {
201: if atomic.Load(&runningPanicDefers) != 0 {
210: if atomic.Load(&panicking) != 0 {
214: exit(0)
......@@ -3,110 +3,61 @@
36: hist := make([]int, 10)
37: var reader io.Reader = strings.NewReader(cannedInput) //gdb-dbg=(hist/A,cannedInput/A)
13: "strings"
src/strings/reader.go
150: func NewReader(s string) *Reader { return &Reader{s, 0, -1} }
./testdata/hist.go
38: if len(os.Args) > 1 {
8: "bufio"
src/bufio/scan.go
84: split: ScanLines,
74: MaxScanTokenSize = 64 * 1024
./testdata/hist.go
47: for scanner.Scan() {
47: for scanner.Scan() {
src/bufio/scan.go
107: return string(s.token)
./testdata/hist.go
49: i, err := strconv.ParseInt(s, 10, 64)
50: if err != nil { //gdb-dbg=(i)
54: hist = ensure(int(i), hist)
55: hist[int(i)]++
55: hist[int(i)]++
47: for scanner.Scan() {
src/bufio/scan.go
107: return string(s.token)
./testdata/hist.go
49: i, err := strconv.ParseInt(s, 10, 64)
50: if err != nil { //gdb-dbg=(i)
54: hist = ensure(int(i), hist)
55: hist[int(i)]++
55: hist[int(i)]++
47: for scanner.Scan() {
src/bufio/scan.go
107: return string(s.token)
./testdata/hist.go
49: i, err := strconv.ParseInt(s, 10, 64)
50: if err != nil { //gdb-dbg=(i)
54: hist = ensure(int(i), hist)
55: hist[int(i)]++
55: hist[int(i)]++
47: for scanner.Scan() {
src/bufio/scan.go
107: return string(s.token)
./testdata/hist.go
49: i, err := strconv.ParseInt(s, 10, 64)
50: if err != nil { //gdb-dbg=(i)
54: hist = ensure(int(i), hist)
55: hist[int(i)]++
55: hist[int(i)]++
47: for scanner.Scan() {
src/bufio/scan.go
107: return string(s.token)
./testdata/hist.go
49: i, err := strconv.ParseInt(s, 10, 64)
50: if err != nil { //gdb-dbg=(i)
54: hist = ensure(int(i), hist)
55: hist[int(i)]++
55: hist[int(i)]++
47: for scanner.Scan() {
src/bufio/scan.go
107: return string(s.token)
./testdata/hist.go
49: i, err := strconv.ParseInt(s, 10, 64)
50: if err != nil { //gdb-dbg=(i)
54: hist = ensure(int(i), hist)
55: hist[int(i)]++
55: hist[int(i)]++
47: for scanner.Scan() {
src/bufio/scan.go
107: return string(s.token)
./testdata/hist.go
49: i, err := strconv.ParseInt(s, 10, 64)
50: if err != nil { //gdb-dbg=(i)
54: hist = ensure(int(i), hist)
55: hist[int(i)]++
55: hist[int(i)]++
47: for scanner.Scan() {
src/bufio/scan.go
107: return string(s.token)
./testdata/hist.go
49: i, err := strconv.ParseInt(s, 10, 64)
50: if err != nil { //gdb-dbg=(i)
54: hist = ensure(int(i), hist)
55: hist[int(i)]++
55: hist[int(i)]++
47: for scanner.Scan() {
src/bufio/scan.go
107: return string(s.token)
./testdata/hist.go
49: i, err := strconv.ParseInt(s, 10, 64)
50: if err != nil { //gdb-dbg=(i)
54: hist = ensure(int(i), hist)
55: hist[int(i)]++
55: hist[int(i)]++
47: for scanner.Scan() {
src/bufio/scan.go
107: return string(s.token)
./testdata/hist.go
49: i, err := strconv.ParseInt(s, 10, 64)
50: if err != nil { //gdb-dbg=(i)
54: hist = ensure(int(i), hist)
55: hist[int(i)]++
55: hist[int(i)]++
47: for scanner.Scan() {
59: for i, a := range hist {
60: if a == 0 {
60: if a == 0 {
65: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
64: n += a
65: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
......@@ -127,7 +78,6 @@
59: for i, a := range hist {
65: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
60: if a == 0 {
60: if a == 0 {
65: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
64: n += a
65: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
......@@ -138,9 +88,6 @@
59: for i, a := range hist {
65: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
60: if a == 0 {
60: if a == 0 {
60: if a == 0 {
60: if a == 0 {
65: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
64: n += a
65: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
......@@ -152,7 +99,3 @@
65: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
60: if a == 0 {
68: }
src/runtime/proc.go
201: if atomic.Load(&runningPanicDefers) != 0 {
210: if atomic.Load(&panicking) != 0 {
214: exit(0)
src/cmd/compile/internal/ssa/testdata/hist.go
35: func main() {
35: func main() {
36: hist := make([]int, 10)
37: var reader io.Reader = strings.NewReader(cannedInput) //gdb-dbg=(hist/A,cannedInput/A)
13: "strings"
150: func NewReader(s string) *Reader { return &Reader{s, 0, -1} }
38: if len(os.Args) > 1 {
8: "bufio"
84: split: ScanLines,
74: MaxScanTokenSize = 64 * 1024
46: scanner := bufio.NewScanner(reader)
47: for scanner.Scan() {
107: return string(s.token)
48: s := scanner.Text()
49: i, err := strconv.ParseInt(s, 10, 64)
50: if err != nil { //gdb-dbg=(i)
54: hist = ensure(int(i), hist)
55: hist[int(i)]++
47: for scanner.Scan() {
107: return string(s.token)
48: s := scanner.Text()
49: i, err := strconv.ParseInt(s, 10, 64)
50: if err != nil { //gdb-dbg=(i)
54: hist = ensure(int(i), hist)
55: hist[int(i)]++
47: for scanner.Scan() {
107: return string(s.token)
48: s := scanner.Text()
49: i, err := strconv.ParseInt(s, 10, 64)
50: if err != nil { //gdb-dbg=(i)
54: hist = ensure(int(i), hist)
55: hist[int(i)]++
47: for scanner.Scan() {
107: return string(s.token)
48: s := scanner.Text()
49: i, err := strconv.ParseInt(s, 10, 64)
50: if err != nil { //gdb-dbg=(i)
54: hist = ensure(int(i), hist)
55: hist[int(i)]++
47: for scanner.Scan() {
107: return string(s.token)
48: s := scanner.Text()
49: i, err := strconv.ParseInt(s, 10, 64)
50: if err != nil { //gdb-dbg=(i)
54: hist = ensure(int(i), hist)
55: hist[int(i)]++
47: for scanner.Scan() {
107: return string(s.token)
48: s := scanner.Text()
49: i, err := strconv.ParseInt(s, 10, 64)
50: if err != nil { //gdb-dbg=(i)
54: hist = ensure(int(i), hist)
55: hist[int(i)]++
47: for scanner.Scan() {
107: return string(s.token)
48: s := scanner.Text()
49: i, err := strconv.ParseInt(s, 10, 64)
50: if err != nil { //gdb-dbg=(i)
54: hist = ensure(int(i), hist)
55: hist[int(i)]++
47: for scanner.Scan() {
107: return string(s.token)
48: s := scanner.Text()
49: i, err := strconv.ParseInt(s, 10, 64)
50: if err != nil { //gdb-dbg=(i)
54: hist = ensure(int(i), hist)
55: hist[int(i)]++
47: for scanner.Scan() {
107: return string(s.token)
48: s := scanner.Text()
49: i, err := strconv.ParseInt(s, 10, 64)
50: if err != nil { //gdb-dbg=(i)
54: hist = ensure(int(i), hist)
55: hist[int(i)]++
47: for scanner.Scan() {
107: return string(s.token)
48: s := scanner.Text()
49: i, err := strconv.ParseInt(s, 10, 64)
50: if err != nil { //gdb-dbg=(i)
54: hist = ensure(int(i), hist)
......@@ -72,7 +67,6 @@
47: for scanner.Scan() {
59: for i, a := range hist {
60: if a == 0 {
60: if a == 0 {
65: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
64: n += a
65: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
......@@ -93,7 +87,6 @@
59: for i, a := range hist {
65: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
60: if a == 0 {
60: if a == 0 {
65: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
64: n += a
65: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
......@@ -104,9 +97,6 @@
59: for i, a := range hist {
65: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
60: if a == 0 {
60: if a == 0 {
60: if a == 0 {
60: if a == 0 {
65: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
64: n += a
65: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
......@@ -118,8 +108,3 @@
65: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
60: if a == 0 {
68: }
src/runtime/proc.go
201: if atomic.Load(&runningPanicDefers) != 0 {
201: if atomic.Load(&runningPanicDefers) != 0 {
210: if atomic.Load(&panicking) != 0 {
214: exit(0)
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