{"record":{"id":"1947f6beb423915e","repo":"go-delve/delve","slug":"could-not-dereference-s-no-children","errorCode":null,"errorMessage":"could not dereference %s (no children?)","messagePattern":"could not dereference (.+?) \\(no children\\?\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/proc/stack_sigtramp.go","lineNumber":36,"sourceCode":"\tbi := it.bi\n\n\tfindvar := func(name string) *Variable {\n\t\tvars, _ := scope.Locals(0, name)\n\t\tfor i := range vars {\n\t\t\tif vars[i].Name == name {\n\t\t\t\treturn vars[i]\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n\n\tderef := func(v *Variable) (uint64, error) {\n\t\tv.loadValue(loadSingleValue)\n\t\tif v.Unreadable != nil {\n\t\t\treturn 0, fmt.Errorf(\"could not dereference %s: %v\", v.Name, v.Unreadable)\n\t\t}\n\t\tif len(v.Children) < 1 {\n\t\t\treturn 0, fmt.Errorf(\"could not dereference %s (no children?)\", v.Name)\n\t\t}\n\t\tlogger.Debugf(\"%s address is %#x\", v.Name, v.Children[0].Addr)\n\t\treturn v.Children[0].Addr, nil\n\t}\n\n\tgetctxaddr := func() (uint64, error) {\n\t\tctxvar := findvar(\"ctx\")\n\t\tif ctxvar == nil {\n\t\t\treturn 0, errors.New(\"ctx variable not found\")\n\t\t}\n\t\taddr, err := deref(ctxvar)\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\treturn addr, nil\n\t}\n\n\tswitch bi.GOOS {","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/stack_sigtramp.go#L18-L54","documentation":"After loading the 'ctx' (or 'ep') variable in a runtime.sigtrampgo frame, Delve expected at least one child (the pointee, i.e. the dereferenced value) but the loaded variable has none, so the signal context address cannot be extracted. This usually means the variable's DWARF type is not the pointer type Delve expects.","triggerScenarios":"Raised by the deref closure in readSigtrampgoContext when loadValue succeeds but len(v.Children) < 1 — the 'ctx'/'ep' variable did not load as a pointer with a child, during signal-frame unwinding.","commonSituations":"Go runtime version whose DWARF type for the sigtrampgo ctx/ep parameters differs from what this Delve build expects (version mismatch); stripped or modified DWARF (build with -w/-ldflags stripping then partially recovered); cross-version core dumps.","solutions":["Use a Delve build matching the Go version of the debugged binary (runtime type layout changes alter Children population)","Check the binary was built without -w / with DWARF info intact (do not strip debug info of the runtime parts being unwound)","If persistent across matching versions, file a Delve issue with `dlv version`, Go version, GOOS/GOARCH"],"exampleFix":"// before\ngo build -ldflags=\"-s -w\" -o app .   # stripped DWARF\n// after\ngo build -o app .                    # keep DWARF info","handlingStrategy":"type-guard","validationCode":"v.loadValue(loadSingleValue)\nif v.Unreadable != nil || len(v.Children) < 1 {\n    // treat as non-dereferenceable, skip frame\n}","typeGuard":"func hasPointerChild(v *Variable) bool {\n    return v.Unreadable == nil && len(v.Children) >= 1\n}","tryCatchPattern":"addr, err := getctxaddr()\nif err != nil {\n    logger.Debugf(\"sigtrampgo ctx unavailable: %v\", err)\n    return nil, err // caller degrades to normal frame handling\n}","preventionTips":["Match Delve and Go runtime versions (layout of ctx/ep parameters changes between Go releases)","Keep DWARF info intact in debug builds","If persistent with matching versions, report a Delve bug with versions and GOOS/GOARCH"],"tags":["delve","debugger","signal-handling","stack-unwinding","dwarf"],"backgroundTag":"sigtrampgo-context-unreadable","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}