Repository: go
Issue: cmd/compile/internal/ssa: apparent deadlock in TestNexting
Labels: Testing,NeedsInvestigation,compiler/runtime

[2020-02-23T18:06:08-5bd1454/linux-amd64-longtest](https://build.golang.org/log/a55bc25df89a2b612ae43e28e083b6c8269d5a31)
[2019-12-27T14:52:12-dcd3b2c/linux-amd64-longtest](https://build.golang.org/log/832e4e63da8301b2395df3f239adfa6dbdc25c48)
[2019-11-22T17:33:48-05511a5/linux-amd64-longtest](https://build.golang.org/log/1f3925c311f007b4b5e67ed2fc599461aba9863f)
[2019-11-19T18:43:52-2ac9f1d/linux-amd64-longtest](https://build.golang.org/log/0d9a9a9453f04c2b688e176bbc4f43eb26980423)
[2019-11-19T18:43:52-2ac9f1d/linux-amd64-longtest](https://build.golang.org/log/5fb99e119cc1166e7e8a5889960bd75330a747d7)
[2019-11-18T19:03:27-48989d5/linux-amd64-longtest](https://build.golang.org/log/190e897890a1a0c54f1a93871de9d85b95575bd1)
[2019-11-07T17:45:27-763d3ac/linux-amd64-longtest](https://build.golang.org/log/afd4654b020b1440879a72d0a1fa8b579b8c9af1)
[2019-11-04T05:27:25-fb29e22/linux-amd64-longtest](https://build.golang.org/log/d0a3ea14bd4aa751e917789020b1734ad8404315)

CC @dr2chase @randall77 @cagedmantis; see also #37050.

As far as I can tell, this is a bug in the test harness itself (or perhaps in the third-party debugger) rather than a bug in the `ssa` package proper.

<details>

```
panic: test timed out after 15m0s

goroutine 194 [running]:
testing.(*M).startAlarm.func1()
	/workdir/go/src/testing/testing.go:1479 +0xdf
created by time.goFunc
	/workdir/go/src/time/sleep.go:168 +0x44

goroutine 1 [chan receive, 12 minutes]:
testing.(*T).Run(0xc000282120, 0xb14f08, 0xb, 0xb2be88, 0x482601)
	/workdir/go/src/testing/testing.go:1044 +0x37e
testing.runTests.func1(0xc000168000)
	/workdir/go/src/testing/testing.go:1300 +0x78
testing.tRunner(0xc000168000, 0xc00005ddf8)
	/workdir/go/src/testing/testing.go:992 +0xdc
testing.runTests(0xc00000c640, 0x1063a60, 0x5c, 0x5c, 0xbf8ccf536472d01d, 0xd18c3eb719, 0x10d5000, 0x78)
	/workdir/go/src/testing/testing.go:1298 +0x2d8
testing.(*M).Run(0xc00001e100, 0x0)
	/workdir/go/src/testing/testing.go:1210 +0x1a7
main.main()
	_testmain.go:280 +0x135

goroutine 186 [select, 12 minutes]:
cmd/compile/internal/ssa_test.(*ioState).readSimpleExpecting(0xc0001f47e0, 0xb1431b, 0xa, 0x2, 0x2, 0x0, 0x0)
	/workdir/go/src/cmd/compile/internal/ssa/debug_test.go:917 +0x150
cmd/compile/internal/ssa_test.(*ioState).writeReadExpect(0xc0001f47e0, 0xc000094050, 0x2, 0xb1431b, 0xa, 0xc000094050, 0x2, 0x0, 0x0)
	/workdir/go/src/cmd/compile/internal/ssa/debug_test.go:863 +0xe6
cmd/compile/internal/ssa_test.(*delveState).stepnext(0xc0001e0420, 0xb0ae30, 0x1, 0xb1431b)
	/workdir/go/src/cmd/compile/internal/ssa/debug_test.go:520 +0xbc
cmd/compile/internal/ssa_test.(*delveState).start(0xc0001e0420)
	/workdir/go/src/cmd/compile/internal/ssa/debug_test.go:563 +0x23c
cmd/compile/internal/ssa_test.runDbgr(0xca1f00, 0xc0001e0420, 0x3e8, 0x34)
	/workdir/go/src/cmd/compile/internal/ssa/debug_test.go:279 +0x35
cmd/compile/internal/ssa_test.testNexting(0xc000168480, 0xb0f233, 0x6, 0xc0001fd6a5, 0x7, 0x0, 0x0, 0x3e8, 0x110f490, 0x0, ...)
	/workdir/go/src/cmd/compile/internal/ssa/debug_test.go:246 +0x5dd
cmd/compile/internal/ssa_test.optSubTest.func1(0xc000168480)
	/workdir/go/src/cmd/compile/internal/ssa/debug_test.go:202 +0x95
testing.tRunner(0xc000168480, 0xc0001e0120)
	/workdir/go/src/testing/testing.go:992 +0xdc
created by testing.(*T).Run
	/workdir/go/src/testing/testing.go:1043 +0x357

goroutine 170 [chan receive, 12 minutes]:
testing.(*T).Run(0xc000168480, 0xc0001fd6b0, 0xe, 0xc0001e0120, 0x1)
	/workdir/go/src/testing/testing.go:1044 +0x37e
cmd/compile/internal/ssa_test.optSubTest(0xc000282120, 0xc0001fd6a5, 0x7, 0xb0f233, 0x6, 0x0, 0x0, 0x3e8, 0x110f490, 0x0, ...)
	/workdir/go/src/cmd/compile/internal/ssa/debug_test.go:200 +0x146
cmd/compile/internal/ssa_test.TestNexting(0xc000282120)
	/workdir/go/src/cmd/compile/internal/ssa/debug_test.go:164 +0x611
testing.tRunner(0xc000282120, 0xb2be88)
	/workdir/go/src/testing/testing.go:992 +0xdc
created by testing.(*T).Run
	/workdir/go/src/testing/testing.go:1043 +0x357

goroutine 189 [IO wait, 12 minutes]:
internal/poll.runtime_pollWait(0x7f73050bcde8, 0x72, 0xffffffffffffffff)
	/workdir/go/src/runtime/netpoll.go:203 +0x55
internal/poll.(*pollDesc).wait(0xc0001e0558, 0x72, 0x1001, 0x1000, 0xffffffffffffffff)
	/workdir/go/src/internal/poll/fd_poll_runtime.go:87 +0x45
internal/poll.(*pollDesc).waitRead(...)
	/workdir/go/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Read(0xc0001e0540, 0xc00025e000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
	/workdir/go/src/internal/poll/fd_unix.go:169 +0x19b
os.(*File).read(...)
	/workdir/go/src/os/file_unix.go:263
os.(*File).Read(0xc00068e540, 0xc00025e000, 0x1000, 0x1000, 0xc000220000, 0x4b, 0x0)
	/workdir/go/src/os/file.go:116 +0x71
cmd/compile/internal/ssa_test.newIoState.func1(0xc0001f47e0)
	/workdir/go/src/cmd/compile/internal/ssa/debug_test.go:796 +0x92
created by cmd/compile/internal/ssa_test.newIoState
	/workdir/go/src/cmd/compile/internal/ssa/debug_test.go:793 +0x22c

goroutine 190 [IO wait, 12 minutes]:
internal/poll.runtime_pollWait(0x7f73050bcc28, 0x72, 0xffffffffffffffff)
	/workdir/go/src/runtime/netpoll.go:203 +0x55
internal/poll.(*pollDesc).wait(0xc0001e0618, 0x72, 0x1001, 0x1000, 0xffffffffffffffff)
	/workdir/go/src/internal/poll/fd_poll_runtime.go:87 +0x45
internal/poll.(*pollDesc).waitRead(...)
	/workdir/go/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Read(0xc0001e0600, 0xc00025f000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
	/workdir/go/src/internal/poll/fd_unix.go:169 +0x19b
os.(*File).read(...)
	/workdir/go/src/os/file_unix.go:263
os.(*File).Read(0xc00068e550, 0xc00025f000, 0x1000, 0x1000, 0x2020202020200a3e, 0x3376202020202020, 0x745066664f203d20)
	/workdir/go/src/os/file.go:116 +0x71
cmd/compile/internal/ssa_test.newIoState.func2(0xc0001f47e0)
	/workdir/go/src/cmd/compile/internal/ssa/debug_test.go:815 +0x93
created by cmd/compile/internal/ssa_test.newIoState
	/workdir/go/src/cmd/compile/internal/ssa/debug_test.go:812 +0x24e
FAIL	cmd/compile/internal/ssa	900.007s
```

</details>