golang/go · error
subprogram DIE high_pc unknown value class %s
Error message
subprogram DIE high_pc unknown value class %s
What it means
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.
Source
Thrown at src/cmd/link/internal/dwtest/dwtest.go:248
return
}
switch hifield.Class {
case dwarf.ClassAddress:
if hipc, ok := hifield.Val.(uint64); ok {
hi = hipc
} else {
err = fmt.Errorf("subprogram DIE high not convertible to uint64")
return
}
case dwarf.ClassConstant:
if hioff, ok := hifield.Val.(int64); ok {
hi = lo + uint64(hioff)
} else {
err = fmt.Errorf("subprogram DIE high_pc not convertible to uint64")
return
}
default:
err = fmt.Errorf("subprogram DIE high_pc unknown value class %s",
hifield.Class)
}
return
}
View on GitHub (pinned to b6b368adc5)
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
Defensive patterns
Strategy: validation
Validate before calling
// Validate high_pc class before processing
func isValidHighPCClass(c dwarf.Class) bool {
return c == dwarf.ClassAddress || c == dwarf.ClassConstant
}
// Usage:
field := die.AttrField(dwarf.AttrHighpc)
if field != nil && !isValidHighPCClass(field.Class) {
log.Printf("unsupported high_pc class %s, skipping", field.Class)
continue
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- subprogram DIE high not convertible to uint64
- subprogram DIE high_pc not convertible to uint64
- no DWARF data in go object file
- no DWARF data in Plan 9 file
- missing __LINKEDIT segment
AI-assisted analysis of golang/go@b6b368adc5 (2026-08-12).
Data as JSON: /api/errors/67bb4c342032e559.
Report an issue: GitHub.