{"record":{"id":"a9333a98cfa4fc1a","repo":"go-delve/delve","slug":"could-not-find-rodata-struct-member","errorCode":null,"errorMessage":"could not find rodata struct member","messagePattern":"could not find rodata struct member","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/bininfo.go","lineNumber":1818,"sourceCode":"\terr := binary.Write(buf, binary.LittleEndian, &roDataAddr)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\t// Here we search for the value of `go.func.*` by searching through the raw bytes of the\n\t// runtime.moduledata structure. Since we don't know the value that we are looking for,\n\t// we use a known value, in this case the address of the .rodata section.\n\t// This is because in the layout of the struct, the rodata member is right next to\n\t// the value we need, making the math trivial once we find that member.\n\t// We use `bytes.LastIndex` specifically because the `types` struct member can also\n\t// contain the address of the .rodata section, so this pointer can appear multiple times\n\t// in the raw bytes.\n\t// Yes, this is very ill-advised low-level hackery but it works fine until\n\t// https://github.com/golang/go/issues/58474#issuecomment-1785681472 happens.\n\t// This code path also only runs in stripped binaries, so the whole implementation is\n\t// best effort anyways.\n\trodata := bytes.LastIndex(moduleData, buf.Bytes()[:ptrsize])\n\tif rodata == -1 {\n\t\treturn 0, errors.New(\"could not find rodata struct member\")\n\t}\n\t// Layout of struct members is:\n\t// type moduledata struct {\n\t// \t...\n\t// \trodata uintptr\n\t// \tgofunc uintptr\n\t// \t...\n\t// }\n\t// So do some pointer arithmetic to get the value we need.\n\tgofuncval := binary.LittleEndian.Uint64(moduleData[rodata+(1*ptrsize) : rodata+(2*ptrsize)])\n\treturn gofuncval, nil\n}\n\nfunc parseModuleData(dataSection []byte, tableAddr uint64) ([]byte, error) {\n\tbuf := new(bytes.Buffer)\n\terr := binary.Write(buf, binary.LittleEndian, &tableAddr)\n\tif err != nil {\n\t\treturn nil, err","sourceCodeStart":1800,"sourceCodeEnd":1836,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/bininfo.go#L1800-L1836","documentation":"Error \"could not find rodata struct member\" thrown in go-delve/delve.","triggerScenarios":"Thrown at pkg/proc/bininfo.go:1818 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}