{"record":{"id":"1100a6ba6f2a7c9a","repo":"go-delve/delve","slug":"ebpf-map-not-loaded","errorCode":null,"errorMessage":"eBPF map not loaded","messagePattern":"eBPF map not loaded","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/internal/ebpf/helpers.go","lineNumber":199,"sourceCode":"\t}\n\n\tif ctx.objs != nil {\n\t\tctx.objs.Close()\n\t}\n}\n\nfunc (ctx *EBPFContext) AttachUprobe(pid int, name string, offset uint64) error {\n\tif ctx.executable == nil {\n\t\treturn errors.New(\"no eBPF program loaded\")\n\t}\n\tl, err := ctx.executable.Uprobe(name, ctx.objs.tracePrograms.UprobeDlvTrace, &link.UprobeOptions{PID: pid, Address: offset})\n\tctx.links = append(ctx.links, l)\n\treturn err\n}\n\nfunc (ctx *EBPFContext) UpdateArgMap(key uint64, goidOffset int64, args []UProbeArgMap, gAddrOffset uint64, isret bool) error {\n\tif ctx.bpfArgMap == nil {\n\t\treturn errors.New(\"eBPF map not loaded\")\n\t}\n\n\t// Store DWARF types and parameter names for later lookup during ring buffer\n\t// event parsing. Uses a global index: input params at 0..n-1, return params\n\t// at n..n+m-1. Held under ctx.m to prevent data race with pollEvents.\n\tctx.m.Lock()\n\tif !isret {\n\t\tctx.nInputParams[key] = len(args)\n\t}\n\tnInputs := ctx.nInputParams[key]\n\tfor i, arg := range args {\n\t\tidx := i\n\t\tif isret {\n\t\t\tidx = nInputs + i\n\t\t}\n\t\tk := dwarfTypeKey{fnAddr: key, paramIdx: idx}\n\t\tctx.paramInfo[k] = paramMeta{dwarfType: arg.DwarfType, name: arg.Name}\n\t}","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/internal/ebpf/helpers.go#L181-L217","documentation":"EBPFContext.UpdateArgMap writes breakpoint argument type metadata into the eBPF map (bpfArgMap) used by the trace program to serialize argument bytes. If the map was never loaded (program load failed or was skipped) there is nowhere to write the metadata, so this error is returned.","triggerScenarios":"Calling UpdateArgMap (invoked when setting an eBPF trace breakpoint) after EBPFContext creation where ctx.bpfArgMap is nil — e.g. the eBPF objects partially loaded but the arg map failed, or a disabled/stub context was used.","commonSituations":"Same environment problems as program-not-loaded: missing capabilities, kernel too old, seccomp-restricted container; mismatched or stale compiled eBPF object missing the arg map section; using a custom build that skipped map creation.","solutions":["Fix eBPF loading first: ensure privileges (sudo/CAP_BPF, CAP_PERFMON) and a supported kernel, then retry the trace session","Rebuild the eBPF object for your architecture (make build-ebpf-object) so all maps exist","Check dlv startup logs for the original InitializeEBPF failure that left the map unloaded","Fall back to regular (non-eBPF) tracepoints with 'dlv trace' without --ebpf"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// ensure eBPF context initialized successfully before tracing:\nif err := checkEBPFAvailable(); err != nil { // capabilities + kernel + object load\n    return err // don't proceed to UpdateArgMap paths\n}","typeGuard":null,"tryCatchPattern":"if err := ebpfCtx.UpdateArgMap(key, goidOff, args, gAddrOff, isret); err != nil {\n    if strings.Contains(err.Error(), \"eBPF map not loaded\") {\n        log.Printf(\"arg map unavailable, falling back: %v\", err)\n        useRegularTrace()\n    }\n}","preventionTips":["Verify InitializeEBPF/logs succeeded before setting eBPF breakpoints","Run with CAP_BPF/CAP_PERFMON and a supported kernel","Rebuild eBPF objects when upgrading the kernel or delve version","Provide a non-eBPF trace fallback path"],"tags":["ebpf","linux","bpf-map","tracing"],"backgroundTag":"ebpf-program-not-loaded","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}