{"record":{"id":"c6ba8b9a8cb0ad31","repo":"go-delve/delve","slug":"found-section-but-could-not-read-gopclntab-c6ba8b","errorCode":null,"errorMessage":"found section but could not read __gopclntab","messagePattern":"found section but could not read __gopclntab","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/pclntab.go","lineNumber":49,"sourceCode":"\tlineTable := gosym.NewLineTable(tableData, addr)\n\tsymTable, err := gosym.NewTable([]byte{}, lineTable)\n\tif err != nil {\n\t\treturn nil, 0, fmt.Errorf(\"could not create symbol table from  %s \", path)\n\t}\n\treturn symTable, section.Addr, nil\n}\n\nfunc readPcLnTableMacho(exe *macho.File, path string) (*gosym.Table, uint64, error) {\n\t// Default section label is __gopclntab\n\tsectionLabel := \"__gopclntab\"\n\n\tsection := exe.Section(sectionLabel)\n\tif section == nil {\n\t\treturn nil, 0, errors.New(\"could not read section __gopclntab\")\n\t}\n\ttableData, err := section.Data()\n\tif err != nil {\n\t\treturn nil, 0, errors.New(\"found section but could not read __gopclntab\")\n\t}\n\n\taddr := exe.Section(\"__text\").Addr\n\tlineTable := gosym.NewLineTable(tableData, addr)\n\tsymTable, err := gosym.NewTable([]byte{}, lineTable)\n\tif err != nil {\n\t\treturn nil, 0, fmt.Errorf(\"could not create symbol table from  %s \", path)\n\t}\n\treturn symTable, section.Addr, nil\n}\n","sourceCodeStart":31,"sourceCodeEnd":60,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/pclntab.go#L31-L60","documentation":"The __gopclntab section header exists in the Mach-O file but its data could not be read via section.Data(), indicating a corrupted, truncated, or malformed binary where section offsets do not resolve to valid file bytes.","triggerScenarios":"loadBinaryInfoGoRuntimeMacho -> readPcLnTableMacho on a truncated download, a Mach-O modified by post-processing tools, or a binary whose section offsets/sizes are inconsistent.","commonSituations":"Incomplete file transfers; binaries repackaged by code-signing or obfuscation tools; corrupted artifacts in CI caches.","solutions":["Rebuild or re-download the binary and verify its checksum","Inspect with otool -l to confirm __gopclntab offset and size are within the file","Remove post-processing tools that rewrite Mach-O sections","Confirm the file is not a fat-binary slice extracted incorrectly"],"exampleFix":"// before\ndlv exec ./truncated-app // incomplete copy\n// after\ncodesign --verify / checksum-verify ./app && dlv exec ./app","handlingStrategy":"validation","validationCode":"fi, err := os.Stat(path)\nif err != nil || fi.Size() == 0 {\n    return fmt.Errorf(\"binary missing or empty: %s\", path)\n}\n// verify integrity before loading\n// shasum -a 256 app == expected","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"found section but could not read __gopclntab\") {\n    return fmt.Errorf(\"Mach-O file appears corrupted/truncated: %w\", err)\n}","preventionTips":["Checksum-verify macOS binaries before opening in delve","Avoid re-signing/repackaging tools that rewrite Mach-O sections","Re-download corrupted artifacts from source"],"tags":["macos","macho","corrupt-binary"],"backgroundTag":"missing-pclntab-section","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}