go-delve/delve · error · ErrNoRuntimeAllG

could not find goroutine array

Error message

could not find goroutine array

What it means

ErrNoRuntimeAllG is returned by getRuntimeAllg when delve cannot locate the runtime.allg (the Go runtime's array of all goroutines) in the target's memory. Without this structure delve cannot enumerate goroutines, so goroutine listing and G-based operations fail. It is typically a symptom of missing or mismatched runtime symbol information.

Source

Thrown at pkg/proc/target.go:25

	"os"
	"sort"
	"strings"
	"sync"

	"github.com/go-delve/delve/pkg/dwarf/op"
	"github.com/go-delve/delve/pkg/goversion"
	"github.com/go-delve/delve/pkg/logflags"
	"github.com/go-delve/delve/pkg/proc/internal/ebpf"
)

var (
	// ErrNotRecorded is returned when an action is requested that is
	// only possible on recorded (traced) programs.
	ErrNotRecorded = errors.New("not a recording")

	// ErrNoRuntimeAllG is returned when the runtime.allg list could
	// not be found.
	ErrNoRuntimeAllG = errors.New("could not find goroutine array")

	// ErrProcessDetached indicates that we detached from the target process.
	ErrProcessDetached = errors.New("detached from the process")
)

type LaunchFlags uint8

const (
	LaunchForeground LaunchFlags = 1 << iota
	LaunchDisableASLR
)

// Target represents the process being debugged.
type Target struct {
	Process

	proc   ProcessInternal
	recman RecordingManipulationInternal

View on GitHub (pinned to a23773e6c3)

Solutions

  1. Rebuild the target binary without symbol stripping (-s -w removed)
  2. Use a delve version compatible with the Go version the binary was built with
  3. Verify the binary is actually Go and built with debug info
  4. Use 'info sources'/symbol checks to confirm runtime symbols resolved

Example fix

// before
go build -ldflags="-s -w" main.go   // stripped: runtime.allg unresolvable
// after
go build -gcflags="all=-N -l" main.go  // keep symbols for debugging
Defensive patterns

Strategy: validation

Validate before calling

// ensure binary has symbols before attach
if _, err := debug.PrintStackCheck(binaryPath); err != nil { /* stripped? */ }
out, _ := exec.Command("go", "version", "-m", binaryPath).Output()

Try / catch

_, err := dbg.Process().BinInfo().FindFunction("runtime.allglen")
if errors.Is(err, proc.ErrNoRuntimeAllG) {
    return fmt.Errorf("target lacks Go runtime symbols; rebuild without -s -w")
}

Prevention

When it happens

Trigger: getRuntimeAllg fails to resolve the runtime.allg symbol via the binary's debug info — e.g. stripped binaries, very old/new Go versions where the symbol layout changed, or corrupted/incomplete DWARF.

Common situations: Attaching to a Go binary built with -ldflags '-s -w' or otherwise stripped; debugging with a delve version that predates the target Go version's runtime changes; inspecting non-Go or cgo-heavy processes.

Related errors


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