{"record":{"id":"8e9535af9b97c3aa","repo":"go-delve/delve","slug":"ebpf-composite-memory-w","errorCode":null,"errorMessage":"ebpf composite memory: %w","messagePattern":"ebpf composite memory: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/target.go","lineNumber":520,"sourceCode":"\t\tv.Len = ip.Len\n\t\tv.Base = ip.Base\n\t\tv.Addr = ip.Addr\n\t\tv.Kind = ip.Kind\n\t\tv.bi = t.BinInfo()\n\n\t\tif ip.Unreadable != nil {\n\t\t\tv.Unreadable = ip.Unreadable\n\t\t\treturn v\n\t\t}\n\t\tif v.RealType == nil {\n\t\t\tv.Unreadable = errors.New(\"type not supported by ebpf\")\n\t\t\treturn v\n\t\t}\n\n\t\tcachedMem := CreateLoadedCachedMemory(ip.Data)\n\t\tcompMem, compErr := CreateCompositeMemory(cachedMem, t.BinInfo().Arch, op.DwarfRegisters{}, ip.Pieces, ip.RealType.Common().ByteSize)\n\t\tif compErr != nil {\n\t\t\tv.Unreadable = fmt.Errorf(\"ebpf composite memory: %w\", compErr)\n\t\t\treturn v\n\t\t}\n\t\tv.mem = compMem\n\n\t\tv.loadValue(cfg)\n\n\t\treturn v\n\t}\n\tfor _, tp := range tracepoints {\n\t\tr := &UProbeTraceResult{}\n\t\tr.FnAddr = tp.FnAddr\n\t\tr.GoroutineID = tp.GoroutineID\n\t\tr.IsRet = tp.IsRet\n\t\tfor _, ip := range tp.InputParams {\n\t\t\tv := convertInputParamToVariable(ip)\n\t\t\tr.InputParams = append(r.InputParams, v)\n\t\t}\n\t\tfor _, ip := range tp.ReturnParams {","sourceCodeStart":502,"sourceCodeEnd":538,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/target.go#L502-L538","documentation":"This error wraps a failure from CreateCompositeMemory while Delve is loading a variable captured by an eBPF uprobe tracepoint. When an argument value is spread across DWARF location pieces (registers/stack fragments), Delve reassembles them into a CompositeMemory; if the pieces are inconsistent with the type's byte size or the architecture, the variable is returned with Unreadable set to this wrapped error.","triggerScenarios":"Calling GetBufferedTracepoints (or any code path that loads eBPF-buffered tracepoint arguments) where ip.Pieces do not cover exactly the RealType byte size for a composite (struct/array/slice/float) argument, or the captured data length mismatches what CreateCompositeMemory expects for binInfo.Arch.","commonSituations":"Tracing functions whose argument types are not fully supported by the eBPF backend (structs, arrays, or floats in XMM registers which uprobes cannot read); stale .o eBPF object built with an old clang producing wrong register capture; architecture mismatches between the traced binary and the loaded eBPF program.","solutions":["Check that the traced function's argument type is one of the eBPF-supported kinds (int, uint, bool, float, complex, string, pointer, slice); avoid tracing structs/maps/chans/interfaces/funcs/arrays","Rebuild the eBPF object with 'make build-ebpf-object' using the supported clang-22 builder image so register capture matches the expected layout","Verify UProbeArgMap piece offsets/sizes produced from DWARF match the type's ByteSize for the target arch","If floats appear in XMM registers (DWARF regnum >= 17), accept them as unreadable or restructure the traced function signature"],"exampleFix":"// before: tracing a struct arg which has no single-register representation\n//   func worker(s MyStruct)\n// after: trace scalar fields instead or pass by pointer and read in the test\n//   func worker(s *MyStruct) // pointer kind is supported by ebpf backend","handlingStrategy":"fallback","validationCode":"// before tracing, check argument kinds are ebpf-supported\nfunc ebpfSupported(dt godwarf.Type) bool {\n    switch dt.Common().ReflectKind {\n    case reflect.Int, reflect.Uint, reflect.Bool, reflect.Float32,\n        reflect.Float64, reflect.Complex64, reflect.Complex128,\n        reflect.String, reflect.Ptr:\n        return true\n    }\n    return false\n}","typeGuard":"func isUnreadable(v *proc.Variable) bool { return v != nil && v.Unreadable != nil }","tryCatchPattern":"v, err := dbg.GetBufferedTracepoints(...)\nif v != nil {\n    for _, tv := range v {\n        if tv.Unreadable != nil {\n            log.Printf(\"tracepoint arg unreadable: %v\", tv.Unreadable)\n            continue\n        }\n    }\n}","preventionTips":["Trace only scalar/string/pointer/slice arguments with the eBPF backend","Rebuild eBPF objects (make build-ebpf-object) after any Delve or clang toolchain update","Check tv.Unreadable on every returned tracepoint variable before use","Keep traced binary arch aligned with the eBPF object target arch"],"tags":["ebpf","debugger","composite-memory"],"backgroundTag":"ebpf-unsupported-argument-type","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}