Skip to content

Commit

Permalink
proc/native: report trapWaitInternal errors in nativeProcess.stop
Browse files Browse the repository at this point in the history
The process could quit while we are inside stop, we should report the
error otherwise the following code will try to send on the closed
ptrace channel.
Fixes a sporadic error in TestIssue1101.
  • Loading branch information
aarzilli authored and derekparker committed Apr 17, 2020
1 parent 55543e2 commit f9b6c43
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/proc/native/proc_linux.go
Expand Up @@ -475,7 +475,10 @@ func (dbp *nativeProcess) stop(trapthread *nativeThread) (err error) {

// check if any other thread simultaneously received a SIGTRAP
for {
th, _ := dbp.trapWaitInternal(-1, trapWaitNohang)
th, err := dbp.trapWaitInternal(-1, trapWaitNohang)
if err != nil {
return dbp.exitGuard(err)
}
if th == nil {
break
}
Expand Down

0 comments on commit f9b6c43

Please sign in to comment.