{"record":{"id":"84857113802cf29b","repo":"go-delve/delve","slug":"could-not-find-goroutine-array","errorCode":null,"errorMessage":"could not find goroutine array","messagePattern":"could not find goroutine array","errorType":"exception","errorClass":"ErrNoRuntimeAllG","httpStatus":null,"severity":"error","filePath":"pkg/proc/target.go","lineNumber":25,"sourceCode":"\t\"os\"\n\t\"sort\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"github.com/go-delve/delve/pkg/dwarf/op\"\n\t\"github.com/go-delve/delve/pkg/goversion\"\n\t\"github.com/go-delve/delve/pkg/logflags\"\n\t\"github.com/go-delve/delve/pkg/proc/internal/ebpf\"\n)\n\nvar (\n\t// ErrNotRecorded is returned when an action is requested that is\n\t// only possible on recorded (traced) programs.\n\tErrNotRecorded = errors.New(\"not a recording\")\n\n\t// ErrNoRuntimeAllG is returned when the runtime.allg list could\n\t// not be found.\n\tErrNoRuntimeAllG = errors.New(\"could not find goroutine array\")\n\n\t// ErrProcessDetached indicates that we detached from the target process.\n\tErrProcessDetached = errors.New(\"detached from the process\")\n)\n\ntype LaunchFlags uint8\n\nconst (\n\tLaunchForeground LaunchFlags = 1 << iota\n\tLaunchDisableASLR\n)\n\n// Target represents the process being debugged.\ntype Target struct {\n\tProcess\n\n\tproc   ProcessInternal\n\trecman RecordingManipulationInternal","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/target.go#L7-L43","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Rebuild the target binary without symbol stripping (-s -w removed)","Use a delve version compatible with the Go version the binary was built with","Verify the binary is actually Go and built with debug info","Use 'info sources'/symbol checks to confirm runtime symbols resolved"],"exampleFix":"// before\ngo build -ldflags=\"-s -w\" main.go   // stripped: runtime.allg unresolvable\n// after\ngo build -gcflags=\"all=-N -l\" main.go  // keep symbols for debugging","handlingStrategy":"validation","validationCode":"// ensure binary has symbols before attach\nif _, err := debug.PrintStackCheck(binaryPath); err != nil { /* stripped? */ }\nout, _ := exec.Command(\"go\", \"version\", \"-m\", binaryPath).Output()","typeGuard":null,"tryCatchPattern":"_, err := dbg.Process().BinInfo().FindFunction(\"runtime.allglen\")\nif errors.Is(err, proc.ErrNoRuntimeAllG) {\n    return fmt.Errorf(\"target lacks Go runtime symbols; rebuild without -s -w\")\n}","preventionTips":["Build debug targets without symbol stripping","Keep delve and Go versions aligned","Verify goroutine listing works right after attach (sanity check)"],"tags":["go","runtime","goroutines","symbols"],"backgroundTag":"runtime-symbol-not-found","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}