{"record":{"id":"67bb4c342032e559","repo":"golang/go","slug":"subprogram-die-high-pc-unknown-value-class-s","errorCode":null,"errorMessage":"subprogram DIE high_pc unknown value class %s","messagePattern":"subprogram DIE high_pc unknown value class (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd/link/internal/dwtest/dwtest.go","lineNumber":248,"sourceCode":"\t\treturn\n\t}\n\tswitch hifield.Class {\n\tcase dwarf.ClassAddress:\n\t\tif hipc, ok := hifield.Val.(uint64); ok {\n\t\t\thi = hipc\n\t\t} else {\n\t\t\terr = fmt.Errorf(\"subprogram DIE high not convertible to uint64\")\n\t\t\treturn\n\t\t}\n\tcase dwarf.ClassConstant:\n\t\tif hioff, ok := hifield.Val.(int64); ok {\n\t\t\thi = lo + uint64(hioff)\n\t\t} else {\n\t\t\terr = fmt.Errorf(\"subprogram DIE high_pc not convertible to uint64\")\n\t\t\treturn\n\t\t}\n\tdefault:\n\t\terr = fmt.Errorf(\"subprogram DIE high_pc unknown value class %s\",\n\t\t\thifield.Class)\n\t}\n\treturn\n}\n","sourceCodeStart":230,"sourceCodeEnd":253,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/src/cmd/link/internal/dwtest/dwtest.go#L230-L253","documentation":"In the Go linker's DWARF validation (dwtest), this error fires when a subprogram DIE's high_pc attribute has a DWARF class that is neither ClassAddress nor ClassConstant. The DWARF standard only permits these two forms for high_pc. Any other class (e.g. ClassExprLoc, ClassBlock, ClassStrp) indicates non-conformant or experimental DWARF data.","triggerScenarios":"The dwtest validator's switch on hifield.Class falls through to the default case, printing the actual class name via the %s format verb. This happens when a DWARF producer emits an unsupported encoding form for the high_pc attribute.","commonSituations":"Object files produced by a non-Go compiler linked via cgo that emits non-standard DWARF; experimental Go toolchain changes that introduce new DWARF classes; corrupted or truncated DWARF sections in object files.","solutions":["Report as a Go toolchain issue with the class name and reproducer","Clean rebuild from scratch: go clean -cache && go build","If using cgo, check whether C object files have non-standard DWARF (strip debug info from C objects with -s if needed)","Try a different Go version to isolate the regression"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Validate high_pc class before processing\nfunc isValidHighPCClass(c dwarf.Class) bool {\n    return c == dwarf.ClassAddress || c == dwarf.ClassConstant\n}\n\n// Usage:\nfield := die.AttrField(dwarf.AttrHighpc)\nif field != nil && !isValidHighPCClass(field.Class) {\n    log.Printf(\"unsupported high_pc class %s, skipping\", field.Class)\n    continue\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Strip DWARF info from C object files if they produce non-standard classes: use -s flag for C compilation","Validate DWARF classes before processing rather than assuming standard forms","Report non-standard DWARF classes to identify which producer is responsible"],"tags":["dwarf","linker","go-toolchain","debugging","dwarf-class"],"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-12T08:17:17.861Z"}