diff --git a/proc/proc.go b/proc/proc.go index 260898de..b31d45f1 100644 --- a/proc/proc.go +++ b/proc/proc.go @@ -334,6 +334,7 @@ func (dbp *Process) setChanRecvBreakpoints() (int, error) { if err != nil { return 0, err } + for _, g := range allg { if g.ChanRecvBlocked() { ret, err := g.chanRecvReturnAddr(dbp) @@ -344,6 +345,11 @@ func (dbp *Process) setChanRecvBreakpoints() (int, error) { return 0, err } if _, err = dbp.SetTempBreakpoint(ret); err != nil { + if _, ok := err.(BreakpointExistsError); ok { + // Ignore duplicate breakpoints in case if multiple + // goroutines wait on the same channel + continue + } return 0, err } count++