{"record":{"id":"1fa0819f4fc0c921","repo":"golang/go","slug":"dwarf-unsupported-attribute-form-d-class-d","errorCode":null,"errorMessage":"dwarf: unsupported attribute form %d / class %d","messagePattern":"dwarf: unsupported attribute form (.+?) / class (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd/internal/dwarf/dwarf.go","lineNumber":995,"sourceCode":"\t\tif data == nil {\n\t\t\treturn fmt.Errorf(\"dwarf: null reference in %d\", abbrev)\n\t\t}\n\t\tctxt.AddDWARFAddrSectionOffset(s, data, value)\n\n\tcase DW_FORM_addrx: // index into .debug_addr section\n\t\tctxt.AddIndirectTextRef(s, data)\n\n\tcase DW_FORM_ref1, // reference within the compilation unit\n\t\tDW_FORM_ref2,      // reference\n\t\tDW_FORM_ref4,      // reference\n\t\tDW_FORM_ref8,      // reference\n\t\tDW_FORM_ref_udata, // reference\n\n\t\tDW_FORM_strp,     // string\n\t\tDW_FORM_indirect: // (see Section 7.5.3)\n\t\tfallthrough\n\tdefault:\n\t\treturn fmt.Errorf(\"dwarf: unsupported attribute form %d / class %d\", form, cls)\n\t}\n\treturn nil\n}\n\n// PutAttrs writes the attributes for a DIE to symbol 's'.\n//\n// Note that we can (and do) add arbitrary attributes to a DIE, but\n// only the ones actually listed in the Abbrev will be written out.\nfunc PutAttrs(ctxt Context, s Sym, abbrev int, attr *DWAttr) {\n\tabbrevs := Abbrevs()\nOuter:\n\tfor _, f := range abbrevs[abbrev].attr {\n\t\tfor ap := attr; ap != nil; ap = ap.Link {\n\t\t\tif ap.Atr == f.attr {\n\t\t\t\tputattr(ctxt, s, abbrev, int(f.form), int(ap.Cls), ap.Value, ap.Data)\n\t\t\t\tcontinue Outer\n\t\t\t}\n\t\t}","sourceCodeStart":977,"sourceCodeEnd":1013,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/src/cmd/internal/dwarf/dwarf.go#L977-L1013","documentation":"Returned by putattr's default case when an attribute form/class pair is not handled by any explicit case in the switch (DW_FORM_strp and DW_FORM_indirect fall through to this default). The emitter only knows how to encode a fixed set of DWARF forms; anything else (form value or class value outside the supported matrix) is rejected to avoid emitting invalid DWARF.","triggerScenarios":"The DWARF abbreviation for a DIE declares a form (e.g. DW_FORM_strx, DW_FORM_implicit_const, DW_FORM_line_strp) or a form/class combination that putattr does not implement. Like error 1235 this is an internal toolchain state mismatch, not a user-facing input.","commonSituations":"Tip/beta compiler builds with DWARF 5 experiments, third-party or in-progress patches that add forms without emitter support, or unusual compiler-generated abbreviations. Rare in released toolchains.","solutions":["Switch to a released Go toolchain — unsupported forms should not reach here in stable versions.","Report the failing package + `go version -m` at https://go.dev/issue.","Build with `-gcflags=-d=dwarf=false` or `-ldflags=-w` to bypass DWARF emission while the bug is fixed upstream.","Bisect on toolchain version to identify the introducing change."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin to a stable Go release.","Disable DWARF with -ldflags=-w or -gcflags=-d=dwarf=false when triaging.","Bisect toolchain versions to find regressions and report them."],"tags":["dwarf","compiler","debug-info","internal"],"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-12T12:17:08.281Z"}