{"record":{"id":"04126d5e9279e4f0","repo":"golang/go","slug":"subprogram-die-high-pc-not-convertible-to-uint64","errorCode":null,"errorMessage":"subprogram DIE high_pc not convertible to uint64","messagePattern":"subprogram DIE high_pc not convertible to uint64","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd/link/internal/dwtest/dwtest.go","lineNumber":244,"sourceCode":"\t// offset from lo pc.\n\thifield := subprogdie.AttrField(dwarf.AttrHighpc)\n\tif hifield == nil {\n\t\terr = fmt.Errorf(\"subprogram DIE has no high_pc attr\")\n\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":226,"sourceCodeEnd":253,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/src/cmd/link/internal/dwtest/dwtest.go#L226-L253","documentation":"In the Go linker's DWARF validation (dwtest), this error fires when a subprogram DIE's high_pc attribute is classified as ClassConstant (a constant offset relative to low_pc) but its value fails the int64 type assertion. The DWARF standard specifies ClassConstant high_pc as a signed offset from the low_pc address; a non-int64 value indicates malformed debug info.","triggerScenarios":"The dwtest validator checks hifield.Class == dwarf.ClassConstant, then performs hifield.Val.(int64). If the assertion fails because the value is uint64, int, or another type, the error is returned. The intended computation is hi = lo + uint64(hioff).","commonSituations":"Linker bug in DWARF constant-offset emission; object files from a different Go version that uses a different integer type for DWARF constants; DWARF producer that emits unsigned constants where signed are expected.","solutions":["Report as a Go toolchain bug with reproducer at https://github.com/golang/go/issues","Clean rebuild: go clean -cache && go build","Verify all transitively imported packages were compiled with the same Go toolchain","Try a stable Go release if using a development version"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"// Type guard for DWARF high_pc ClassConstant value\nfunc isHighPCConstantValue(v interface{}) bool {\n    _, ok := v.(int64)\n    return ok\n}","tryCatchPattern":"// Handle the constant-offset high_pc case gracefully\nswitch hifield.Class {\ncase dwarf.ClassConstant:\n    hioff, ok := hifield.Val.(int64)\n    if !ok {\n        log.Printf(\"unexpected high_pc constant type: %T\", hifield.Val)\n        continue\n    }\n    hi = lo + uint64(hioff)\n}","preventionTips":["Keep Go toolchain versions consistent across all build steps","Avoid mixing object files from different Go versions","Clean the build cache when upgrading Go"],"tags":["dwarf","linker","go-toolchain","debugging","type-assertion"],"backgroundTag":null,"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-12T12:31:55.035Z"}