{"record":{"id":"d40215fd0863f315","repo":"golang/go","slug":"subprogram-die-high-not-convertible-to-uint64","errorCode":null,"errorMessage":"subprogram DIE high not convertible to uint64","messagePattern":"subprogram DIE high not convertible to uint64","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd/link/internal/dwtest/dwtest.go","lineNumber":237,"sourceCode":"\t\tlo = lopc\n\t} else {\n\t\terr = fmt.Errorf(\"subprogram DIE low_pc not convertible to uint64\")\n\t\treturn\n\t}\n\n\t// For the high_pc value, we'll accept either an address or a constant\n\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":219,"sourceCodeEnd":253,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/src/cmd/link/internal/dwtest/dwtest.go#L219-L253","documentation":"In the Go linker's internal DWARF validation module (dwtest), this error fires when a subprogram DIE's high_pc attribute is classified as ClassAddress (a direct address) but its underlying value fails the uint64 type assertion. Per the DWARF standard, a ClassAddress high_pc must hold an address-sized unsigned integer. A non-uint64 value means the DWARF producer emitted malformed or unexpected debug information.","triggerScenarios":"The dwtest validator calls subprogdie.AttrField(dwarf.AttrHighpc), inspects hifield.Class, and when Class == dwarf.ClassAddress performs hifield.Val.(uint64). If the type assertion fails (the value is e.g. int64, int, or another type), this error is returned immediately.","commonSituations":"A bug in the Go compiler or linker DWARF emission pipeline; linking object files compiled by mismatched Go versions that emit different DWARF attribute types; using an experimental or development Go toolchain with incomplete DWARF changes.","solutions":["Report the issue at https://github.com/golang/go/issues with the full linker flags, GOOS/GOARCH, and a reproducer","Clean the build cache and rebuild from scratch: go clean -cache && go build","Ensure all packages and their dependencies are compiled with the same Go version","If cross-compiling, verify the target platform is fully supported by the toolchain version"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"// Type guard for DWARF high_pc ClassAddress value\nfunc isHighPCAddressValue(v interface{}) bool {\n    _, ok := v.(uint64)\n    return ok\n}","tryCatchPattern":"// Wrap DWARF validation with graceful error handling\nhi, err := validateHighPC(subprogdie, lo)\nif err != nil {\n    log.Printf(\"DWARF validation warning: %v — skipping DIE\", err)\n    continue // skip this DIE rather than abort\n}","preventionTips":["Use the same Go version for all compilation units in a build","Run go clean -cache when switching Go versions","Report DWARF validation failures to the Go project — they indicate toolchain bugs"],"tags":["dwarf","linker","go-toolchain","debugging","type-assertion"],"backgroundTag":null,"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}