Text of github.com › golang › go › issues › 77572 as Styx crawled it on Nov 18, 2026. The page may have changed since. Only its words are kept, without pictures or layout, and only the first part of a long page.

Open the live page

runtime: fatal error: found bad pointer in Go heap when compiling on amd64 host for arm64 (QEMU) · Issue #77572 · golang/go · GitHub

Skip to content You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert runtime: fatal error: found bad pointer in Go heap when compiling on amd64 host for arm64 (QEMU) #77572 New issue Copy link New issue Copy link Closed as not planned Closed as not planned runtime: fatal error: found bad pointer in Go heap when compiling on amd64 host for arm64 (QEMU) #77572 Copy link Labels BugReport Issues describing a possible bug in the Go implementation.

Issues describing a possible bug in the Go implementation. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. compiler/runtime Issues related to the Go compiler and/or runtime. Issues related to the Go compiler and/or runtime. Description egonelbre opened on Feb 12, 2026 Issue body actions Update(2026-02-18): This is a QEMU bug, which is fixed in the new versions of QEMU.

QEMU 10.0.6+ is known to work. 7.1.0+ may also work. For users with an older version of QEMU, there is a workaround on the Go side: set GODEBUG=madvdontneed=0 . This splits off the QEMU emulation issue from #74552 (comment) . When running go install on amd64 host with qemu arm64 emulation it seems to crash. #27 [linux/arm64 tools 4/4] RUN --mount=type=cache,target=/root/.cache/go-build,id=gobuild --mount=type=cache,target=/go/pkg/mod,id=gopkg go install ./... #27 0.888 runtime: pointer 0x39d8218b4000 to unallocated span span.base()=0x39d8218c0000 span.limit=0x39d8218c1ec0 span.state=0 #27 0.896 fatal error: found bad pointer in Go heap (incorrect use of unsafe or cgo?) #27 0.901 #27 0.901 runtime stack: #27 0.903 runtime.throw({0x71ec51?, 0x49e000?}) #27 0.904 runtime/panic.go:1229 +0x38 fp=0x39d821579ea0 sp=0x39d821579e70 pc=0x93918 #27 0.905 runtime.badPointer(0x554740a080, 0x39d8218b4000, 0x0, 0x0) #27 0.905 runtime/mbitmap.go:1334 +0x128 fp=0x39d821579ef0 sp=0x39d821579ea0 pc=0x330f8 #27 0.906 runtime.findObject(0x39d8218a4000?, 0x55475485a8?, 0x39d8217bbc20?) #27 0.906 runtime/mbitmap.go:1386 +0xac fp=0x39d821579f30 sp=0x39d821579ef0 pc=0x9213c #27 0.906 runtime.wbBufFlush1(0x39d821311808) #27 0.906 runtime/mwbbuf.go:243 +0x120 fp=0x39d821579fa0 sp=0x39d821579f30 pc=0x56cb0 #27 0.906 runtime.wbBufFlush.func1() #27 0.906 runtime/mwbbuf.go:181 +0x24 fp=0x39d821579fc0 sp=0x39d821579fa0 pc=0x8e8f4 #27 0.906 runtime.systemstack(0x39d821576000) #27 0.906 runtime/asm_arm64.s:399 +0x68 fp=0x39d821579fd0 sp=0x39d821579fc0 pc=0x992a8 #27 0.907 and #24 1.163 runtime: marked free object in span 0x55474772a8, elemsize=128 freeindex=1 (bad use of unsafe.Pointer or having race conditions? try -d=checkptr or -race) #24 1.172 0x7b979736000 alloc unmarked #24 1.177 0x7b979736080 free unmarked #24 1.178 0x7b979736100 free unmarked #24 1.178 0x7b979736180 free unmarked #24 1.178 0x7b979736200 free unmarked ... #24 1.181 fatal error: found pointer to free object #24 1.197 #24 1.197 runtime stack: #24 1.198 runtime.throw({0x703f56?, 0x0?}) #24 1.199 runtime/panic.go:1229 +0x38 fp=0x7b97932ba00 sp=0x7b97932b9d0 pc=0x93918 #24 1.200 runtime.(*mspan).reportZombies(0x55474772a8) #24 1.200 runtime/mgcsweep.go:893 +0x314 fp=0x7b97932ba80 sp=0x7b97932ba00 pc=0x4a834 Full log can be found at https://gist.github.com/egonelbre/15e79abdd3d298028791d33f2392d865 The relevant information about qemu version: $ docker buildx create --name multiplatform --driver docker-container --bootstrap $ docker exec buildx_buildkit_multiplatform0 buildkit-qemu-aarch64 --version qemu-aarch64 version 10.0.4 (v10.0.4) Copyright (c) 2003-2025 Fabrice Bellard and the QEMU Project developers $ docker exec buildx_buildkit_multiplatform0 uname -a Linux 6f5951803e5a 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 Linux One common denominator seems to be Ubuntu 22.04 host that also @wadey mentioned.

