Skip to content

runtime: stalls under Rosetta2 with MacOS 14.5 #68485

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

Open
flostadler opened this issue Jul 17, 2024 · 7 comments
Open

runtime: stalls under Rosetta2 with MacOS 14.5 #68485

flostadler opened this issue Jul 17, 2024 · 7 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. OS-Darwin
Milestone

Comments

@flostadler
Copy link

flostadler commented Jul 17, 2024

Go version

go version go1.22.4 darwin/arm64

Output of go env in your module/workspace:

n/a

What did you do?

I have a go amd64 binary that is running fine with Rosetta2 in MacOS 14.4 and earlier. After upgrading to MacOS 14.5 it stalls.

As a workaround, running the binary with GODEBUG=asyncpreemptoff=1 works.

The binary is https://github.com/pulumi/pulumi-aws with version v6.42.0+.

I wasn't able to create a minimal example that triggers this, but to reproduce it you can do the following (you need an AWS account but nothing gets created):

  • install pulumi: brew install pulumi
  • create project: mkdir rosetta-stall-repro && cd rosetta-stall-repro && pulumi new aws-typescript
  • select the affected version (this in turn downloads the go binary): yarn upgrade @pulumi/[email protected]
  • run the arm64 binary (works): pulumi preview
  • download the amd64 binary:
    • pushd ~/.pulumi/plugins/resource-aws-v6.42.0
    • wget https://github.com/pulumi/pulumi-aws/releases/download/v6.42.0/pulumi-resource-aws-v6.42.0-darwin-amd64.tar.gz
    • tar -xvzf pulumi-resource-aws-v6.42.0-darwin-amd64.tar.gz
    • popd
  • run the amd64 binary (stalls): pulumi preview

What did you see happen?

Getting the following error before the runtime stalls:

assertion failed [arm_interval().contains(address)]: code fragment does not contain the given arm address
(CodeFragmentMetadata.cpp:48 instruction_extents_for_arm_address)

CodeFragmentMetadata.cpp seems to be part of Rosetta2:

strings /Library/Apple/usr/libexec/oah/runtime | grep CodeFragmentMetadata.cpp
CodeFragmentMetadata.cpp

What did you expect to see?

The runtime shouldn't stall and execute normally.

@gabyhelp
Copy link

Related Issues and Documentation

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

@seankhliao seankhliao changed the title Runtime stalls under Rosetta2 with MacOS 14.5 runtime: stalls under Rosetta2 with MacOS 14.5 Jul 17, 2024
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 17, 2024
@seankhliao
Copy link
Member

Why are you using an amd64 binary when an arm64 one is available?

@cherrymui
Copy link
Member

Thanks for reporting. This looks like a bug in Rosetta2. The assertion failure is Rosetta 2's internal failure.

Do you have a simpler reproducer, without an AWS account? Does this reproduce consistently, or just fail occasionally? With more information we can report to Apple and have them reproduce. Thanks.

@cherrymui cherrymui added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jul 17, 2024
@cherrymui cherrymui added this to the Backlog milestone Jul 17, 2024
@mknyszek
Copy link
Contributor

mknyszek commented Jul 31, 2024

In triage @cherrymui mentioned that she tried to reproduce on the latest macOS at the time (14.5 and 15.0 beta) and was unable to (at least with all.bash).

@flostadler
Copy link
Author

@cherrymui @mknyszek I know this is a very convoluted repro, but we sadly don't have a simpler one :/ It is failing constantly for us. Let me know if I can help you repro in any way!

@cherrymui
Copy link
Member

If you could make it self-contained, without an AWS account, it would be helpful. Even if it is just a binary, we can point the binary and let Apple know that, run that binary in Rosetta 2 and it fails. Thanks.

@nina-nee
Copy link

There is a relatively simple way to replicate the issue that does not rely on any accounts: compile v.5.69.0 or any newer version of https://github.com/hashicorp/terraform-provider-aws with golang v1.23 for Darwin-amd64, and just run the compiled binary multiple times on Apple Silicon Macs. It hangs quite reliably, every few other runs.

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. OS-Darwin
Projects
Development

No branches or pull requests

7 participants