go-delve/delve · warning

could not dereference %s (no children?)

Error message

could not dereference %s (no children?)

What it means

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.

Source

Thrown at pkg/proc/stack_sigtramp.go:36

	bi := it.bi

	findvar := func(name string) *Variable {
		vars, _ := scope.Locals(0, name)
		for i := range vars {
			if vars[i].Name == name {
				return vars[i]
			}
		}
		return nil
	}

	deref := func(v *Variable) (uint64, error) {
		v.loadValue(loadSingleValue)
		if v.Unreadable != nil {
			return 0, fmt.Errorf("could not dereference %s: %v", v.Name, v.Unreadable)
		}
		if len(v.Children) < 1 {
			return 0, fmt.Errorf("could not dereference %s (no children?)", v.Name)
		}
		logger.Debugf("%s address is %#x", v.Name, v.Children[0].Addr)
		return v.Children[0].Addr, nil
	}

	getctxaddr := func() (uint64, error) {
		ctxvar := findvar("ctx")
		if ctxvar == nil {
			return 0, errors.New("ctx variable not found")
		}
		addr, err := deref(ctxvar)
		if err != nil {
			return 0, err
		}
		return addr, nil
	}

	switch bi.GOOS {

View on GitHub (pinned to a23773e6c3)

Solutions

  1. Use a Delve build matching the Go version of the debugged binary (runtime type layout changes alter Children population)
  2. Check the binary was built without -w / with DWARF info intact (do not strip debug info of the runtime parts being unwound)
  3. If persistent across matching versions, file a Delve issue with `dlv version`, Go version, GOOS/GOARCH

Example fix

// before
go build -ldflags="-s -w" -o app .   # stripped DWARF
// after
go build -o app .                    # keep DWARF info
Defensive patterns

Strategy: type-guard

Validate before calling

v.loadValue(loadSingleValue)
if v.Unreadable != nil || len(v.Children) < 1 {
    // treat as non-dereferenceable, skip frame
}

Type guard

func hasPointerChild(v *Variable) bool {
    return v.Unreadable == nil && len(v.Children) >= 1
}

Try / catch

addr, err := getctxaddr()
if err != nil {
    logger.Debugf("sigtrampgo ctx unavailable: %v", err)
    return nil, err // caller degrades to normal frame handling
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of go-delve/delve@a23773e6c3 (2026-08-31). Data as JSON: /api/errors/1947f6beb423915e. Report an issue: GitHub.