提交 e83e39b1 编写于 作者: D Derek Parker

Fix potential suite hang

上级 eae4e99f
......@@ -214,29 +214,31 @@ func TestNext(t *testing.T) {
// make sure here that after next'ing a couple time, we can
// still continue to execute the program without hitting a
// rogue breakpoint.
timer := time.NewTimer(5 * time.Second)
exited := make(chan interface{})
_, err = p.Clear(bp.Addr)
assertNoError(err, t, "Clear()")
go func() {
_, err := syscall.Wait4(p.Pid, nil, 0, nil)
if err != nil && err != syscall.ECHILD {
fmt.Println(err)
fmt.Println("waiting")
select {
case <-time.After(2 * time.Second):
syscall.PtraceDetach(p.Pid)
p.Process.Kill()
os.Exit(1)
case <-exited:
p.Process.Kill()
os.Exit(0)
}
exited <- nil
}()
go func() {
select {
case <-timer.C:
p.Process.Kill()
_, err := syscall.Wait4(p.Pid, nil, 0, nil)
if err != nil && err != syscall.ECHILD {
fmt.Println(err)
os.Exit(1)
case <-exited:
return
}
exited <- nil
}()
// We must call Continue outside of the goroutine
......
文件已添加
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册