A related issue on arm64 #76985 . Activity Next egonelbre commented on Feb 12, 2026 egonelbre on Feb 12, 2026 Contributor Author More actions Looks like a latest Ubuntu 22.04 does not trigger the issue, so there must be some additional important detail: First attempt to setup on a Ubuntu 22.04 VM # Add Docker's official GPG key: sudo apt update sudo apt install ca-certificates curl sudo install -m 0755 -d /etc/apt/keyrings sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc sudo chmod a+r /etc/apt/keyrings/docker.asc # Add the repository to Apt sources: sudo tee /etc/apt/sources.list.d/docker.sources << EOF Types: deb URIs: https://download.docker.com/linux/ubuntu Suites: $( . /etc/os-release && echo " ${UBUNTU_CODENAME :- $VERSION_CODENAME } " ) Components: stable Signed-By: /etc/apt/keyrings/docker.asc EOF sudo apt update # Install Docker VERSION_STRING=5:29.1.5-1~ubuntu.22.04~jammy sudo apt install docker-ce= $VERSION_STRING docker-ce-cli= $VERSION_STRING containerd.io docker-buildx-plugin docker-compose- # Start Docker sudo systemctl start docker # Install qemu emulation that buildkit uses sudo docker run --privileged --rm tonistiigi/binfmt:qemu-v10.0.4 --install arm64 # Run tests sudo docker run -it --rm --platform linux/arm64 golang:1.26 go test -v regexp Some additional details, in case they are relevant: Working system kernel: user@host:~$ uname -a Linux instance-20260212-065741 6.8.0-1046-gcp #49~22.04.1-Ubuntu SMP Mon Jan 19 12:29:23 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux Non-working system kernel: user@host:~# uname -a Linux build-1 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux lscpu working system Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Address sizes: 48 bits physical, 48 bits virtual Byte Order: Little Endian CPU(s): 2 On-line CPU(s) list: 0,1 Vendor ID: AuthenticAMD Model name: AMD EPYC 7B12 CPU family: 23 Model: 49 Thread(s) per core: 2 Core(s) per socket: 1 Socket(s): 1 Stepping: 0 BogoMIPS: 4499.99 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 x2apic mo vbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext ssbd ibr s ibpb stibp vmmcall fsgsbase tsc_adjust bmi1 avx2 smep bmi2 rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 clzero xsav eerptr arat npt nrip_save umip rdpid Virtualization features: Hypervisor vendor: KVM Virtualization type: full Caches (sum of all): L1d: 32 KiB (1 instance) L1i: 32 KiB (1 instance) L2: 512 KiB (1 instance) L3: 16 MiB (1 instance) NUMA: NUMA node(s): 1 NUMA node0 CPU(s): 0,1 Vulnerabilities: Gather data sampling: Not affected Itlb multihit: Not affected L1tf: Not affected Mds: Not affected Meltdown: Not affected Mmio stale data: Not affected Reg file data sampling: Not affected Retbleed: Mitigation; untrained return thunk; SMT enabled with STIBP protection Spec rstack overflow: Mitigation; Safe RET Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization Spectre v2: Mitigation; Retpolines; IBPB conditional; STIBP always-on; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected Srbds: Not affected Tsx async abort: Not affected Vmscape: Not affected lscpu non-working system Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Address sizes: 46 bits physical, 48 bits virtual Byte Order: Little Endian CPU(s): 12 On-line CPU(s) list: 0-11 Vendor ID: GenuineIntel Model name: Intel(R) Xeon(R) CPU @ 2.30GHz CPU family: 6 Model: 63 Thread(s) per core: 2 Core(s) per socket: 6 Socket(s): 1 Stepping: 0

The rest of this page is on the live site.