未验证 提交 6328edaa 编写于 作者: A Alessandro Arzilli 提交者: GitHub

pkg/prog/native/linux: change handling of ESRCH in trapWaitInternal (#2286)

If a thread exits while we are looking at it just treat it as if the
status had reported it as exited instead of doing something special.
Fixes flakiness in TestIssue387.
上级 796278ec
......@@ -398,10 +398,15 @@ func (dbp *nativeProcess) trapWaitInternal(pid int, options trapWaitOptions) (*n
th.os.running = false
return th, nil
} else if err := th.resumeWithSig(int(status.StopSignal())); err != nil {
if options&trapWaitDontCallExitGuard != 0 {
if err != sys.ESRCH {
return nil, err
}
return nil, dbp.exitGuard(err)
// do the same thing we do if a thread quit
if wpid == dbp.pid {
dbp.postExit()
return nil, proc.ErrProcessExited{Pid: wpid, Status: status.ExitStatus()}
}
delete(dbp.threads, wpid)
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册