Skip to content

agent binary GNU build-ID is constant across different builds — breaks profile symbolization by build-ID #651

Closed

Description

@bpalermo

Summary

The agent binary's GNU build-ID does not change across builds. Two consecutively released agent images contain provably different binaries with the identical .note.gnu.build-id:

image digest binary sha256 size GNU build-ID
agent@sha256:f91ccf74… (rev 187 fleet) c07da793… 63,045,794 B 498919aff001d8366249403a2544fba2d833084f
agent@sha256:20f235e6… (rev 188 fleet, includes #647/#650) 422b9bf0… 63,111,330 B 498919aff001d8366249403a2544fba2d833084f

A content-derived build-ID (sha1 over the link) cannot collide across different contents — so whatever is producing this note is stamping a constant (or something derived from inputs that don't include the code).

Why it matters

The eBPF profiling pipeline (Pyroscope symbolizer, 2026-08-30) joins samples to symbols solely by GNU build-ID. With a stable-across-builds ID:

  • uploading symbols for build N means build N+1's samples silently symbolize against build N's offsets → misattributed frames (the worst failure mode: wrong names, no error);
  • there is no way to keep symbols for two agent builds side by side.

Found during the rev-188 deploy: the fresh symbol upload for the new agent binary was declined as "already exists", and the pre-existing upload (from the rev-187 binary) would have served wrong offsets for the running fleet. Mitigated operationally by deleting the uploaded debuginfo for 498919af… (Go frames self-symbolize in the profiler via pclntab, so only residual native/runtime-stub frames went back to hex — honest beats wrong).

Scope

  • Affects the agent multi-call binary (agent / mesh-dns / supervisor comms — one ELF). Presumably all Go binaries in the repo built the same way (mesh-dns standalone, registrar, controller, cni) — verify.
  • The proxy (envoy) binary is fine: its build-ID differs per build (md5-uuid from the hermetic LLVM toolchain today). The related hardening from the symbolization plan — pinning --build-id=sha1 explicitly in proxy/.bazelrc — is still open and can ride along here.

Where to look

rules_go link step: whether the external/internal linker gets a -B/--build-id flag and from what. Candidates: a stamped constant that doesn't vary, a toolchain default computing over stripped/stamp-independent inputs, or rules_go's reproducibility machinery pinning the note. Desired end state: build-ID = content hash of the link output (--build-id=sha1 semantics) for every released binary, plus (nice-to-have) a CI assertion that two different release binaries never share a build-ID — cheap to check against the previous release's manifest.

Acceptance

  • Rebuild after any code change ⇒ new GNU build-ID on the agent binary.
  • Symbol upload for a new release is accepted (not declined as duplicate).
  • CI guard in place (or documented decision not to).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions