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

rustup segfaults when running in a linux/amd64 docker container on macOS M3 host #3902

Closed
2 tasks done
staktrace opened this issue Jun 24, 2024 · 6 comments
Closed
2 tasks done
Labels
bug O-containers Not really OS-related, but container-specific

Comments

@staktrace
Copy link

Verification

Problem

Running rustup inside a linux/amd64 docker container on an M3 macOS machine segfaults. Instead it should not segfault.

Steps

On a Macbook Pro with a Apple M3 Max chip, running Sonoma 14.5 (23F79). I have docker installed, and start a docker container like so:

docker run --platform linux/amd64 -it ubuntu:22.04

Inside the docker container, I run the following:

cd
apt-get update
apt install -y curl
curl https://sh.rustup.rs -sSf | sh -s -- -y

The rustup command produces this output:

info: downloading installer
info: profile set to 'default'
info: default host triple is x86_64-unknown-linux-gnu
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2024-06-13, rust version 1.79.0 (129f3b996 2024-06-10)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
info: downloading component 'rust-std'
info: downloading component 'rustc'
 63.8 MiB /  63.8 MiB (100 %)  56.2 MiB/s in  1s ETA:  0s
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
Segmentation fault

Possible Solution(s)

Running the docker command with --platform linux/aarch64 and intead of --platform linux/amd64 allows the rustup command to succeed. However I need the amd64 docker build as I need to install other tools that are only precompiled for amd64.

Notes

No response

Rustup version

rustup 1.27.1 (54dd3d00f 2024-04-24)

Installed toolchains

N/A since the toolchain installation is the problem

OS version

macOS Sonoma 14.5 (23F79)
@staktrace staktrace added the bug label Jun 24, 2024
@ehuss
Copy link
Contributor

ehuss commented Jun 24, 2024

I believe this is the same as rust-lang/rust#125430, which has some workarounds. I believe this may be a Docker issue, and I'm not sure how possible it would be for rustup to work around it.

@staktrace
Copy link
Author

Ah, thanks. I'll close this issue as a dupe of rust-lang/rust#125430 then.

staktrace added a commit to staktrace/mozsearch that referenced this issue Jun 24, 2024
rustup doesn't work in a amd64 container on aarch64 host. See
rust-lang/rustup#3902
@staktrace
Copy link
Author

For the record, disabling Rosetta in the Docker Desktop options does also solve this problem, as mentioned in rust-lang/rust#125430

@djc djc reopened this Jun 24, 2024
@djc djc closed this as not planned Won't fix, can't repro, duplicate, stale Jun 24, 2024
@rami3l rami3l added the O-containers Not really OS-related, but container-specific label Jun 25, 2024
@geraldstanje
Copy link

geraldstanje commented Jun 26, 2024

@staktrace i had the same issue in macbook pro m1 - disabling rosetta in the Docker Desktop also helped there.
do you plan to fix it also for not disabling rosetta in the Docker Desktop? what is the consequence of disabling rosetta - will the compile time for rust be slower because of that?

@staktrace
Copy link
Author

@geraldstanje I don't plan on fixing it, no. Seems like a docker desktop bug. You'd have to ask docker folks.

@kylehassett
Copy link

For those looking for a solution right now, disable Rosetta in Docker Desktop's General settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug O-containers Not really OS-related, but container-specific
Projects
None yet
Development

No branches or pull requests

6 participants