{"record":{"id":"63326c105b386611","repo":"go-delve/delve","slug":"entry-point-not-found","errorCode":null,"errorMessage":"entry point not found","messagePattern":"entry point not found","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/native/proc_freebsd.go","lineNumber":612,"sourceCode":"\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 {\n\treturn false\n}\n\nfunc (dbp *nativeProcess) SetUProbe(fnName string, goidOffset int64, args []ebpf.UProbeArgMap) error {\n\tpanic(\"not implemented\")\n}\n\nfunc (dbp *nativeProcess) GetBufferedTracepoints() []ebpf.RawUProbeParams {\n\tpanic(\"not implemented\")\n}\n\nfunc (dbp *nativeProcess) ptraceCont(sig int) error {\n\tvar err error\n\tdbp.execPtraceFunc(func() { err = ptraceCont(dbp.pid, sig) })\n\treturn err","sourceCodeStart":594,"sourceCodeEnd":630,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/native/proc_freebsd.go#L594-L630","documentation":"On FreeBSD, EntryPoint() scans the ELF auxiliary vector (auxv) returned by procstat_getauxv looking for the AT_ENTRY tag, which holds the program entry point address. This error means the auxv was read but no AT_ENTRY entry was present. Delve needs this address to support entry-point-based operations, so it fails hard.","triggerScenarios":"EntryPoint() on FreeBSD iterating the entire auxv array of the target process without ever seeing a_type == AT_ENTRY, which happens when the kernel/libprocstat does not supply AT_ENTRY (e.g. unusual exec path, vmm/linux binary emulation, or stripped auxv).","commonSituations":"Debugging non-native binaries under emulation layers that produce incomplete auxv; old FreeBSD versions where procstat_getauxv omits some tags; debuggee executed via wrappers that alter auxv.","solutions":["Check FreeBSD version and update the system; newer releases expose fuller auxv via procstat.","Inspect the process auxv manually (`procstat -e <pid>`) to confirm AT_ENTRY is present.","If entry point can't be obtained, derive it from the ELF binary header instead (parse the e_entry of the executable).","Update delve; alternate entry-point discovery may exist in newer versions."],"exampleFix":"// before\nreturn 0, errors.New(\"entry point not found\")\n// after\n// fallback: read entry point from the ELF file header\nf, err := elf.Open(dbp.bi.BinaryPath())\nif err != nil {\n\treturn 0, err\n}\ndefer f.Close()\nreturn f.Entry, nil","handlingStrategy":"fallback","validationCode":"// inspect auxv for AT_ENTRY before relying on EntryPoint()\nout, err := exec.Command(\"procstat\", \"-e\", strconv.Itoa(pid)).Output()\nif err != nil || !bytes.Contains(out, []byte(\"AT_ENTRY\")) {\n\t// auxv lacks AT_ENTRY; use ELF header fallback\n}","typeGuard":"func isEntryPointNotFound(err error) bool {\n\treturn err != nil && err.Error() == \"entry point not found\"\n}","tryCatchPattern":"ep, err := proc.EntryPoint()\nif err != nil && err.Error() == \"entry point not found\" {\n\t// fallback: read from ELF\n\tf, _ := elf.Open(binaryPath)\n\tep = f.Entry\n}","preventionTips":["Prefer computing the entry point from the ELF header as a portable fallback.","Verify the debuggee is a native FreeBSD ELF binary (not emulated).","Check `procstat -e <pid>` shows AT_ENTRY before entry-point-dependent features.","Keep FreeBSD and delve versions current."],"tags":["freebsd","elf","auxv","debugging"],"backgroundTag":"entry-point-not-found","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}