{"record":{"id":"ceb96425f26d18e6","repo":"go-delve/delve","slug":"unable-to-clear-breakpoint-d-partial-s","errorCode":null,"errorMessage":"unable to clear breakpoint %d (partial): %s","messagePattern":"unable to clear breakpoint (.+?) \\(partial\\): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/proc/target_group.go","lineNumber":443,"sourceCode":"\t\t\t\tif err != nil {\n\t\t\t\t\terrs = append(errs, err)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif len(errs) > 0 {\n\t\tbuf := new(bytes.Buffer)\n\t\tfor i, err := range errs {\n\t\t\tfmt.Fprintf(buf, \"%s\", err)\n\t\t\tif i != len(errs)-1 {\n\t\t\t\tfmt.Fprintf(buf, \", \")\n\t\t\t}\n\t\t}\n\n\t\tif len(errs) == n {\n\t\t\treturn fmt.Errorf(\"unable to clear breakpoint %d: %v\", lbp.LogicalID, buf.String())\n\t\t}\n\t\treturn fmt.Errorf(\"unable to clear breakpoint %d (partial): %s\", lbp.LogicalID, buf.String())\n\t}\n\treturn nil\n}\n\n// ChangeBreakpointCondition changes the breakpoint condition of lbp.\nfunc (grp *TargetGroup) ChangeBreakpointCondition(lbp *LogicalBreakpoint, cond, hitCond string, hitCondPerG bool) error {\n\tlbp.cond = nil\n\tif cond != \"\" {\n\t\tvar err error\n\t\tlbp.cond, err = parser.ParseExpr(cond)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tt := ValidTargets{Group: grp}\n\tfor t.Next() {\n\t\tfor _, bp := range t.Breakpoints().M {","sourceCodeStart":425,"sourceCodeEnd":461,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/target_group.go#L425-L461","documentation":"Same disableBreakpoint path as the total failure case, but only SOME of the physical breakpoint clears failed (len(errs) < n): at least one target was cleaned successfully while others were not. The '(partial)' marker tells you breakpoint removal succeeded on some processes in the (multi-process) target group but failed on others.","triggerScenarios":"Calling SetBreakpointEnabled(lbp, false), ChangeBreakpointCondition, or manageUnsatisfiableBreakpoints in a TargetGroup with multiple targets (e.g. after follow-exec forked/exec'd children) where ClearBreakpoint succeeds on some processes but fails on others (child crashed, memory unmapped, ptrace failure) — or on a single target with a breakpoint at multiple addresses where only some clears fail.","commonSituations":"Multi-process debugging where a child process died mid-session; breakpoint set at several addresses (inlined/multiple instantiations) with mixed clear outcomes; partially failed shutdown sequences.","solutions":["Parse the joined sub-error list to find which targets/addresses failed","Check the liveness of each process in the target group","Retry SetBreakpointEnabled(lbp, false) — already-cleared targets are no-ops","If failed targets are dead, detach/kill the whole group instead","Inspect for stale INT3 bytes if you plan to resume a partially-cleaned process"],"exampleFix":"// before\nerr := grp.SetBreakpointEnabled(lbp, false)\n// err: unable to clear breakpoint 7 (partial): could not restore memory at 0x...\n// after\nif err != nil && strings.Contains(err.Error(), \"(partial)\") {\n    // some targets still have the breakpoint: retry; clears on clean targets are no-ops\n    err = grp.SetBreakpointEnabled(lbp, false)\n}","handlingStrategy":"retry","validationCode":"// check each target before disabling\nfor _, t := range grp.Targets() {\n    if ok, _ := t.Valid(); !ok {\n        // skip or clean up this target first\n    }\n}","typeGuard":"func isPartialDisableErr(err error) bool {\n    return err != nil && strings.Contains(err.Error(), \"(partial)\")\n}","tryCatchPattern":"if err := grp.SetBreakpointEnabled(lbp, false); err != nil {\n    if isPartialDisableErr(err) {\n        // safe to retry: already-cleared targets are no-ops\n        time.Sleep(50 * time.Millisecond)\n        err = grp.SetBreakpointEnabled(lbp, false)\n    }\n    return err\n}","preventionTips":["Monitor child-process liveness in follow-exec/multi-process sessions","Retry once on partial failures — repeated clears on clean targets are harmless","Order teardown: remove breakpoints before processes exit, not during shutdown races","Treat persistent partial failures as a signal that a child target crashed and needs reaping"],"tags":["go","debugger","breakpoint","partial-failure"],"backgroundTag":"breakpoint-clear-failed","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}