Skip to content

Build failures when cross-compiling #10

@CpuID

Description

@CpuID

Note: I'm using the fork https://github.com/ZigZagT/fluent-bit-go-redis-output but see similiar issues with this repo, evidence for both included

I've been cross-compiling binaries for arm64 targets on amd64 build machines, and found various build failures:

  • some CGO errors (amongst other things)
  • builds that hang
  • exec errors
  • lfstack.push errors

I also hit some toolchain related errors, I suspect these are just settings rather than actual bugs.

https://github.com/CpuID/go-c-unsupported-vma-range-repro/actions/runs/14586168497 has a good summary of the various failures, its a matrix job that splits on:

  • go version (currently 1.24.1 only)
  • ubuntu-24.04 (amd64) vs ubuntu-24.04-arm (amd64) based CI runner
  • amd64 and arm GOARCH targeting
  • this repo vs the forked repo

build (1.24.1, ubuntu-24.04, amd64, no_docker, majst01, 556919d57c274432e54dcaac5a8c308127fde3b4)

build (1.24.1, ubuntu-24.04, amd64, no_docker, ZigZagT, cd1cd84e11091c76b55a89765ce6dacc35af4f84)

build (1.24.1, ubuntu-24.04-arm, amd64, no_docker, majst01, 556919d57c274432e54dcaac5a8c308127fde...

build (1.24.1, ubuntu-24.04-arm, amd64, no_docker, ZigZagT, cd1cd84e11091c76b55a89765ce6dacc35af4...

aarch64-linux-gnu-gcc: error: unrecognized command-line option '-m64'

I suspect this one is a toolchain configuration issue, not a bug.

build (1.24.1, ubuntu-24.04, arm64, docker, majst01, 556919d57c274432e54dcaac5a8c308127fde3b4)

build (1.24.1, ubuntu-24.04, arm64, docker, ZigZagT, cd1cd84e11091c76b55a89765ce6dacc35af4f84)

Hangs, takes forever to build, never succeeds (I set a 2min timeout, the average for others was 45sec).

Note: I've managed to get build failures for this configuration elsewhere, which have what feels like a Go bug?

2.590 go: downloading gopkg.in/yaml.v3 v3.0.1
589.6 FATAL: ThreadSanitizer: unsupported VMA range
589.6 FATAL: Found 47 - Supported 48
589.6 exit status 66
589.6 FAIL	github.com/majst01/fluent-bit-go-redis-output	0.068s

build (1.24.1, ubuntu-24.04, arm64, no_docker, majst01, 556919d57c274432e54dcaac5a8c308127fde3b4)

build (1.24.1, ubuntu-24.04, arm64, no_docker, ZigZagT, cd1cd84e11091c76b55a89765ce6dacc35af4f84)

fork/exec /tmp/go-build843066597/b001/fluent-bit-go-redis-output.test: exec format error

Is this one a bug...?

build (1.24.1, ubuntu-24.04-arm, amd64, docker, majst01, 556919d57c274432e54dcaac5a8c308127fde3b4)

build (1.24.1, ubuntu-24.04-arm, amd64, docker, ZigZagT, cd1cd84e11091c76b55a89765ce6dacc35af4f84)

Huge stack trace for this one, but the initial summary:

#12 0.657 runtime: lfstack.push invalid packing: node=0xffbf3acb07c0 cnt=0x1 packed=0xffbf3acb07c00001 -> node=0xffffffbf3acb07c0
#12 0.657 fatal error: lfstack.push
#12 0.659 
#12 0.659 runtime stack:
#12 0.660 runtime.throw({0xa2d5cd?, 0xc0002f2968?})
#12 0.660 	/usr/local/go/src/runtime/panic.go:1047 +0x5d fp=0xffbf32bffd90 sp=0xffbf32bffd60 pc=0x4376fd
#12 0.660 runtime.(*lfstack).push(0x2?, 0xffbf32bffe40?)
#12 0.660 	/usr/local/go/src/runtime/lfstack.go:30 +0x125 fp=0xffbf32bffdd0 sp=0xffbf32bffd90 pc=0x40d1e5
#12 0.661 runtime.(*spanSetBlockAlloc).free(...)
#12 0.661 	/usr/local/go/src/runtime/mspanset.go:292
#12 0.661 runtime.(*spanSet).reset(0xe68018)
#12 0.661 	/usr/local/go/src/runtime/mspanset.go:265 +0x70 fp=0xffbf32bffe00 sp=0xffbf32bffdd0 pc=0x4321b0
#12 0.661 runtime.finishsweep_m()
#12 0.661 	/usr/local/go/src/runtime/mgcsweep.go:260 +0x9c fp=0xffbf32bffe40 sp=0xffbf32bffe00 pc=0x4267bc
#12 0.661 runtime.gcStart.func1()
#12 0.661 	/usr/local/go/src/runtime/mgc.go:668 +0x17 fp=0xffbf32bffe50 sp=0xffbf32bffe40 pc=0x41b9b7
#12 0.661 runtime.systemstack()
#12 0.661 	/usr/local/go/src/runtime/asm_amd64.s:492 +0x49 fp=0xffbf32bffe58 sp=0xffbf32bffe50 pc=0x466349

This feels like a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions