go-delve/delve · error

invalid interface %q

Error message

invalid interface %q

What it means

Error "invalid interface %q" thrown in go-delve/delve.

Source

Thrown at pkg/proc/breakpoints.go:752

		return nil, fmt.Errorf("can not watch %q", expr)
	}
	if xv.Unreadable != nil {
		return nil, fmt.Errorf("expression %q is unreadable: %v", expr, xv.Unreadable)
	}
	if xv.Kind == reflect.UnsafePointer || xv.Kind == reflect.Invalid {
		return nil, fmt.Errorf("can not watch variable of type %s", xv.Kind.String())
	}

	// Special handling for interface types
	if xv.Kind == reflect.Interface {
		// For interfaces, we want to watch the data they point to
		// Read the interface to get the data pointer
		_, data, _ := xv.readInterface()
		if xv.Unreadable != nil {
			return nil, fmt.Errorf("error reading interface %q: %v", expr, xv.Unreadable)
		}
		if data == nil {
			return nil, fmt.Errorf("invalid interface %q", expr)
		}

		// Use the data field as our watch target
		xv = data
		expr = expr + " (interface data)"
	}

	sz := xv.DwarfType.Size()
	if sz <= 0 || sz > int64(t.BinInfo().Arch.PtrSize()) {
		//TODO(aarzilli): it is reasonable to expect to be able to watch string
		//variables and we could support it by watching certain member fields here.
		return nil, fmt.Errorf("can not watch variable of type %s", xv.DwarfType.String())
	}

	stackWatch := scope.g != nil && !scope.g.SystemStack && xv.Addr >= scope.g.stack.lo && xv.Addr < scope.g.stack.hi

	if stackWatch && wtype&WatchRead != 0 {
		// In theory this would work except for the fact that the runtime will

View on GitHub (pinned to a23773e6c3)

When it happens

Trigger: Thrown at pkg/proc/breakpoints.go:752 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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