{"record":{"id":"8487bfd46c09514c","repo":"go-delve/delve","slug":"multiple-errors-evaluating-conditions","errorCode":null,"errorMessage":"multiple errors evaluating conditions","messagePattern":"multiple errors evaluating conditions","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/target_exec.go","lineNumber":348,"sourceCode":"func isTraceOrTraceReturn(bp *Breakpoint) bool {\n\tif bp.Logical == nil {\n\t\treturn false\n\t}\n\treturn bp.Logical.Tracepoint || bp.Logical.TraceReturn\n}\n\nfunc conditionErrors(grp *TargetGroup) error {\n\tvar condErr error\n\tfor _, dbp := range grp.targets {\n\t\tif isvalid, _ := dbp.Valid(); !isvalid {\n\t\t\tcontinue\n\t\t}\n\t\tfor _, th := range dbp.ThreadList() {\n\t\t\tif bp := th.Breakpoint(); bp.Breakpoint != nil && bp.CondError != nil {\n\t\t\t\tif condErr == nil {\n\t\t\t\t\tcondErr = bp.CondError\n\t\t\t\t} else {\n\t\t\t\t\treturn errors.New(\"multiple errors evaluating conditions\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn condErr\n}\n\n// pick a new dbp.currentThread, with the following priority:\n//\n//   - a thread with an active stepping breakpoint\n//   - a thread with an active breakpoint, prioritizing trapthread\n//   - trapthread if it is not nil\n//   - the previous current thread if it still exists\n//   - a randomly selected thread\nfunc pickCurrentThread(dbp *Target, trapthread Thread) error {\n\tthreads := dbp.ThreadList()\n\tfor _, th := range threads {\n\t\tif bp := th.Breakpoint(); bp.Active && bp.Stepping {","sourceCodeStart":330,"sourceCodeEnd":366,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/target_exec.go#L330-L366","documentation":"This error is built by conditionErrors (called from Continue) when, after a continue stops at breakpoints, more than one thread has a breakpoint whose condition failed to evaluate (bp.CondError != nil). Since only one condition error can be reported, delve replaces the ambiguity with this aggregate message so the user knows multiple conditional breakpoints are misbehaving.","triggerScenarios":"Continuing when two or more conditional breakpoints are hit and their AST conditions both raise evaluation errors (e.g. conditions referencing unreadable variables or invalid expressions).","commonSituations":"Breakpoints with conditions using variables out of scope at the breakpoint location; typos in condition expressions; evaluating conditions in optimized code where variables are unavailable.","solutions":["Fix or remove the condition on each breakpoint that errors (check breakpoint.CondError per breakpoint)","Validate condition expressions against variables in scope at the breakpoint","Temporarily remove conditions, confirm continues work, then re-add conditions one at a time","Use simpler conditions (literal comparisons on readable variables)"],"exampleFix":"// before\nb.Breakpoint.Condition = \"i > maxLimit\" // maxLimit unreadable here\n// after\nb.Breakpoint.Condition = \"i > 100\"      // use in-scope variables/literals","handlingStrategy":"try-catch","validationCode":"// validate breakpoint conditions are simple and reference in-scope vars before continue\nfor _, bp := range bps {\n    if bp.CondError != nil { fixCondition(bp) }\n}","typeGuard":null,"tryCatchPattern":"if err := grp.Continue(); err != nil && strings.Contains(err.Error(), \"multiple errors evaluating conditions\") {\n    // inspect each thread's bp.CondError to find offending breakpoints\n}","preventionTips":["Keep breakpoint conditions simple (literals, in-scope vars)","Check per-breakpoint CondError after failed continues","Test conditions individually before enabling many at once"],"tags":["go","debugger","breakpoints","conditions"],"backgroundTag":"breakpoint-condition-evaluation-failed","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}