{"record":{"id":"3215ea349ff7c998","repo":"go-delve/delve","slug":"procstat-getprocs-returned-no-processes","errorCode":null,"errorMessage":"procstat_getprocs returned no processes","messagePattern":"procstat_getprocs returned no processes","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/native/proc_freebsd.go","lineNumber":597,"sourceCode":"\treturn ptraceDetach(dbp.pid)\n}\n\n// EntryPoint returns the entry point address of the process.\nfunc (dbp *nativeProcess) EntryPoint() (uint64, error) {\n\tps, err := C.procstat_open_sysctl()\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"procstat_open_sysctl failed: %v\", err)\n\t}\n\tdefer C.procstat_close(ps)\n\n\tvar count C.uint\n\tkipp, err := C.procstat_getprocs(ps, C.KERN_PROC_PID, C.int(dbp.pid), &count)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"procstat_getprocs failed: %v\", err)\n\t}\n\tdefer C.procstat_freeprocs(ps, kipp)\n\tif count == 0 {\n\t\treturn 0, errors.New(\"procstat_getprocs returned no processes\")\n\t}\n\n\tauxv, err := C.procstat_getauxv(ps, kipp, &count)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"procstat_getauxv failed: %v\", err)\n\t}\n\tdefer C.procstat_freeauxv(ps, auxv)\n\n\tfor i := 0; i < int(count); i++ {\n\t\tif auxv.a_type == C.AT_ENTRY {\n\t\t\treturn uint64(C.elf_aux_info_ptr(auxv)), nil\n\t\t}\n\t\tauxv = (*C.Elf_Auxinfo)(unsafe.Pointer(uintptr(unsafe.Pointer(auxv)) + unsafe.Sizeof(*auxv)))\n\t}\n\treturn 0, errors.New(\"entry point not found\")\n}\n\nfunc (dbp *nativeProcess) SupportsBPF() bool {","sourceCodeStart":579,"sourceCodeEnd":615,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/native/proc_freebsd.go#L579-L615","documentation":"On FreeBSD, EntryPoint() uses libprocstat (procstat_getprocs) to find the process by PID and read its ELF auxiliary vector. This error means procstat_getprocs succeeded structurally but returned zero process entries, i.e. no process matching dbp.pid exists at that moment. Without the process record, the auxv (and thus the entry point) cannot be read.","triggerScenarios":"Calling EntryPoint (invoked during debugger setup, e.g. when locating breakpoints or the entry point for a launch) with a pid that no longer exists or is not visible to the current user.","commonSituations":"Target exited between launch and the EntryPoint call; attaching to a process owned by another user or with restricted permissions; PID reuse/mismatch; running inside a jail restricting proc visibility.","solutions":["Verify the process with the given pid is alive: `procstat -i <pid>` or `ps -p <pid>`.","Re-launch the debug session; the target likely exited prematurely.","Run delve as root or check kern.securelevel / jail visibility settings if the process exists but is not visible.","Confirm you are on a supported FreeBSD version where procstat_getauxv is available."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// FreeBSD: check the process exists before EntryPoint-dependent operations\nif _, err := os.Stat(fmt.Sprintf(\"/proc/%d\", pid)); err == nil {\n\t// linux-style /proc may not exist on FreeBSD; use procstat\n}\nout, err := exec.Command(\"procstat\", \"-i\", strconv.Itoa(pid)).Output()\nif err != nil {\n\treturn fmt.Errorf(\"pid %d not visible: %w\", pid, err)\n}","typeGuard":"func isNoProcesses(err error) bool {\n\treturn err != nil && strings.Contains(err.Error(), \"procstat_getprocs returned no processes\")\n}","tryCatchPattern":"if err := startDebug(); err != nil {\n\tif strings.Contains(err.Error(), \"procstat_getprocs returned no processes\") {\n\t\t// target exited; re-launch instead of attach\n\t\treturn relaunchTarget()\n\t}\n\treturn err\n}","preventionTips":["Check pid liveness with `procstat -i <pid>` before attaching on FreeBSD.","Run delve with sufficient privileges to see the target process.","Avoid debugging inside jails that restrict process visibility.","Handle the case where the target exits during startup races."],"tags":["freebsd","process","debugging","freebsd"],"backgroundTag":"process-not-found","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}