Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 opened this issue Aug 3, 2022 · 4 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@arirubinstein
Copy link

arirubinstein commented Aug 3, 2022

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

@odeke-em odeke-em changed the title Unable to build go code on go1.19, with errors around runtime gc fatal error: mallocgc called without a P or outside bootstrapping runtime: unable to build code on go1.19, fails with errors around runtime gc fatal error: mallocgc called without a P or outside bootstrapping Aug 3, 2022
@odeke-em
Copy link
Member

odeke-em commented Aug 3, 2022

Thank you for this report @arirubinstein! Kindly paging the runtime team @mknyszek @randall77 @aclements @cherrymui

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Aug 3, 2022
@odeke-em odeke-em added NeedsInvestigation 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. and removed compiler/runtime Issues related to the Go compiler and/or runtime. labels Aug 3, 2022
@randall77
Copy link
Contributor

randall77 commented Aug 3, 2022

We've generally had problems with bugs in qemu. It is not a supported platform. See #1508 for details.
I'm not sure there is anything we can do here. I would guess it is some sort of bug in qemu threads. Please reopen if you can reproduce without qemu, or if someone can investigate and determine it is something suspicious in the runtime (e.g. depending on something not guaranteed by posix).

@jeyrce
Copy link

jeyrce commented Sep 25, 2022

@randall77 I meet the same problem in macos(apple chip), docker-desktop were powered by qemu.

@a3sroot
Copy link

a3sroot commented Oct 28, 2022

gzip error: mallocgc called without a P or outside bootstrapping
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

6 participants