Skip to content

runtime: unable to build code on go1.19, fails with errors around runtime gc fatal error: mallocgc called without a P or outside bootstrapping #54213

Closed
@arirubinstein

Description

@arirubinstein

What version of Go are you using (go version)?

1.19
specifically, the docker builder: golang:1.19-bullseye

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

Operating System - building with docker.
Host os = macOS 12.4, docker version 4.11.0 (83626)
Host architecture = ARM64/M1
Guest infrastructure = qemu amd64

What did you do?

on an M1 running macOS and Docker:

  1. git clone https://github.com/Agoric/ag0.git
  2. cd ag0
  3. git checkout gobug
  4. docker buildx build --build-arg version_name=test --platform linux/amd64 --file Dockerfile .
  5. build will repeatedly fail in the amd64 build

What did you expect to see?

both arm64 and amd64 builds succeed the go build through docker, as they did with go 1.18

What did you see instead?

The errors differ each time but seem to revolve around:
mallocgc called without a P or outside bootstrapping

I was able to reproduce this issue on two machines as well, both M1s. I was also able to build the code successfully on an actual md64 machine on go1.19 without issue. This appears to only be an issue when go is invoked through docker+qemu+amd64.

Here are the logs from 4 separate invocations: https://gist.github.com/arirubinstein/ddc81ed44a2ca19c5c2c77049cca91dd

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions