-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Problem Description
The current parca-debuginfo buildid command only recognizes GNU build IDs stored in the .note.gnu.build-id ELF section. However, Go binaries store their build IDs in a different section called .note.go.buildid, which causes the tool to report "no build ID" even when a valid Go build ID is present.
Current Behavior
$ ./dist/parca-debuginfo buildid ./dist/parca-debuginfo
get Build ID for "./dist/parca-debuginfo": no build IDHowever, the Go build ID is clearly present:
$ file ./dist/parca-debuginfo
./dist/parca-debuginfo: ELF 64-bit LSB executable, x86-64, version 1 (SYSV) ... Go BuildID=evv_okEzTtx4_0g2pG2aj/9GRgoRTKMyH5iavG2Hnz/FFkCniZ_jhbHSO9rY_9q/TFnE3V1_jFBYBfy-V8Xm ...
$ go tool buildid ./dist/parca-debuginfo
evv_okEzTtx4_0g2pG2aj/9GRgoRTKMyH5iavG2Hnz/FFkCniZ_jhbHSO9rY_9q/TFnE3V1_jFBYBfy-V8XmRoot Cause
The GetBuildID() function in cmd/parca-debuginfo/main.go:518-528 only looks for build IDs in:
.note.gnu.build-idsection (GNU build ID).notessection (fallback)
But Go binaries store their build IDs in .note.go.buildid section instead.
Proposed Solution
I would like to enhance the GetBuildID() function to also check for Go build IDs when GNU build IDs are not found. This would involve:
- Adding support to read from
.note.go.buildidsection - Parsing the Go build ID format (which is different from GNU format)
- Maintaining backward compatibility with existing GNU build ID support
Benefits
- Better support for Go binaries in the Parca ecosystem
- More comprehensive build ID detection
- No breaking changes to existing functionality
- Improved user experience for Go developers using parca-debuginfo
Would you be open to accepting a pull request that adds Go build ID support to the buildid
Metadata
Metadata
Assignees
Labels
No labels