{"record":{"id":"24c3762ae27e8250","repo":"golang/go","slug":"internal-error-collision-during-call-site-table-m","errorCode":null,"errorMessage":"internal error: collision during call site table merge, fn=%s callsite=%s","messagePattern":"internal error: collision during call site table merge, fn=(.+?) callsite=(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd/compile/internal/inline/inlheur/callsite.go","lineNumber":92,"sourceCode":"// (stringified src.XPos plus call site ID) mapping to a value of call\n// property bits and score.\ntype encodedCallSiteTab map[string]propsAndScore\n\ntype propsAndScore struct {\n\tprops CSPropBits\n\tscore int\n\tmask  scoreAdjustTyp\n}\n\nfunc (pas propsAndScore) String() string {\n\treturn fmt.Sprintf(\"P=%s|S=%d|M=%s\", pas.props.String(),\n\t\tpas.score, pas.mask.String())\n}\n\nfunc (cst CallSiteTab) merge(other CallSiteTab) error {\n\tfor k, v := range other {\n\t\tif prev, ok := cst[k]; ok {\n\t\t\treturn fmt.Errorf(\"internal error: collision during call site table merge, fn=%s callsite=%s\", prev.Callee.Sym().Name, fmtFullPos(prev.Call.Pos()))\n\t\t}\n\t\tcst[k] = v\n\t}\n\treturn nil\n}\n\nfunc fmtFullPos(p src.XPos) string {\n\tvar sb strings.Builder\n\tsep := \"\"\n\tbase.Ctxt.AllPos(p, func(pos src.Pos) {\n\t\tsb.WriteString(sep)\n\t\tsep = \"|\"\n\t\tfile := filepath.Base(pos.Filename())\n\t\tfmt.Fprintf(&sb, \"%s:%d:%d\", file, pos.Line(), pos.Col())\n\t})\n\treturn sb.String()\n}\n","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/src/cmd/compile/internal/inline/inlheur/callsite.go#L74-L110","documentation":"Returned by CallSiteTab.merge when two call-site tables being merged already share a key (the same call-site position/callee). The message names it an internal error because the merge is part of building the inlheur call-site analysis, which should never receive overlapping entries. Hitting it means the analysis produced duplicate call-site records.","triggerScenarios":"Two CallSiteTab maps passed to merge() contain the same key; the second insertion sees prev, ok := cst[k] true and aborts with the previous entry's Callee name and position.","commonSituations":"Compiler development only: a change to how call sites are keyed (position vs callee symbol) produces collisions; running inlheur analysis on a program with instantiated generics where the same callsite key is emitted twice.","solutions":["Report/fix upstream: this is a compiler-internal invariant violation, not user-fixable in user code.","Bisect recent changes to callsite keying (Pos + Callee) to find the duplicate producer.","As a workaround, disable the inlheur dump flag that triggers the merge."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before merging, verify no key overlap.\nfor k := range other {\n    if _, dup := cst[k]; dup {\n        return fmt.Errorf(\"refusing merge: duplicate callsite key\")\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat this error as a compiler bug report trigger, not a user fix.","When changing callsite keys (Pos, Callee), update both producers and consumers.","Add invariant tests for CallSiteTab.merge."],"tags":["go-compiler","inline-heuristics","internal-error","invariant"],"backgroundTag":null,"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}