Skip to content

Fix k8s tentacle multi-arch Docker build crash under QEMU - #1276

Merged
LukeButters merged 1 commit into
mainfrom
luke/fix-k8s-tentacle-multiarch-build-qemu-crash
Aug 3, 2026
Merged

Fix k8s tentacle multi-arch Docker build crash under QEMU#1276
LukeButters merged 1 commit into
mainfrom
luke/fix-k8s-tentacle-multiarch-build-qemu-crash

Conversation

@LukeButters

Copy link
Copy Markdown
Contributor

Summary

  • The nightly Kubernetes Tentacle Multi-Arch Docker image build (9.2.4233-main-nightly) was failing with Go compiler panics (fatal error: found pointer to free object, panic: runtime error: growslice: len out of range) while building the bootstraprunnerbuilder stage.
  • Root cause: docker buildx build --platform linux/arm64,linux/amd64 ... runs the golang:1.26 builder stage under QEMU emulation for the non-native target platform (arm64 on the amd64 build agent). The stage only needs GOOS/GOARCH cross-compilation, never execution of foreign-arch code, but without a platform pin buildx still runs the compiler itself under QEMU — a known source of Go runtime memory-corruption crashes.
  • Fix: pin the builder stage to --platform=$BUILDPLATFORM (Docker's standard pattern for Go cross-compile stages) so go build always runs natively on the build host and cross-compiles via GOARCH, in both docker/kubernetes-agent-tentacle/Dockerfile and the equivalent dev/Dockerfile.

Test plan

  • Rebuilt the bootstraprunnerbuilder stage locally via docker buildx build --target bootstraprunnerbuilder for a foreign target platform, confirming it builds successfully and produces all bootstrapRunner-linux-{amd64,arm64,386,arm} binaries.
  • Re-run the nightly Kubernetes Tentacle Multi-Arch Docker image build on TeamCity to confirm the arm64-on-amd64 crash is resolved (couldn't reproduce the exact amd64-host/arm64-QEMU crash locally since my dev machine is arm64).

🤖 Generated with Claude Code

The multi-arch k8s tentacle build was crashing with Go compiler
panics (fatal error: found pointer to free object / growslice: len
out of range) when building the arm64 image on an amd64 agent,
because the golang builder stage ran under QEMU emulation instead of
natively. The stage only cross-compiles via GOOS/GOARCH, so pinning
it to --platform=$BUILDPLATFORM keeps go build running natively and
avoids the emulated crash.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@LukeButters
LukeButters requested a review from a team as a code owner August 3, 2026 03:46
@LukeButters
LukeButters requested a review from APErebus August 3, 2026 04:37

@APErebus APErebus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Thanks

@LukeButters
LukeButters merged commit b03d084 into main Aug 3, 2026
53 checks passed
@LukeButters
LukeButters deleted the luke/fix-k8s-tentacle-multiarch-build-qemu-crash branch August 3, 2026 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants