From cc9ab6d687c72bd32bb68396e4e056d9bd13ea7a Mon Sep 17 00:00:00 2001 From: Konstantin Shaposhnikov Date: Tue, 6 Oct 2015 23:26:43 +0800 Subject: [PATCH] proc: avoid dup chan recv breakpoints I encountered the error message described in the issue while debugging InfluxDB. I can confirm that after this fix the error disapeared. Fixes #258 --- proc/proc.go | 6 ++++++ 1 file changed, 6 insertions(+) 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++